X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=api%2Fapi.c;h=c5f6edb83f812f7f3df98915c65d0feea4bf2ee1;hp=0598d9082dc368915bb877195de33677f864c72a;hb=3d5920a31bb846249385e1ca5c086662c39bc44e;hpb=8d79953d03e6c5b24215609997dafe4daa623cd6 diff --git a/api/api.c b/api/api.c index 0598d9082d..c5f6edb83f 100644 --- a/api/api.c +++ b/api/api.c @@ -3,33 +3,14 @@ * * Written by: Rafal Jaworowski * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * + * SPDX-License-Identifier: GPL-2.0+ */ #include - -#if defined(CONFIG_API) - #include #include #include +#include #include #include @@ -38,11 +19,6 @@ #define DEBUG #undef DEBUG -/* U-Boot routines needed */ -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -extern uchar (*env_get_char)(int); -extern uchar *env_get_addr(int); - /***************************************************************************** * * This is the API core. @@ -535,7 +511,7 @@ static int API_env_enum(va_list ap) for (i = 0; env_get_char(i) != '\0'; i = n + 1) { for (n = i; env_get_char(n) != '\0'; ++n) { - if (n >= CFG_ENV_SIZE) { + if (n >= CONFIG_ENV_SIZE) { /* XXX shouldn't we set *next = NULL?? */ return 0; } @@ -560,6 +536,50 @@ static int API_env_enum(va_list ap) return 0; } +/* + * pseudo signature: + * + * int API_display_get_info(int type, struct display_info *di) + */ +static int API_display_get_info(va_list ap) +{ + int type; + struct display_info *di; + + type = va_arg(ap, int); + di = va_arg(ap, struct display_info *); + + return display_get_info(type, di); +} + +/* + * pseudo signature: + * + * int API_display_draw_bitmap(ulong bitmap, int x, int y) + */ +static int API_display_draw_bitmap(va_list ap) +{ + ulong bitmap; + int x, y; + + bitmap = va_arg(ap, ulong); + x = va_arg(ap, int); + y = va_arg(ap, int); + + return display_draw_bitmap(bitmap, x, y); +} + +/* + * pseudo signature: + * + * void API_display_clear(void) + */ +static int API_display_clear(va_list ap) +{ + display_clear(); + return 0; +} + static cfp_t calls_table[API_MAXCALL] = { NULL, }; /* @@ -583,7 +603,7 @@ int syscall(int call, int *retval, ...) va_list ap; int rv; - if (call < 0 || call >= calls_no || calls_table[call] == NULL) { + if (call < 0 || call >= calls_no) { debugf("invalid call #%d\n", call); return 0; } @@ -623,6 +643,9 @@ void api_init(void) calls_table[API_ENV_GET] = &API_env_get; calls_table[API_ENV_SET] = &API_env_set; calls_table[API_ENV_ENUM] = &API_env_enum; + calls_table[API_DISPLAY_GET_INFO] = &API_display_get_info; + calls_table[API_DISPLAY_DRAW_BITMAP] = &API_display_draw_bitmap; + calls_table[API_DISPLAY_CLEAR] = &API_display_clear; calls_no = API_MAXCALL; debugf("API initialized with %d calls\n", calls_no); @@ -666,5 +689,3 @@ void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long siz return; } } - -#endif /* CONFIG_API */