MINI2440: Removed unneeded dependency
[u-boot-openmoko/mini2440.git] / api_examples / glue.h
bloba82f783cbe08163566dfa7803ad81b7f7c1be76b
1 /*
2 * (C) Copyright 2007 Semihalf
4 * Written by: Rafal Jaworowski <raj@semihalf.com>
6 * See file CREDITS for list of people who contributed to this
7 * project.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
27 * This is the header file for conveniency wrapper routines (API glue)
30 #ifndef _API_GLUE_H_
31 #define _API_GLUE_H_
33 #define API_SEARCH_START (255 * 1024 * 1024) /* start at 1MB below top RAM */
34 #define API_SEARCH_END (256 * 1024 * 1024 - 1) /* ...and search to the end */
36 int syscall(int, int *, ...);
37 void * syscall_ptr;
39 int api_search_sig(struct api_signature **sig);
42 * ub_ library calls are part of the application, not U-Boot code! They are
43 * front-end wrappers that are used by the consumer application: they prepare
44 * arguments for particular syscall and jump to the low level syscall()
47 /* console */
48 int ub_getc(void);
49 int ub_tstc(void);
50 void ub_putc(char c);
51 void ub_puts(const char *s);
53 /* system */
54 void ub_reset(void);
55 struct sys_info * ub_get_sys_info(void);
57 /* time */
58 void ub_udelay(unsigned long);
59 unsigned long ub_get_timer(unsigned long);
61 /* env vars */
62 char * ub_env_get(const char *name);
63 void ub_env_set(const char *name, char *value);
64 const char * ub_env_enum(const char *last);
66 /* devices */
67 int ub_dev_enum(void);
68 int ub_dev_open(int handle);
69 int ub_dev_close(int handle);
70 int ub_dev_read(int handle, void *buf,
71 lbasize_t len, lbastart_t start);
72 int ub_dev_send(int handle, void *buf, int len);
73 int ub_dev_recv(int handle, void *buf, int len);
74 struct device_info * ub_dev_get(int);
76 #endif /* _API_GLUE_H_ */