diff options
| author | Matt Borgerson <mborgerson@gmail.com> | 2016-07-29 19:34:36 -0700 |
|---|---|---|
| committer | Matt Borgerson <mborgerson@gmail.com> | 2016-07-29 19:34:36 -0700 |
| commit | f5f70f60dc5b5d2122af8e0f2e84d1f8c6a6326d (patch) | |
| tree | f5f030e11b9a4124b1298d5b7c269b8da8961692 | |
| parent | d0613af9687dbc481af38f7fd71dd87e939bbd6c (diff) | |
Make inline assembly volatile
| -rw-r--r-- | gdbstub_sys.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdbstub_sys.c b/gdbstub_sys.c index 956cb9a..9e5de28 100644 --- a/gdbstub_sys.c +++ b/gdbstub_sys.c @@ -57,7 +57,7 @@ uint32_t dbg_get_cs(void) { uint32_t cs; - asm( + asm volatile ( "push %%cs;" "pop %%eax;" /* Outputs */ : "=a" (cs) @@ -98,7 +98,7 @@ int dbg_init_gates(void) */ int dbg_load_idt(struct dbg_idtr *idtr) { - asm( + asm volatile ( "lidt %0" /* Outputs */ : /* None */ /* Inputs */ : "m" (*idtr) @@ -113,7 +113,7 @@ int dbg_load_idt(struct dbg_idtr *idtr) */ int dbg_store_idt(struct dbg_idtr *idtr) { - asm( + asm volatile ( "sidt %0" /* Outputs */ : "=m" (*idtr) /* Inputs */ : /* None */ @@ -221,7 +221,7 @@ void dbg_interrupt(struct dbg_interrupt_state *istate) */ void dbg_io_write_8(uint16_t port, uint8_t val) { - asm( + asm volatile ( "outb %%al, %%dx;" /* Outputs */ : /* None */ /* Inputs */ : "a" (val), "d" (port) @@ -236,7 +236,7 @@ uint8_t dbg_io_read_8(uint16_t port) { uint8_t val; - asm( + asm volatile ( "inb %%dx, %%al;" /* Outputs */ : "=a" (val) /* Inputs */ : "d" (port) @@ -337,5 +337,5 @@ void dbg_start(void) dbg_hook_idt(3, dbg_int_handlers[3]); /* Interrupt to start debugging. */ - asm("int3"); + asm volatile ("int3"); } |
