Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
yield_toirq();
}
printf("Rebooting.\n");
- struct bregs br;
- memset(&br, 0, sizeof(br));
- br.code = SEGOFF(SEG_BIOS, (u32)reset_vector);
- farcall16big(&br);
+ reset();
}
// Determine next boot method and attempt a boot using it.
== (KF0_CTRLACTIVE|KF0_ALTACTIVE))) {
// Ctrl+alt+del - reset machine.
SET_BDA(soft_reset_flag, 0x1234);
- reset_vector();
+ reset();
}
if (scancode >= ARRAY_SIZE(scan_to_scanascii)) {
dprintf(1, "KBD: int09h_handler(): unknown scancode read: 0x%02x!\n"
farcall16(callregs);
}
+// Reset the machine
+void
+reset(void)
+{
+ extern void reset_vector(void) __noreturn;
+ if (!MODESEGMENT)
+ call16(0, 0, reset_vector);
+ reset_vector();
+}
+
/****************************************************************
* Threads
extern void irq_trampoline_ ##nr (); \
__call16_int((callregs), (u32)&irq_trampoline_ ##nr ); \
} while (0)
+void reset(void);
extern struct thread_info MainThread;
struct thread_info *getCurThread(void);
void yield(void);
// resume.c
extern int HaveRunPost;
-// romlayout.S
-void reset_vector(void) __noreturn;
-
// serial.c
void serial_setup(void);
void lpt_setup(void);