/*-1* Copyright (c) 2008 Semihalf, Rafal Jaworowski <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/2526/*27* This is the header file for conveniency wrapper routines (API glue)28*/2930#ifndef _API_GLUE_H_31#define _API_GLUE_H_3233#include "api_public.h"3435/*36* Mask used to align the start address for API signature search to 1MiB37*/38#define API_SIG_SEARCH_MASK ~0x000fffff3940/*41* Search for the API signature within 3MiB of the 1MiB-aligned address that42* U-Boot has hinted us.43*/44#define API_SIG_SEARCH_LEN 0x003000004546int syscall(int, int *, ...);47extern void *syscall_ptr;4849int api_parse_cmdline_sig(int argc, char **argv, struct api_signature **sig);50int api_search_sig(struct api_signature **sig);5152#define UB_MAX_MR 16 /* max mem regions number */53#define UB_MAX_DEV 6 /* max devices number */5455/*56* The ub_ library calls are part of the application, not U-Boot code! They57* are front-end wrappers that are used by the consumer application: they58* prepare arguments for particular syscall and jump to the low level59* syscall()60*/6162/* console */63int ub_getc(void);64int ub_tstc(void);65void ub_putc(char);66void ub_puts(const char *);6768/* system */69void ub_reset(void) __dead2;70struct sys_info *ub_get_sys_info(void);7172/* time */73void ub_udelay(unsigned long);74unsigned long ub_get_timer(unsigned long);7576/* env vars */77char *ub_env_get(const char *);78void ub_env_set(const char *, char *);79const char *ub_env_enum(const char *);8081/* devices */82int ub_dev_enum(void);83int ub_dev_open(int);84int ub_dev_close(int);85int ub_dev_read(int, void *, lbasize_t, lbastart_t, lbasize_t *);86int ub_dev_send(int, void *, int);87int ub_dev_recv(int, void *, int, int *);88struct device_info *ub_dev_get(int);8990void ub_dump_di(int);91void ub_dump_si(struct sys_info *);92char *ub_mem_type(int);93char *ub_stor_type(int);9495#endif /* _API_GLUE_H_ */969798