blob: b8ded38ef8d7367d6cc58ffcf48d1c08ee9476ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#ifndef _IPXE_IOMAP_H
#define _IPXE_IOMAP_H
/** @file
*
* iPXE I/O mapping API
*
* The I/O mapping API provides methods for mapping and unmapping I/O
* devices.
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
#include <ipxe/api.h>
#include <config/ioapi.h>
#include <ipxe/uaccess.h>
/**
* Calculate static inline I/O mapping API function name
*
* @v _prefix Subsystem prefix
* @v _api_func API function
* @ret _subsys_func Subsystem API function
*/
#define IOMAP_INLINE( _subsys, _api_func ) \
SINGLE_API_INLINE ( IOMAP_PREFIX_ ## _subsys, _api_func )
/**
* Provide an I/O mapping API implementation
*
* @v _prefix Subsystem prefix
* @v _api_func API function
* @v _func Implementing function
*/
#define PROVIDE_IOMAP( _subsys, _api_func, _func ) \
PROVIDE_SINGLE_API ( IOMAP_PREFIX_ ## _subsys, _api_func, _func )
/**
* Provide a static inline I/O mapping API implementation
*
* @v _prefix Subsystem prefix
* @v _api_func API function
*/
#define PROVIDE_IOMAP_INLINE( _subsys, _api_func ) \
PROVIDE_SINGLE_API_INLINE ( IOMAP_PREFIX_ ## _subsys, _api_func )
/* Include all architecture-independent I/O API headers */
#include <ipxe/iomap_virt.h>
/* Include all architecture-dependent I/O API headers */
#include <bits/iomap.h>
/**
* Map bus address as an I/O address
*
* @v bus_addr Bus address
* @v len Length of region
* @ret io_addr I/O address
*/
void * ioremap ( unsigned long bus_addr, size_t len );
/**
* Unmap I/O address
*
* @v io_addr I/O address
*/
void iounmap ( volatile const void *io_addr );
/**
* Convert I/O address to bus address (for debug only)
*
* @v io_addr I/O address
* @ret bus_addr Bus address
*/
unsigned long io_to_bus ( volatile const void *io_addr );
#endif /* _IPXE_IOMAP_H */
|