2020-03-26 05:13:19 +03:00
|
|
|
#ifndef __LIB__REAL_H__
|
|
|
|
#define __LIB__REAL_H__
|
2019-05-31 06:47:13 +03:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2020-04-23 13:56:15 +03:00
|
|
|
#define rm_seg(x) ((uint16_t)(((int)x & 0xffff0) >> 4))
|
|
|
|
#define rm_off(x) ((uint16_t)(((int)x & 0x0000f) >> 0))
|
2019-06-02 00:34:24 +03:00
|
|
|
|
2020-03-26 05:13:19 +03:00
|
|
|
#define rm_desegment(seg, off) (((uint32_t)(seg) << 4) + (uint32_t)(off))
|
|
|
|
|
2019-06-03 01:14:32 +03:00
|
|
|
#define EFLAGS_CF (1 << 0)
|
2020-03-27 03:59:11 +03:00
|
|
|
#define EFLAGS_ZF (1 << 6)
|
2019-06-03 01:14:32 +03:00
|
|
|
|
2019-05-31 06:47:13 +03:00
|
|
|
struct rm_regs {
|
2020-09-02 05:39:27 +03:00
|
|
|
uint16_t gs;
|
|
|
|
uint16_t fs;
|
|
|
|
uint16_t es;
|
|
|
|
uint16_t ds;
|
2019-06-03 01:14:32 +03:00
|
|
|
uint32_t eflags;
|
2019-05-31 06:47:13 +03:00
|
|
|
uint32_t ebp;
|
|
|
|
uint32_t edi;
|
|
|
|
uint32_t esi;
|
|
|
|
uint32_t edx;
|
|
|
|
uint32_t ecx;
|
|
|
|
uint32_t ebx;
|
|
|
|
uint32_t eax;
|
2020-09-02 05:39:27 +03:00
|
|
|
} __attribute__((packed));
|
2019-05-31 06:47:13 +03:00
|
|
|
|
2020-04-29 17:53:05 +03:00
|
|
|
void rm_int(uint8_t int_no, struct rm_regs *out_regs, struct rm_regs *in_regs);
|
2019-05-31 06:47:13 +03:00
|
|
|
|
2020-12-19 15:52:29 +03:00
|
|
|
__attribute__((noreturn)) void rm_hcf(void);
|
|
|
|
|
2019-05-31 06:47:13 +03:00
|
|
|
#endif
|