glue.h 1.7 KB

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