1 /**
2  * @file lv_uefi_context.c
3  *
4  */
5 
6 /*********************
7  *      INCLUDES
8  *********************/
9 
10 #include "../../lvgl.h"
11 
12 #if LV_USE_UEFI
13 
14 #include "lv_uefi_context.h"
15 #include "lv_uefi_private.h"
16 
17 /*********************
18  *      DEFINES
19  *********************/
20 
21 /**********************
22  *      TYPEDEFS
23  **********************/
24 
25 /**********************
26  *  STATIC PROTOTYPES
27  **********************/
28 
29 /**********************
30  *  GOLBAL VARIABLES
31  **********************/
32 
33 /**********************
34  *  STATIC VARIABLES
35  **********************/
36 
37 /**********************
38  *      MACROS
39  **********************/
40 
41 /**********************
42  *   GLOBAL FUNCTIONS
43  **********************/
44 
45 /**
46  * @brief Initialize the UEFI chache variables.
47  * @param image_handle The handle of the current image
48  * @param system_table Pointer to the system table
49  * @remark This has to be called before lv_init().
50 */
lv_uefi_init(EFI_HANDLE image_handle,EFI_SYSTEM_TABLE * system_table)51 void lv_uefi_init(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * system_table)
52 {
53     LV_ASSERT_NULL(image_handle);
54     LV_ASSERT_NULL(system_table);
55 
56     gLvEfiImageHandle = image_handle;
57     gLvEfiST = system_table;
58     gLvEfiBS = gLvEfiST->BootServices;
59     gLvEfiRT = gLvEfiST->RuntimeServices;
60 }
61 
62 /**
63  * @brief Initialize the LVGL UEFI backend.
64  * @remark This is a private API which is used for LVGL UEFI backend
65  *         implementation. LVGL users shouldn't use that because the
66  *         LVGL has already used it in lv_init.
67  */
lv_uefi_platform_init(void)68 void lv_uefi_platform_init(void)
69 {
70     LV_ASSERT_NULL(gLvEfiImageHandle);
71     LV_ASSERT_NULL(gLvEfiST);
72     LV_ASSERT_NULL(gLvEfiBS);
73     LV_ASSERT_NULL(gLvEfiRT);
74 }
75 
76 /**
77  * @brief Cleanup the LVGL UEFI backend.
78  * @remark This is a private API which is used for LVGL UEFI backend
79  *         implementation. LVGL users shouldn't use that because the
80  *         LVGL has already used it in lv_deinit.
81 */
lv_uefi_platform_deinit(void)82 void lv_uefi_platform_deinit(void)
83 {
84     ;
85 }
86 
87 /**********************
88  *   STATIC FUNCTIONS
89  **********************/
90 
91 #endif