Minor cleanup and a hack to idle the cpu in getc loops.
diff --git a/app/pcitests/pci_tests.c b/app/pcitests/pci_tests.c
index 19c11dc..a1f2119 100644
--- a/app/pcitests/pci_tests.c
+++ b/app/pcitests/pci_tests.c
@@ -93,7 +93,7 @@
}
/*
- * a somewhat fugly pci config space examin/modify command. this should probably
+ * a somewhat fugly pci config space examine/modify command. this should probably
* be broken up a bit.
*/
static int pci_config(int argc, const cmd_args *argv)
diff --git a/arch/x86/asm.S b/arch/x86/asm.S
index 4d7763c..8916243 100644
--- a/arch/x86/asm.S
+++ b/arch/x86/asm.S
@@ -22,21 +22,3 @@
*/
#include <asm.h>
-
- /* context switch frame is as follows:
- * ulr
- * usp
- * lr
- * r11
- * r10
- * r9
- * r8
- * r7
- * r6
- * r5
- * r4
- */
-/* x86_context_switch(addr_t *old_sp, addr_t new_sp) */
-FUNCTION(x86_context_switch)
- /* TODO */
- ret
diff --git a/arch/x86/ops.S b/arch/x86/ops.S
index 17c08ae..9a97948 100644
--- a/arch/x86/ops.S
+++ b/arch/x86/ops.S
@@ -80,7 +80,13 @@
/* void arch_idle(); */
FUNCTION(arch_idle)
+ pushf
+ popl %eax
+ andl $0x200, %eax
+ test %eax, %eax
+ je 1f /* don't halt if local interrupts are disabled */
hlt
+1:
ret
/* void arch_switch_stacks_and_call(addr_t call, addr_t stack) */
diff --git a/platform/pc/debug.c b/platform/pc/debug.c
index e87bc56..06ac263 100644
--- a/platform/pc/debug.c
+++ b/platform/pc/debug.c
@@ -37,7 +37,11 @@
int dgetc(char *c)
{
- return platform_read_key(c);
+ int ret = platform_read_key(c);
+ if (ret < 0)
+ arch_idle();
+
+ return ret;
}
void debug_dump_regs(void)