haiku/headers/private/drivers/poke.h
Oscar Lesta 59b54f3810 poke: use phys_addr_t for mem_map_args's physical_address field
This is needed to fix usage of POKE_GET_PHYSICAL_ADDRESS on
x86 32 bits (with PAE).

Change-Id: Ic00185ec7fcf9b6666ad6169a752d8b8edd2b61b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5975
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-02 15:02:32 +00:00

71 lines
1.2 KiB
C

/*
* Copyright 2005, Oscar Lesta. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _POKE_DRIVER_H_
#define _POKE_DRIVER_H_
#include <Drivers.h>
#include <ISA.h>
#include <PCI.h>
#define POKE_DEVICE_NAME "poke"
#define POKE_DEVICE_FULLNAME "/dev/misc/poke"
#define POKE_SIGNATURE 'wltp' // "We Like To Poke"
enum {
POKE_PORT_READ = B_DEVICE_OP_CODES_END + 1,
POKE_PORT_WRITE,
POKE_PORT_INDEXED_READ,
POKE_PORT_INDEXED_WRITE,
POKE_PCI_READ_CONFIG,
POKE_PCI_WRITE_CONFIG,
POKE_GET_NTH_PCI_INFO,
POKE_GET_PHYSICAL_ADDRESS,
POKE_MAP_MEMORY,
POKE_UNMAP_MEMORY
};
typedef struct {
uint32 signature;
uint8 index;
pci_info* info;
status_t status;
} pci_info_args;
typedef struct {
uint32 signature;
uint16 port;
uint8 size; // == index for POKE_PORT_INDEXED_*
uint32 value;
} port_io_args;
typedef struct {
uint32 signature;
uint8 bus;
uint8 device;
uint8 function;
uint8 size;
uint8 offset;
uint32 value;
} pci_io_args;
typedef struct {
uint32 signature;
area_id area;
const char* name;
phys_addr_t physical_address;
size_t size;
uint32 flags;
uint32 protection;
void* address;
} mem_map_args;
#endif // _POKE_DRIVER_H_