Missing functions and function pointers for P1, GPIO, and ACPI GPIO, also changed kbc_p1 to uint8_t because P1 (and P2) function like any other (GP) I/O port - open bus is 0xff with clear bits being those that are pulled down.

This commit is contained in:
OBattler
2023-10-07 06:04:35 +02:00
parent 990073854a
commit 0438ed32a5
2 changed files with 1053 additions and 984 deletions

View File

@@ -299,10 +299,10 @@ typedef struct _machine_ {
uint32_t type;
uintptr_t chipset;
int (*init)(const struct _machine_ *);
uint8_t (*p1_handler)(uint8_t write, uint8_t val);
uint32_t (*gpio_handler)(uint8_t write, uint32_t val);
uintptr_t pad;
uintptr_t pad0;
uintptr_t pad1;
uintptr_t available_flag;
uint32_t (*gpio_acpi_handler)(uint8_t write, uint32_t val);
const machine_cpu_t cpu;
uintptr_t bus_flags;
uintptr_t flags;
@@ -314,10 +314,7 @@ typedef struct _machine_ {
#else
void *kbc_device;
#endif /* EMU_DEVICE_H */
/* Bits:
7-0 Set bits are forced set on P1 (no forced set = 0x00);
15-8 Clear bits are forced clear on P1 (no foced clear = 0xff). */
uint16_t kbc_p1;
uint8_t kbc_p1;
uint32_t gpio;
uint32_t gpio_acpi;
#ifdef EMU_DEVICE_H
@@ -375,11 +372,17 @@ extern int machine_has_mouse(void);
extern int machine_is_sony(void);
extern uint8_t machine_get_p1(void);
extern void machine_load_p1(void);
extern void machine_set_p1(uint8_t val);
extern void machine_init_p1(void);
extern uint8_t machine_handle_p1(uint8_t write, uint8_t val);
extern uint32_t machine_get_gpio(void);
extern void machine_load_gpio(void);
extern void machine_set_gpio(uint32_t gpio);
extern void machine_set_gpio(uint32_t val);
extern void machine_init_gpio(void);
extern uint32_t machine_handle_gpio(uint8_t write, uint32_t val);
extern uint32_t machine_get_gpio_acpi(void);
extern void machine_set_gpio_acpi(uint32_t gpio_val);
extern void machine_init_gpio_acpi(void);
extern uint32_t machine_handle_gpio_acpi(uint8_t write, uint32_t val);
/* Initialization functions for boards and systems. */
extern void machine_common_init(const machine_t *);

File diff suppressed because it is too large Load Diff