aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-12-13 11:25:25 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-12-13 11:25:25 -0500
commitad901592515cf7eaddfb86f610919fd9479dd3da (patch)
tree7eda29fec6389e6a9e71c1f62257d3688ca7d56d /src/util.h
parent2edace134c323e47c3ad23f4635deb3d14a556b3 (diff)
downloadseabios-ad901592515cf7eaddfb86f610919fd9479dd3da.tar.gz
Enhance experimental option rom "threading" - enable preemption.
When experimental support for parallelizing option roms and hardware init (default disabled) is selected, add support for checking on hardware init progress from the RTC irq handler. Enable ability for RTC to be turned on for additional users. Allow regular option roms (not just vga option roms) to run in parallel with hardware init. Don't use stack in transition32 / transition16 until new mode is entered. Also, cleanup leaking of data handlers in usb code. Also, decrease frequency of iomemcpy checks (every 2K instead of 1K).
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/util.h b/src/util.h
index 6837dbba..1eafce05 100644
--- a/src/util.h
+++ b/src/util.h
@@ -126,16 +126,6 @@ static inline u8 readb(const void *addr) {
return *(volatile const u8 *)addr;
}
-// GDT bit manipulation
-#define GDT_BASE(v) ((((u64)(v) & 0xff000000) << 32) \
- | (((u64)(v) & 0x00ffffff) << 16))
-#define GDT_LIMIT(v) ((((u64)(v) & 0x000f0000) << 32) \
- | (((u64)(v) & 0x0000ffff) << 0))
-#define GDT_CODE (0x9bULL << 40) // Code segment - P,R,A bits also set
-#define GDT_DATA (0x93ULL << 40) // Data segment - W,A bits also set
-#define GDT_B (0x1ULL << 54) // Big flag
-#define GDT_G (0x1ULL << 55) // Granularity flag
-
#define call16_simpint(nr, peax, pflags) do { \
ASSERT16(); \
asm volatile( \
@@ -150,6 +140,21 @@ static inline u8 readb(const void *addr) {
: "cc", "memory"); \
} while (0)
+// GDT bit manipulation
+#define GDT_BASE(v) ((((u64)(v) & 0xff000000) << 32) \
+ | (((u64)(v) & 0x00ffffff) << 16))
+#define GDT_LIMIT(v) ((((u64)(v) & 0x000f0000) << 32) \
+ | (((u64)(v) & 0x0000ffff) << 0))
+#define GDT_CODE (0x9bULL << 40) // Code segment - P,R,A bits also set
+#define GDT_DATA (0x93ULL << 40) // Data segment - W,A bits also set
+#define GDT_B (0x1ULL << 54) // Big flag
+#define GDT_G (0x1ULL << 55) // Granularity flag
+
+struct descloc_s {
+ u16 length;
+ u32 addr;
+} PACKED;
+
// util.c
struct bregs;
inline void call16(struct bregs *callregs);
@@ -188,6 +193,9 @@ struct thread_info *getCurThread();
void yield();
void run_thread(void (*func)(void*), void *data);
void wait_threads();
+void start_preempt();
+void finish_preempt();
+void check_preempt();
// output.c
void debug_serial_setup();
@@ -252,6 +260,8 @@ u64 calc_future_tsc(u32 msecs);
u64 calc_future_tsc_usec(u32 usecs);
void handle_1583(struct bregs *regs);
void handle_1586(struct bregs *regs);
+void useRTC();
+void releaseRTC();
// apm.c
void VISIBLE16 handle_1553(struct bregs *regs);