Disabled interrupt call to isrCommon, currently causes GPF if called from interrupt.
This commit is contained in:
parent
f26aa6bcbd
commit
56cd64ef93
@ -28,6 +28,7 @@ proc idtFlush(){.inline,asmNoStackFrame.} =
|
|||||||
ret
|
ret
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
#[
|
||||||
proc isrHandler(registers: Registers){.exportc, codegenDecl: "__attribute__((interrupt)) $# $#$#".} =
|
proc isrHandler(registers: Registers){.exportc, codegenDecl: "__attribute__((interrupt)) $# $#$#".} =
|
||||||
serial.write("Recieved interrupt handler:")
|
serial.write("Recieved interrupt handler:")
|
||||||
serial.write(registers.int_no)
|
serial.write(registers.int_no)
|
||||||
@ -53,6 +54,7 @@ proc isrCommon(){.asmNoStackFrame,exportc.} =
|
|||||||
add $8, %esp
|
add $8, %esp
|
||||||
iret
|
iret
|
||||||
"""
|
"""
|
||||||
|
]#
|
||||||
|
|
||||||
macro generateISR(code: static[uint8], isError: static[bool]): typed =
|
macro generateISR(code: static[uint8], isError: static[bool]): typed =
|
||||||
result = nnkStmtList.newTree(
|
result = nnkStmtList.newTree(
|
||||||
@ -68,10 +70,6 @@ macro generateISR(code: static[uint8], isError: static[bool]): typed =
|
|||||||
),
|
),
|
||||||
newEmptyNode(),
|
newEmptyNode(),
|
||||||
nnkStmtList.newTree(
|
nnkStmtList.newTree(
|
||||||
nnkAsmStmt.newTree(
|
|
||||||
newEmptyNode(),
|
|
||||||
newLit((if isError: "" else: "push 0\x0A") & "push " & $code & "\x0A")
|
|
||||||
),
|
|
||||||
nnkCall.newTree(
|
nnkCall.newTree(
|
||||||
nnkDotExpr.newTree(
|
nnkDotExpr.newTree(
|
||||||
newIdentNode("serial"),
|
newIdentNode("serial"),
|
||||||
@ -93,8 +91,9 @@ macro generateISR(code: static[uint8], isError: static[bool]): typed =
|
|||||||
),
|
),
|
||||||
newLit("\x0A")
|
newLit("\x0A")
|
||||||
),
|
),
|
||||||
nnkCall.newTree(
|
nnkAsmStmt.newTree(
|
||||||
newIdentNode("isrCommon")
|
newEmptyNode(),
|
||||||
|
newLit((if isError: "" else: "push 0\x0A") & "push " & $code & "\x0A")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -42,3 +42,4 @@ proc kernelMain() {.exportc: "kernel_main"}=
|
|||||||
terminalWrite("\LMAX_UINT:")
|
terminalWrite("\LMAX_UINT:")
|
||||||
terminalWrite(high(uint32))
|
terminalWrite(high(uint32))
|
||||||
terminalWrite("\L")
|
terminalWrite("\L")
|
||||||
|
asm """int $0x3"""
|
Loading…
Reference in New Issue
Block a user