* Copyright 2023, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef ISA_H
#define ISA_H
#include <bus_manager.h>
#ifdef __cplusplus
extern "C" {
#endif
* ISA scatter/gather dma support.
*/
typedef struct {
uint32 address;
uint16 transfer_count;
uint8 reserved;
uint8 flag;
} isa_dma_entry;
#define B_LAST_ISA_DMA_ENTRY 0x80 // sets end of link flag
#define B_MAX_ISA_DMA_COUNT 0x10000
#define B_ISA_MODULE_NAME "bus_managers/isa/v1"
enum {
B_8_BIT_TRANSFER,
B_16_BIT_TRANSFER
};
typedef struct isa_module_info {
bus_manager_info binfo;
uint8 (*read_io_8) (int mapped_io_addr);
void (*write_io_8) (int mapped_io_addr, uint8 value);
uint16 (*read_io_16) (int mapped_io_addr);
void (*write_io_16) (int mapped_io_addr, uint16 value);
uint32 (*read_io_32) (int mapped_io_addr);
void (*write_io_32) (int mapped_io_addr, uint32 value);
phys_addr_t (*ram_address) (phys_addr_t physical_address_in_system_memory);
long (*make_isa_dma_table) (
const void *buffer,
long buffer_size,
ulong num_bits,
isa_dma_entry *table,
long num_entries
);
status_t (*start_isa_dma) (
long channel,
void *buf,
long transfer_count,
uchar mode,
uchar e_mode
);
long (*start_scattered_isa_dma) (
long channel,
const isa_dma_entry *table,
uchar mode,
uchar emode
);
status_t (*lock_isa_dma_channel) (long channel);
status_t (*unlock_isa_dma_channel) (long channel);
} isa_module_info;
#ifdef __cplusplus
}
#endif
#endif