1 // Structure layout of cpu registers the the bios uses.
3 // Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
5 // This file may be distributed under the terms of the GNU LGPLv3 license.
16 #define CR0_PG (1<<31) // Paging
17 #define CR0_CD (1<<30) // Cache disable
18 #define CR0_NW (1<<29) // Not Write-through
19 #define CR0_PE (1<<0) // Protection enable
24 #include "farptr.h" // struct segoff_s
26 /****************************************************************
27 * Registers saved/restored in romlayout.S
28 ****************************************************************/
30 #include "types.h" // u16
32 #define UREG(ER, R, RH, RL) union { u32 ER; struct { u16 R; u16 R ## _hi; }; struct { u8 RL; u8 RH; u8 R ## _hilo; u8 R ## _hihi; }; }
34 // Layout of registers passed in to irq handlers. Note that this
35 // layout corresponds to code in romlayout.S - don't change it here
36 // without also updating the assembler code.
40 UREG(edi, di, di8u, di8l);
41 UREG(esi, si, si8u, si8l);
42 UREG(ebp, bp, bp8u, bp8l);
43 UREG(ebx, bx, bh, bl);
44 UREG(edx, dx, dh, dl);
45 UREG(ecx, cx, ch, cl);
46 UREG(eax, ax, ah, al);
52 /****************************************************************
54 ****************************************************************/
57 set_cf(struct bregs *regs, int cond)
65 // Frequently used return codes
66 #define RET_EUNSUPPORTED 0x86
69 set_success(struct bregs *regs)
75 set_code_success(struct bregs *regs)
82 set_invalid_silent(struct bregs *regs)
88 set_code_invalid_silent(struct bregs *regs, u8 code)
94 #endif // !__ASSEMBLY__