]> git.karo-electronics.de Git - mv-sheeva.git/blob - include/linux/mmiotrace.h
x86 mmiotrace: comment about user space ABI
[mv-sheeva.git] / include / linux / mmiotrace.h
1 #ifndef MMIOTRACE_H
2 #define MMIOTRACE_H
3
4 #include <asm/types.h>
5
6 /*
7  * If you change anything here, you must bump MMIO_VERSION.
8  * This is the relay data format for user space.
9  */
10 #define MMIO_VERSION 0x04
11
12 /* mm_io_header.type */
13 #define MMIO_OPCODE_MASK 0xff
14 #define MMIO_OPCODE_SHIFT 0
15 #define MMIO_WIDTH_MASK 0xff00
16 #define MMIO_WIDTH_SHIFT 8
17 #define MMIO_MAGIC (0x6f000000 | (MMIO_VERSION<<16))
18 #define MMIO_MAGIC_MASK 0xffff0000
19
20 enum mm_io_opcode {          /* payload type: */
21         MMIO_READ = 0x1,     /* struct mm_io_rw */
22         MMIO_WRITE = 0x2,    /* struct mm_io_rw */
23         MMIO_PROBE = 0x3,    /* struct mm_io_map */
24         MMIO_UNPROBE = 0x4,  /* struct mm_io_map */
25         MMIO_MARKER = 0x5,   /* raw char data */
26         MMIO_UNKNOWN_OP = 0x6, /* struct mm_io_rw */
27 };
28
29 struct mm_io_header {
30         __u32 type;     /* see MMIO_* macros above */
31         __u32 sec;      /* timestamp */
32         __u32 nsec;
33         __u32 pid;      /* PID of the process, or 0 for kernel core */
34         __u16 data_len; /* length of the following payload */
35 };
36
37 struct mm_io_rw {
38         __u64 address; /* virtual address of register */
39         __u64 value;
40         __u64 pc;      /* optional program counter */
41 };
42
43 struct mm_io_map {
44         __u64 phys;  /* base address in PCI space */
45         __u64 addr;  /* base virtual address */
46         __u64 len;   /* mapping size */
47         __u64 pc;    /* optional program counter */
48 };
49
50
51 /*
52  * These structures are used to allow a single relay_write()
53  * call to write a full packet.
54  */
55
56 struct mm_io_header_rw {
57         struct mm_io_header header;
58         struct mm_io_rw rw;
59 } __attribute__((packed));
60
61 struct mm_io_header_map {
62         struct mm_io_header header;
63         struct mm_io_map map;
64 } __attribute__((packed));
65
66 #endif /* MMIOTRACE_H */