Rev 1787 | Rev 1790 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1787 | Rev 1789 | ||
|---|---|---|---|
| Line 24... | Line 24... | ||
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
27 | */ |
| 28 | 28 | ||
| 29 | #ifndef __OFW_H__ |
29 | #ifndef BOOT_OFW_H_ |
| 30 | #define __OFW_H__ |
30 | #define BOOT_OFW_H_ |
| 31 | 31 | ||
| 32 | #include <types.h> |
32 | #include <types.h> |
| 33 | #include <stdarg.h> |
33 | #include <stdarg.h> |
| 34 | 34 | ||
| 35 | #define BUF_SIZE 1024 |
35 | #define BUF_SIZE 1024 |
| 36 | 36 | ||
| 37 | #define MEMMAP_MAX_RECORDS 32 |
37 | #define MEMMAP_MAX_RECORDS 32 |
| 38 | 38 | ||
| 39 | #define MAX_OFW_ARGS 12 |
39 | #define MAX_OFW_ARGS 12 |
| 40 | 40 | ||
| 41 | typedef unsigned long ofw_arg_t; |
41 | typedef unative_t ofw_arg_t; |
| 42 | typedef unsigned int ihandle; |
42 | typedef unsigned int ihandle; |
| 43 | typedef unsigned int phandle; |
43 | typedef unsigned int phandle; |
| 44 | 44 | ||
| 45 | /** OpenFirmware command structure |
45 | /** OpenFirmware command structure |
| 46 | * |
46 | * |
| Line 62... | Line 62... | ||
| 62 | unsigned int count; |
62 | unsigned int count; |
| 63 | memzone_t zones[MEMMAP_MAX_RECORDS]; |
63 | memzone_t zones[MEMMAP_MAX_RECORDS]; |
| 64 | } memmap_t; |
64 | } memmap_t; |
| 65 | 65 | ||
| 66 | typedef struct { |
66 | typedef struct { |
| 67 | uint32_t addr; |
67 | void *addr; |
| 68 | unsigned int width; |
68 | unsigned int width; |
| 69 | unsigned int height; |
69 | unsigned int height; |
| 70 | unsigned int bpp; |
70 | unsigned int bpp; |
| 71 | unsigned int scanline; |
71 | unsigned int scanline; |
| 72 | } screen_t; |
72 | } screen_t; |
| 73 | 73 | ||
| 74 | typedef struct { |
74 | typedef struct { |
| 75 | uint32_t addr; |
75 | void *addr; |
| 76 | unsigned int size; |
76 | unsigned int size; |
| 77 | } keyboard_t; |
77 | } keyboard_t; |
| 78 | 78 | ||
| 79 | typedef struct { |
79 | typedef struct { |
| 80 | unsigned int info; |
80 | unsigned int info; |
| Line 90... | Line 90... | ||
| 90 | 90 | ||
| 91 | extern uintptr_t ofw_cif; |
91 | extern uintptr_t ofw_cif; |
| 92 | 92 | ||
| 93 | extern phandle ofw_aliases; |
93 | extern phandle ofw_aliases; |
| 94 | 94 | ||
| 95 | extern void init(void); |
95 | extern void ofw_init(void); |
| 96 | extern void ofw_write(const char *str, const int len); |
96 | extern void ofw_write(const char *str, const int len); |
| 97 | 97 | ||
| 98 | extern int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen); |
98 | extern int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen); |
| 99 | extern phandle ofw_find_device(const char *name); |
99 | extern phandle ofw_find_device(const char *name); |
| 100 | 100 | ||
| 101 | extern int ofw(ofw_args_t *arg); |
101 | extern int ofw(ofw_args_t *arg); |
| - | 102 | extern unsigned int ofw_get_address_cells(const phandle device); |
|
| - | 103 | extern unsigned int ofw_get_size_cells(const phandle device); |
|
| 102 | extern void *ofw_translate(const void *virt); |
104 | extern void *ofw_translate(const void *virt); |
| 103 | extern int ofw_translate_failed(ofw_arg_t flag); |
105 | extern int ofw_translate_failed(ofw_arg_t flag); |
| 104 | extern void *ofw_claim(const void *virt, const int len); |
106 | extern void *ofw_claim(const void *virt, const int len); |
| 105 | extern int ofw_map(const void *phys, const void *virt, const int size, const int mode); |
107 | extern int ofw_map(const void *phys, const void *virt, const int size, const int mode); |
| 106 | extern int ofw_memmap(memmap_t *map); |
108 | extern int ofw_memmap(memmap_t *map); |