46 #include "../x86emu/prim_ops.h"
56 __func__, intNum,
my_rdl(intNum * 4));
66 M.x86.R_CS =
my_rdw(intNum * 4 + 2);
67 M.x86.R_IP =
my_rdw(intNum * 4);
89 else if (
M.x86.R_AL == 6)
103 my_wrw(0x450 + (
M.x86.R_BH * 2),
M.x86.R_DX);
113 M.x86.R_DX =
my_rdw(0x450 + (
M.x86.R_BH * 2));
137 if (
M.x86.R_BH ==
my_rdb(0x462)) {
138 for (i = 0; i <
M.x86.R_CX; i++)
149 if (
M.x86.R_BH ==
my_rdb(0x462)) {
150 for (i = 0; i <
M.x86.R_CX; i++)
180 printf(
"%s(): unknown function (%x) for int10 handler.\n",
181 __func__,
M.x86.R_AH);
183 M.x86.R_AX,
M.x86.R_BX,
M.x86.R_CX,
192 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
193 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
194 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
195 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
196 0x39, 0x02, 0x28, 0x04, 0x05, 0x06, 0x08, 0x28,
197 0x0a, 0x0b, 0x09, 0x2b, 0x33, 0x0d, 0x34, 0x35,
198 0x0b, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
199 0x09, 0x0a, 0x27, 0x27, 0x33, 0x2b, 0x34, 0x35,
200 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
201 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
202 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
203 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
204 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
205 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
206 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
207 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
208 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
209 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
210 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
211 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
212 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
213 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
214 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
215 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
216 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
217 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
218 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
219 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
221 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
222 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
223 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
233 if (*keycode < 256) {
235 char_code = (
u8) * keycode & 0xff;
244 printf(
"%s(): unknown multibyte keycode: %llx\n",
250 *keycode = (
u64) ((((
u16) scan_code) << 8) | char_code);
265 u64 *keycode = (
u64 *) (
M.mem_base + 0x41e);
269 __func__,
M.x86.R_AH);
271 M.x86.R_BX,
M.x86.R_CX,
M.x86.R_DX);
272 switch (
M.x86.R_AH) {
276 M.x86.R_AX = (
u16) * keycode;
291 M.x86.R_AX = (
u16) * keycode;
305 printf(
"tt%c%c", 0x08, 0x08);
308 while ((
c = -1 ) != -1) {
309 *keycode = (*keycode << 8) |
c;
321 M.x86.R_AX = (
u16) * keycode;
329 printf(
"%s(): unknown function (%x) for int16 handler.\n",
330 __func__,
M.x86.R_AH);
332 M.x86.R_AX,
M.x86.R_BX,
M.x86.R_CX,
347 switch (
M.x86.R_AX) {
351 M.x86.R_EDX = 0x20494350;
363 __func__,
M.x86.R_AX);
371 && (
M.x86.R_SI == 0)) {
375 }
else if (
CONFIG(YABEL_PCI_ACCESS_OTHER_DEVICES)) {
381 (
"%s(): function %x: PCI Find Device --> 0x%04x\n",
382 __func__,
M.x86.R_AX,
M.x86.R_BX);
387 (
"%s(): function %x: invalid device/vendor/device index! (%04x/%04x/%02x expected: %04x/%04x/00)\n",
388 __func__,
M.x86.R_AX,
M.x86.R_CX,
M.x86.R_DX,
405 DEBUG_PRINTF_INTR(
"%s(): function: %x: PCI Config Read from device: bus: %02x, devfn: %02x, offset: %02x\n",
406 __func__,
M.x86.R_AX,
bus, devfn, offs);
410 }
else if (
CONFIG(YABEL_PCI_ACCESS_OTHER_DEVICES)) {
418 (
"%s(): Config read access invalid device! bus: %02x (%02x), devfn: %02x (%02x), offs: %02x\n",
427 switch (
M.x86.R_AX) {
430 #if CONFIG(PCI_OPTION_ROM_RUN_YABEL)
438 (
"%s(): function %x: PCI Config Read @%02x --> 0x%02x\n",
439 __func__,
M.x86.R_AX, offs,
444 #if CONFIG(PCI_OPTION_ROM_RUN_YABEL)
452 (
"%s(): function %x: PCI Config Read @%02x --> 0x%04x\n",
453 __func__,
M.x86.R_AX, offs,
458 #if CONFIG(PCI_OPTION_ROM_RUN_YABEL)
466 (
"%s(): function %x: PCI Config Read @%02x --> 0x%08x\n",
467 __func__,
M.x86.R_AX, offs,
487 (
"%s(): Config read access invalid! bus: %x (%x), devfn: %x (%x), offs: %x\n",
496 switch (
M.x86.R_AX) {
498 #if CONFIG(PCI_OPTION_ROM_RUN_YABEL)
502 devfn, offs,
M.x86.R_CL);
505 (
"%s(): function %x: PCI Config Write @%02x <-- 0x%02x\n",
506 __func__,
M.x86.R_AX, offs,
510 #if CONFIG(PCI_OPTION_ROM_RUN_YABEL)
514 devfn, offs,
M.x86.R_CX);
517 (
"%s(): function %x: PCI Config Write @%02x <-- 0x%04x\n",
518 __func__,
M.x86.R_AX, offs,
522 #if CONFIG(PCI_OPTION_ROM_RUN_YABEL)
526 devfn, offs,
M.x86.R_ECX);
529 (
"%s(): function %x: PCI Config Write @%02x <-- 0x%08x\n",
530 __func__,
M.x86.R_AX, offs,
538 printf(
"%s(): unknown function (%x) for int1a handler.\n",
539 __func__,
M.x86.R_AX);
541 M.x86.R_AX,
M.x86.R_BX,
M.x86.R_CX,
553 #ifndef DEBUG_PRINT_INT10
561 DEBUG_PRINTF_INTR(
"%s(%x) intHandler overridden, calling it...\n", __func__, intNum);
569 if ((
my_rdl(intNum * 4) == 0xF000F065) ||
570 (
my_rdl(intNum * 4) == 0xF4F4F4F4))
575 (
"%s(%x): invalid interrupt Vector (%08x) found, interrupt ignored...\n",
576 __func__, intNum,
my_rdl(intNum * 4));
578 M.x86.R_AX,
M.x86.R_BX,
M.x86.R_CX,
605 printf(
"Interrupt %#x (Vector: %x) not implemented\n", intNum,
608 M.x86.R_AX,
M.x86.R_BX,
M.x86.R_CX,
640 M.x86.R_CS =
M.x86.R_SS;
641 M.x86.R_IP =
M.x86.R_SP;
678 M.x86.R_CS =
M.x86.R_SS;
679 M.x86.R_IP =
M.x86.R_SP;
yabel_handleIntFunc yabel_intFuncArray[256]
#define STACK_START_OFFSET
#define DEBUG_PRINT_INT10
#define DEBUG_PRINTF_INTR(_x...)
#define DEBUG_PRINTF(_x...)
#define DEBUG_TRACE_X86EMU
biosemu_device_t bios_device
DEVTREE_CONST struct device * pcidev_path_on_bus(unsigned int bus, pci_devfn_t devfn)
struct device * dev_find_device(u16 vendor, u16 device, struct device *from)
Find a device of a given vendor and type.
const char * dev_path(const struct device *dev)
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
static __always_inline u16 pci_read_config16(const struct device *dev, u16 reg)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg)
static __always_inline void pci_write_config16(const struct device *dev, u16 reg, u16 val)
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
static void handleInt10(void)
static void translate_keycode(u64 *keycode)
void handleInterrupt(int intNum)
static void handleInt16(void)
static u8 keycode_table[256]
static void setupInt(int intNum)
static void handleInt1a(void)
void my_wrb(u32 addr, u8 val)
void my_wrw(u32 addr, u16 val)
int rtas_pci_config_read(long long, int, int, int, int)
int rtas_pci_config_write(long long, int, int, int, int, int)
DEVTREE_CONST struct bus * bus
#define c(value, pmcreg, dst_bits)
#define DEBUG_TRACECALL_REGS_F
#define DEBUG_TRACECALL_F
int X86EMU_trace_on(void)
#define DEBUG_TRACEJMP_REGS_F