//
// Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
//
-// This file may be distributed under the terms of the GNU GPLv3 license.
+// This file may be distributed under the terms of the GNU LGPLv3 license.
#ifndef __BREGS_H
#define __BREGS_H
// CPU flag bitdefs
-#define F_ZF (1<<6)
#define F_CF (1<<0)
+#define F_ZF (1<<6)
+#define F_IF (1<<9)
// CR0 flags
#define CR0_PG (1<<31) // Paging
#ifndef __ASSEMBLY__
+#include "farptr.h" // struct segoff_s
+
/****************************************************************
* Registers saved/restored in romlayout.S
****************************************************************/
struct bregs {
u16 ds;
u16 es;
- UREG(edi, di, di_hi, di_lo);
- UREG(esi, si, si_hi, si_lo);
+ UREG(edi, di, di8u, di8l);
+ UREG(esi, si, si8u, si8l);
+ UREG(ebp, bp, bp8u, bp8l);
UREG(ebx, bx, bh, bl);
UREG(edx, dx, dh, dl);
UREG(ecx, cx, ch, cl);
UREG(eax, ax, ah, al);
- u16 ip;
- u16 cs;
+ struct segoff_s code;
u16 flags;
} PACKED;
}
static inline void
-set_fail_silent(struct bregs *regs)
+set_invalid_silent(struct bregs *regs)
{
set_cf(regs, 1);
}
static inline void
-set_code_fail_silent(struct bregs *regs, u8 code)
+set_code_invalid_silent(struct bregs *regs, u8 code)
{
regs->ah = code;
set_cf(regs, 1);
}
-#define set_fail(regs) \
- __set_fail(__func__, __LINE__, (regs))
-#define set_code_fail(regs, code) \
- __set_code_fail(__func__, __LINE__, (regs), (code))
-
-// output.c
-void __set_fail(const char *fname, int lineno, struct bregs *regs);
-void __set_code_fail(const char *fname, int lineno, struct bregs *regs, u8 code);
-
#endif // !__ASSEMBLY__
#endif // bregs.h