1 /* SPDX-License-Identifier: BSD-2-Clause */
12 * @retval SUCCESS STM is loaded to MSEG
13 * @retval BUFFER_TOO_SMALL MSEG is too small
14 * @retval UNSUPPORTED MSEG is not enabled
16 int load_stm_image(uintptr_t mseg
);
19 uintptr_t mseg
, int cpu
, uintptr_t smbase
,
20 uintptr_t smbase_base
, uint32_t offset32
);
23 * Add resources in list to database. Allocate new memory areas as needed.
25 * @param resource_list A pointer to resource list to be added
26 * @param num_entries Optional number of entries.
27 * If 0, list must be terminated by END_OF_RESOURCES.
29 * @retval SUCCESS If resources are added
30 * @retval INVALID_PARAMETER If nested procedure detected resource failure
31 * @retval OUT_OF_RESOURCES If nested procedure returned it and we cannot
32 * allocate more areas.
34 int add_pi_resource(STM_RSC
*resource_list
, uint32_t num_entries
);
37 * Delete resources in list to database.
39 * @param resource_list A pointer to resource list to be deleted
40 * NULL means delete all resources.
41 * @param num_entries Optional number of entries.
42 * If 0, list must be terminated by END_OF_RESOURCES.
44 * @retval SUCCESS If resources are deleted
45 * @retval NVALID_PARAMETER If nested procedure detected resource fail
47 int delete_pi_resource(STM_RSC
*resource_list
, uint32_t num_entries
);
52 * @param resource_list A pointer to resource list to be filled
53 * @param resource_size On input it means size of resource list input.
54 * On output it means size of resource list filled,
55 * or the size of resource list to be filled if
58 * @retval SUCCESS If resources are returned.
59 * @retval BUFFER_TOO_SMALL If resource list buffer is too small to
60 * hold the whole resources.
62 int get_pi_resource(STM_RSC
*resource_list
, uint32_t *resource_size
);
65 * This function notifies the STM of a resource change.
67 * @param stm_resource BIOS STM resource
69 void notify_stm_resource_change(void *stm_resource
);
72 * This function returns the pointer to the STM BIOS resource list.
74 * @return BIOS STM resource
76 void *get_stm_resource(void);
78 void setup_smm_descriptor(void *smbase
, int32_t apic_id
,
82 * Check STM image size.
84 * @param stm_image STM image
85 * @param stm_image_size STM image size
87 * @retval true check pass
88 * @retval false check fail
90 bool stm_check_stm_image(void *stm_image
, uint32_t stm_image_size
);
93 * Create 4G page table for STM.
94 * 4M Non-PAE page table in IA32 version.
96 * @param page_table_base The page table base in MSEG
98 void stm_gen_4g_pagetable_ia32(uint32_t pagetable_base
);
101 * Create 4G page table for STM.
102 * 2M PAE page table in X64 version.
104 * @param pagetable_base The page table base in MSEG
106 void stm_gen_4g_pagetable_x64(uint32_t pagetable_base
);