glue.h 1.7 KB

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