1
2
3
4
5
6
7#ifndef __SANDBOX_ASM_IO_H
8#define __SANDBOX_ASM_IO_H
9
10
11
12
13
14
15#define MAP_NOCACHE (0)
16#define MAP_WRCOMBINE (0)
17#define MAP_WRBACK (0)
18#define MAP_WRTHROUGH (0)
19
20void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags);
21
22
23
24
25void unmap_physmem(const void *vaddr, unsigned long flags);
26
27
28static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
29{
30 return map_physmem(paddr, len, MAP_WRBACK);
31}
32
33
34static inline void unmap_sysmem(const void *vaddr)
35{
36 unmap_physmem(vaddr, MAP_WRBACK);
37}
38
39
40phys_addr_t map_to_sysmem(const void *ptr);
41
42
43#define readb(addr) ((void)addr, 0)
44#define readw(addr) ((void)addr, 0)
45#define readl(addr) ((void)addr, 0)
46#define writeb(v, addr) ((void)addr)
47#define writew(v, addr) ((void)addr)
48#define writel(v, addr) ((void)addr)
49
50
51int inl(unsigned int addr);
52int inw(unsigned int addr);
53int inb(unsigned int addr);
54
55void outl(unsigned int value, unsigned int addr);
56void outw(unsigned int value, unsigned int addr);
57void outb(unsigned int value, unsigned int addr);
58
59static inline void _insw(volatile u16 *port, void *buf, int ns)
60{
61}
62
63static inline void _outsw(volatile u16 *port, const void *buf, int ns)
64{
65}
66
67#define insw(port, buf, ns) _insw((u16 *)port, buf, ns)
68#define outsw(port, buf, ns) _outsw((u16 *)port, buf, ns)
69
70
71#define out16(addr, val)
72#define in16(addr) 0
73
74#include <iotrace.h>
75#include <asm/types.h>
76
77#endif
78