Files
86Box/src/include/86box/isapnp.h

75 lines
2.4 KiB
C
Raw Normal View History

2021-03-20 01:21:02 -03:00
/*
2023-01-06 15:36:05 -05:00
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
2021-03-20 01:21:02 -03:00
*
2023-01-06 15:36:05 -05:00
* This file is part of the 86Box distribution.
2021-03-20 01:21:02 -03:00
*
2023-01-06 15:36:05 -05:00
* Definitions for ISA Plug and Play.
2021-03-20 01:21:02 -03:00
*
*
*
2023-01-06 15:36:05 -05:00
* Authors: RichardG, <richardg867@gmail.com>
2021-03-20 01:21:02 -03:00
*
2023-01-06 15:36:05 -05:00
* Copyright 2021 RichardG.
2021-03-20 01:21:02 -03:00
*/
2022-02-18 19:42:21 -05:00
2021-03-20 01:21:02 -03:00
#ifndef EMU_ISAPNP_H
2022-09-18 17:15:38 -04:00
#define EMU_ISAPNP_H
#include <stdint.h>
2021-03-20 01:21:02 -03:00
2022-09-18 17:15:38 -04:00
#define ISAPNP_MEM_DISABLED 0
#define ISAPNP_IO_DISABLED 0
#define ISAPNP_IRQ_DISABLED 0
#define ISAPNP_DMA_DISABLED 4
2021-03-20 01:21:02 -03:00
2021-05-20 00:30:12 -03:00
enum {
2023-06-26 12:47:04 -04:00
ISAPNP_CARD_DISABLE = 0,
ISAPNP_CARD_ENABLE = 1,
ISAPNP_CARD_FORCE_CONFIG = 2, /* cheat code for UMC UM8669F */
ISAPNP_CARD_NO_KEY = 3 /* cheat code for Crystal CS423x */
2021-05-20 00:30:12 -03:00
};
2023-06-28 13:46:28 -04:00
typedef struct isapnp_device_config_t {
2022-09-18 17:15:38 -04:00
uint8_t activate;
2023-06-28 13:46:28 -04:00
struct pnp_mem_t {
2023-06-26 12:47:04 -04:00
uint32_t base : 24;
uint32_t size : 24;
2021-03-20 01:21:02 -03:00
} mem[4];
2023-06-28 13:46:28 -04:00
struct pnp_mem32_t {
2023-06-26 12:47:04 -04:00
uint32_t base;
uint32_t size;
2021-03-20 01:21:02 -03:00
} mem32[4];
2023-06-28 13:46:28 -04:00
struct pnp_io_t {
2022-09-18 17:15:38 -04:00
uint16_t base;
2021-03-20 01:21:02 -03:00
} io[8];
2023-06-28 13:46:28 -04:00
struct pnp_irq_t {
2023-06-26 12:47:04 -04:00
uint8_t irq : 4;
uint8_t level : 1;
uint8_t type : 1;
2021-03-20 01:21:02 -03:00
} irq[2];
2023-06-28 13:46:28 -04:00
struct pnp_dma_t {
2022-09-18 17:15:38 -04:00
uint8_t dma : 3;
2021-03-20 01:21:02 -03:00
} dma[2];
} isapnp_device_config_t;
extern const uint8_t isapnp_init_key[32];
void *isapnp_add_card(uint8_t *rom, uint16_t rom_size,
void (*config_changed)(uint8_t ld, isapnp_device_config_t *config, void *priv),
void (*csn_changed)(uint8_t csn, void *priv),
uint8_t (*read_vendor_reg)(uint8_t ld, uint8_t reg, void *priv),
void (*write_vendor_reg)(uint8_t ld, uint8_t reg, uint8_t val, void *priv),
void *priv);
void isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size);
void isapnp_enable_card(void *priv, uint8_t enable);
void isapnp_set_csn(void *priv, uint8_t csn);
uint8_t isapnp_read_reg(void *priv, uint8_t ldn, uint8_t reg);
void isapnp_write_reg(void *priv, uint8_t ldn, uint8_t reg, uint8_t val);
void isapnp_set_device_defaults(void *priv, uint8_t ldn, const isapnp_device_config_t *config);
void isapnp_reset_card(void *priv);
void isapnp_reset_device(void *priv, uint8_t ld);
2021-03-20 01:21:02 -03:00
2022-09-18 17:15:38 -04:00
#endif /*EMU_ISAPNP_H*/