haiku/headers/private/drivers/poke.h
X512 0bb43cbf5a poke: map area into client team in POKE_MAP_MEMORY ioctl
After this change `POKE_UNMAP_MEMORY` ioctl will became redurant and
an alias for `delete_area()`. Areas will be automatically deleted
on team exit.

Change-Id: I336b49c2281abf064e1bf28d908c7b2c5afd4df0
2023-12-23 22:26:26 -05:00

72 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_