]> git.ipfire.org Git - people/ms/u-boot.git/blame - examples/api/glue.h
core: add ofnode_get_by_phandle() api
[people/ms/u-boot.git] / examples / api / glue.h
CommitLineData
500856eb
RJ
1/*
2 * (C) Copyright 2007 Semihalf
3 *
4 * Written by: Rafal Jaworowski <raj@semihalf.com>
5 *
1a459660 6 * SPDX-License-Identifier: GPL-2.0+
500856eb
RJ
7 */
8
9/*
10 * This is the header file for conveniency wrapper routines (API glue)
11 */
12
13#ifndef _API_GLUE_H_
14#define _API_GLUE_H_
15
b84d7d8f 16#define API_SEARCH_LEN (3 * 1024 * 1024) /* 3MB search range */
500856eb 17
923aa481
RJ
18#define UB_MAX_MR 5 /* max mem regions number */
19#define UB_MAX_DEV 6 /* max devices number */
20
b84d7d8f
RJ
21extern void *syscall_ptr;
22extern uint32_t search_hint;
500856eb 23
b84d7d8f 24int syscall(int, int *, ...);
500856eb
RJ
25int api_search_sig(struct api_signature **sig);
26
27/*
923aa481
RJ
28 * The ub_ library calls are part of the application, not U-Boot code! They
29 * are front-end wrappers that are used by the consumer application: they
30 * prepare arguments for particular syscall and jump to the low level
31 * syscall()
500856eb
RJ
32 */
33
34/* console */
35int ub_getc(void);
36int ub_tstc(void);
37void ub_putc(char c);
38void ub_puts(const char *s);
39
40/* system */
41void ub_reset(void);
42struct sys_info * ub_get_sys_info(void);
43
44/* time */
45void ub_udelay(unsigned long);
46unsigned long ub_get_timer(unsigned long);
47
48/* env vars */
49char * ub_env_get(const char *name);
50void ub_env_set(const char *name, char *value);
51const char * ub_env_enum(const char *last);
52
53/* devices */
54int ub_dev_enum(void);
55int ub_dev_open(int handle);
56int ub_dev_close(int handle);
923aa481
RJ
57int ub_dev_read(int handle, void *buf, lbasize_t len,
58 lbastart_t start, lbasize_t *rlen);
500856eb 59int ub_dev_send(int handle, void *buf, int len);
923aa481 60int ub_dev_recv(int handle, void *buf, int len, int *rlen);
500856eb
RJ
61struct device_info * ub_dev_get(int);
62
a2a5729f
CLC
63/* display */
64int ub_display_get_info(int type, struct display_info *di);
65int ub_display_draw_bitmap(ulong bitmap, int x, int y);
66void ub_display_clear(void);
67
500856eb 68#endif /* _API_GLUE_H_ */