1 // Structure layout of cpu registers that 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.
10 #include "types.h" // u16
11 #include "x86.h" // F_CF
14 /****************************************************************
15 * Registers saved/restored in romlayout.S
16 ****************************************************************/
18 #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; }; }
20 // Layout of registers passed in to irq handlers. Note that this
21 // layout corresponds to code in romlayout.S - don't change it here
22 // without also updating the assembler code.
26 UREG(edi, di, di8u, di8l);
27 UREG(esi, si, si8u, si8l);
28 UREG(ebp, bp, bp8u, bp8l);
29 UREG(ebx, bx, bh, bl);
30 UREG(edx, dx, dh, dl);
31 UREG(ecx, cx, ch, cl);
32 UREG(eax, ax, ah, al);
38 /****************************************************************
40 ****************************************************************/
43 set_cf(struct bregs *regs, int cond)
51 // Frequently used return codes
52 #define RET_EUNSUPPORTED 0x86
55 set_success(struct bregs *regs)
61 set_code_success(struct bregs *regs)
68 set_invalid_silent(struct bregs *regs)
74 set_code_invalid_silent(struct bregs *regs, u8 code)