4040
4141#define efi_data (op ) (op.u.efi_runtime_call)
4242
43- efi_status_t xen_efi_get_time (efi_time_t * tm , efi_time_cap_t * tc )
43+ static efi_status_t xen_efi_get_time (efi_time_t * tm , efi_time_cap_t * tc )
4444{
4545 struct xen_platform_op op = INIT_EFI_OP (get_time );
4646
@@ -61,9 +61,8 @@ efi_status_t xen_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
6161
6262 return efi_data (op ).status ;
6363}
64- EXPORT_SYMBOL_GPL (xen_efi_get_time );
6564
66- efi_status_t xen_efi_set_time (efi_time_t * tm )
65+ static efi_status_t xen_efi_set_time (efi_time_t * tm )
6766{
6867 struct xen_platform_op op = INIT_EFI_OP (set_time );
6968
@@ -75,10 +74,10 @@ efi_status_t xen_efi_set_time(efi_time_t *tm)
7574
7675 return efi_data (op ).status ;
7776}
78- EXPORT_SYMBOL_GPL (xen_efi_set_time );
7977
80- efi_status_t xen_efi_get_wakeup_time (efi_bool_t * enabled , efi_bool_t * pending ,
81- efi_time_t * tm )
78+ static efi_status_t xen_efi_get_wakeup_time (efi_bool_t * enabled ,
79+ efi_bool_t * pending ,
80+ efi_time_t * tm )
8281{
8382 struct xen_platform_op op = INIT_EFI_OP (get_wakeup_time );
8483
@@ -98,9 +97,8 @@ efi_status_t xen_efi_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
9897
9998 return efi_data (op ).status ;
10099}
101- EXPORT_SYMBOL_GPL (xen_efi_get_wakeup_time );
102100
103- efi_status_t xen_efi_set_wakeup_time (efi_bool_t enabled , efi_time_t * tm )
101+ static efi_status_t xen_efi_set_wakeup_time (efi_bool_t enabled , efi_time_t * tm )
104102{
105103 struct xen_platform_op op = INIT_EFI_OP (set_wakeup_time );
106104
@@ -117,11 +115,10 @@ efi_status_t xen_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
117115
118116 return efi_data (op ).status ;
119117}
120- EXPORT_SYMBOL_GPL (xen_efi_set_wakeup_time );
121118
122- efi_status_t xen_efi_get_variable (efi_char16_t * name , efi_guid_t * vendor ,
123- u32 * attr , unsigned long * data_size ,
124- void * data )
119+ static efi_status_t xen_efi_get_variable (efi_char16_t * name , efi_guid_t * vendor ,
120+ u32 * attr , unsigned long * data_size ,
121+ void * data )
125122{
126123 struct xen_platform_op op = INIT_EFI_OP (get_variable );
127124
@@ -141,11 +138,10 @@ efi_status_t xen_efi_get_variable(efi_char16_t *name, efi_guid_t *vendor,
141138
142139 return efi_data (op ).status ;
143140}
144- EXPORT_SYMBOL_GPL (xen_efi_get_variable );
145141
146- efi_status_t xen_efi_get_next_variable (unsigned long * name_size ,
147- efi_char16_t * name ,
148- efi_guid_t * vendor )
142+ static efi_status_t xen_efi_get_next_variable (unsigned long * name_size ,
143+ efi_char16_t * name ,
144+ efi_guid_t * vendor )
149145{
150146 struct xen_platform_op op = INIT_EFI_OP (get_next_variable_name );
151147
@@ -165,11 +161,10 @@ efi_status_t xen_efi_get_next_variable(unsigned long *name_size,
165161
166162 return efi_data (op ).status ;
167163}
168- EXPORT_SYMBOL_GPL (xen_efi_get_next_variable );
169164
170- efi_status_t xen_efi_set_variable (efi_char16_t * name , efi_guid_t * vendor ,
171- u32 attr , unsigned long data_size ,
172- void * data )
165+ static efi_status_t xen_efi_set_variable (efi_char16_t * name , efi_guid_t * vendor ,
166+ u32 attr , unsigned long data_size ,
167+ void * data )
173168{
174169 struct xen_platform_op op = INIT_EFI_OP (set_variable );
175170
@@ -186,11 +181,10 @@ efi_status_t xen_efi_set_variable(efi_char16_t *name, efi_guid_t *vendor,
186181
187182 return efi_data (op ).status ;
188183}
189- EXPORT_SYMBOL_GPL (xen_efi_set_variable );
190184
191- efi_status_t xen_efi_query_variable_info (u32 attr , u64 * storage_space ,
192- u64 * remaining_space ,
193- u64 * max_variable_size )
185+ static efi_status_t xen_efi_query_variable_info (u32 attr , u64 * storage_space ,
186+ u64 * remaining_space ,
187+ u64 * max_variable_size )
194188{
195189 struct xen_platform_op op = INIT_EFI_OP (query_variable_info );
196190
@@ -208,9 +202,8 @@ efi_status_t xen_efi_query_variable_info(u32 attr, u64 *storage_space,
208202
209203 return efi_data (op ).status ;
210204}
211- EXPORT_SYMBOL_GPL (xen_efi_query_variable_info );
212205
213- efi_status_t xen_efi_get_next_high_mono_count (u32 * count )
206+ static efi_status_t xen_efi_get_next_high_mono_count (u32 * count )
214207{
215208 struct xen_platform_op op = INIT_EFI_OP (get_next_high_monotonic_count );
216209
@@ -221,10 +214,9 @@ efi_status_t xen_efi_get_next_high_mono_count(u32 *count)
221214
222215 return efi_data (op ).status ;
223216}
224- EXPORT_SYMBOL_GPL (xen_efi_get_next_high_mono_count );
225217
226- efi_status_t xen_efi_update_capsule (efi_capsule_header_t * * capsules ,
227- unsigned long count , unsigned long sg_list )
218+ static efi_status_t xen_efi_update_capsule (efi_capsule_header_t * * capsules ,
219+ unsigned long count , unsigned long sg_list )
228220{
229221 struct xen_platform_op op = INIT_EFI_OP (update_capsule );
230222
@@ -241,11 +233,9 @@ efi_status_t xen_efi_update_capsule(efi_capsule_header_t **capsules,
241233
242234 return efi_data (op ).status ;
243235}
244- EXPORT_SYMBOL_GPL (xen_efi_update_capsule );
245236
246- efi_status_t xen_efi_query_capsule_caps (efi_capsule_header_t * * capsules ,
247- unsigned long count , u64 * max_size ,
248- int * reset_type )
237+ static efi_status_t xen_efi_query_capsule_caps (efi_capsule_header_t * * capsules ,
238+ unsigned long count , u64 * max_size , int * reset_type )
249239{
250240 struct xen_platform_op op = INIT_EFI_OP (query_capsule_capabilities );
251241
@@ -264,10 +254,9 @@ efi_status_t xen_efi_query_capsule_caps(efi_capsule_header_t **capsules,
264254
265255 return efi_data (op ).status ;
266256}
267- EXPORT_SYMBOL_GPL (xen_efi_query_capsule_caps );
268257
269- void xen_efi_reset_system (int reset_type , efi_status_t status ,
270- unsigned long data_size , efi_char16_t * data )
258+ static void xen_efi_reset_system (int reset_type , efi_status_t status ,
259+ unsigned long data_size , efi_char16_t * data )
271260{
272261 switch (reset_type ) {
273262 case EFI_RESET_COLD :
@@ -281,4 +270,25 @@ void xen_efi_reset_system(int reset_type, efi_status_t status,
281270 BUG ();
282271 }
283272}
284- EXPORT_SYMBOL_GPL (xen_efi_reset_system );
273+
274+ /*
275+ * Set XEN EFI runtime services function pointers. Other fields of struct efi,
276+ * e.g. efi.systab, will be set like normal EFI.
277+ */
278+ void __init xen_efi_runtime_setup (void )
279+ {
280+ efi .get_time = xen_efi_get_time ;
281+ efi .set_time = xen_efi_set_time ;
282+ efi .get_wakeup_time = xen_efi_get_wakeup_time ;
283+ efi .set_wakeup_time = xen_efi_set_wakeup_time ;
284+ efi .get_variable = xen_efi_get_variable ;
285+ efi .get_next_variable = xen_efi_get_next_variable ;
286+ efi .set_variable = xen_efi_set_variable ;
287+ efi .set_variable_nonblocking = xen_efi_set_variable ;
288+ efi .query_variable_info = xen_efi_query_variable_info ;
289+ efi .query_variable_info_nonblocking = xen_efi_query_variable_info ;
290+ efi .update_capsule = xen_efi_update_capsule ;
291+ efi .query_capsule_caps = xen_efi_query_capsule_caps ;
292+ efi .get_next_high_mono_count = xen_efi_get_next_high_mono_count ;
293+ efi .reset_system = xen_efi_reset_system ;
294+ }
0 commit comments