btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / drivers / poke.h
blob334f55063cdc8e83c731f45348bd782b0e615d6e
1 /*
2 * Copyright 2005, Oscar Lesta. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _POKE_DRIVER_H_
6 #define _POKE_DRIVER_H_
8 #include <Drivers.h>
9 #include <ISA.h>
10 #include <PCI.h>
13 #define POKE_DEVICE_NAME "poke"
14 #define POKE_DEVICE_FULLNAME "/dev/misc/poke"
15 #define POKE_SIGNATURE 'wltp' // "We Like To Poke"
18 enum {
19 POKE_PORT_READ = B_DEVICE_OP_CODES_END + 1,
20 POKE_PORT_WRITE,
21 POKE_PORT_INDEXED_READ,
22 POKE_PORT_INDEXED_WRITE,
23 POKE_PCI_READ_CONFIG,
24 POKE_PCI_WRITE_CONFIG,
25 POKE_GET_NTH_PCI_INFO,
26 POKE_GET_PHYSICAL_ADDRESS,
27 POKE_MAP_MEMORY,
28 POKE_UNMAP_MEMORY
32 typedef struct {
33 uint32 signature;
34 uint8 index;
35 pci_info* info;
36 status_t status;
37 } pci_info_args;
40 typedef struct {
41 uint32 signature;
42 uint16 port;
43 uint8 size; // == index for POKE_PORT_INDEXED_*
44 uint32 value;
45 } port_io_args;
48 typedef struct {
49 uint32 signature;
50 uint8 bus;
51 uint8 device;
52 uint8 function;
53 uint8 size;
54 uint8 offset;
55 uint32 value;
56 } pci_io_args;
59 typedef struct {
60 uint32 signature;
61 area_id area;
62 const char* name;
63 void* physical_address;
64 size_t size;
65 uint32 flags;
66 uint32 protection;
67 void* address;
68 } mem_map_args;
70 #endif // _POKE_DRIVER_H_