@@ -32,6 +32,10 @@ bool __pure __efi_soft_reserve_enabled(void)
32
32
return !efi_nosoftreserve ;
33
33
}
34
34
35
+ /**
36
+ * efi_char16_puts() - Write a UCS-2 encoded string to the console
37
+ * @str: UCS-2 encoded string
38
+ */
35
39
void efi_char16_puts (efi_char16_t * str )
36
40
{
37
41
efi_call_proto (efi_table_attr (efi_system_table , con_out ),
@@ -83,6 +87,10 @@ u32 utf8_to_utf32(const u8 **s8)
83
87
return c32 ;
84
88
}
85
89
90
+ /**
91
+ * efi_puts() - Write a UTF-8 encoded string to the console
92
+ * @str: UTF-8 encoded string
93
+ */
86
94
void efi_puts (const char * str )
87
95
{
88
96
efi_char16_t buf [128 ];
@@ -113,6 +121,16 @@ void efi_puts(const char *str)
113
121
}
114
122
}
115
123
124
+ /**
125
+ * efi_printk() - Print a kernel message
126
+ * @fmt: format string
127
+ *
128
+ * The first letter of the format string is used to determine the logging level
129
+ * of the message. If the level is less then the current EFI logging level, the
130
+ * message is suppressed. The message will be truncated to 255 bytes.
131
+ *
132
+ * Return: number of printed characters
133
+ */
116
134
int efi_printk (const char * fmt , ...)
117
135
{
118
136
char printf_buf [256 ];
@@ -154,13 +172,18 @@ int efi_printk(const char *fmt, ...)
154
172
return printed ;
155
173
}
156
174
157
- /*
158
- * Parse the ASCII string 'cmdline' for EFI options, denoted by the efi=
175
+ /**
176
+ * efi_parse_options() - Parse EFI command line options
177
+ * @cmdline: kernel command line
178
+ *
179
+ * Parse the ASCII string @cmdline for EFI options, denoted by the efi=
159
180
* option, e.g. efi=nochunk.
160
181
*
161
182
* It should be noted that efi= is parsed in two very different
162
183
* environments, first in the early boot environment of the EFI boot
163
184
* stub, and subsequently during the kernel boot.
185
+ *
186
+ * Return: status code
164
187
*/
165
188
efi_status_t efi_parse_options (char const * cmdline )
166
189
{
@@ -286,13 +309,21 @@ char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len)
286
309
return (char * )cmdline_addr ;
287
310
}
288
311
289
- /*
312
+ /**
313
+ * efi_exit_boot_services() - Exit boot services
314
+ * @handle: handle of the exiting image
315
+ * @map: pointer to receive the memory map
316
+ * @priv: argument to be passed to @priv_func
317
+ * @priv_func: function to process the memory map before exiting boot services
318
+ *
290
319
* Handle calling ExitBootServices according to the requirements set out by the
291
320
* spec. Obtains the current memory map, and returns that info after calling
292
321
* ExitBootServices. The client must specify a function to perform any
293
322
* processing of the memory map data prior to ExitBootServices. A client
294
323
* specific structure may be passed to the function via priv. The client
295
324
* function may be called multiple times.
325
+ *
326
+ * Return: status code
296
327
*/
297
328
efi_status_t efi_exit_boot_services (void * handle ,
298
329
struct efi_boot_memmap * map ,
@@ -361,6 +392,11 @@ efi_status_t efi_exit_boot_services(void *handle,
361
392
return status ;
362
393
}
363
394
395
+ /**
396
+ * get_efi_config_table() - retrieve UEFI configuration table
397
+ * @guid: GUID of the configuration table to be retrieved
398
+ * Return: pointer to the configuration table or NULL
399
+ */
364
400
void * get_efi_config_table (efi_guid_t guid )
365
401
{
366
402
unsigned long tables = efi_table_attr (efi_system_table , tables );
@@ -408,17 +444,18 @@ static const struct {
408
444
};
409
445
410
446
/**
411
- * efi_load_initrd_dev_path - load the initrd from the Linux initrd device path
447
+ * efi_load_initrd_dev_path() - load the initrd from the Linux initrd device path
412
448
* @load_addr: pointer to store the address where the initrd was loaded
413
449
* @load_size: pointer to store the size of the loaded initrd
414
450
* @max: upper limit for the initrd memory allocation
415
- * @return: %EFI_SUCCESS if the initrd was loaded successfully, in which
416
- * case @load_addr and @load_size are assigned accordingly
417
- * %EFI_NOT_FOUND if no LoadFile2 protocol exists on the initrd
418
- * device path
419
- * %EFI_INVALID_PARAMETER if load_addr == NULL or load_size == NULL
420
- * %EFI_OUT_OF_RESOURCES if memory allocation failed
421
- * %EFI_LOAD_ERROR in all other cases
451
+ *
452
+ * Return:
453
+ * * %EFI_SUCCESS if the initrd was loaded successfully, in which
454
+ * case @load_addr and @load_size are assigned accordingly
455
+ * * %EFI_NOT_FOUND if no LoadFile2 protocol exists on the initrd device path
456
+ * * %EFI_INVALID_PARAMETER if load_addr == NULL or load_size == NULL
457
+ * * %EFI_OUT_OF_RESOURCES if memory allocation failed
458
+ * * %EFI_LOAD_ERROR in all other cases
422
459
*/
423
460
static
424
461
efi_status_t efi_load_initrd_dev_path (unsigned long * load_addr ,
@@ -481,6 +518,16 @@ efi_status_t efi_load_initrd_cmdline(efi_loaded_image_t *image,
481
518
load_addr , load_size );
482
519
}
483
520
521
+ /**
522
+ * efi_load_initrd() - Load initial RAM disk
523
+ * @image: EFI loaded image protocol
524
+ * @load_addr: pointer to loaded initrd
525
+ * @load_size: size of loaded initrd
526
+ * @soft_limit: preferred size of allocated memory for loading the initrd
527
+ * @hard_limit: minimum size of allocated memory
528
+ *
529
+ * Return: status code
530
+ */
484
531
efi_status_t efi_load_initrd (efi_loaded_image_t * image ,
485
532
unsigned long * load_addr ,
486
533
unsigned long * load_size ,
@@ -505,6 +552,15 @@ efi_status_t efi_load_initrd(efi_loaded_image_t *image,
505
552
return status ;
506
553
}
507
554
555
+ /**
556
+ * efi_wait_for_key() - Wait for key stroke
557
+ * @usec: number of microseconds to wait for key stroke
558
+ * @key: key entered
559
+ *
560
+ * Wait for up to @usec microseconds for a key stroke.
561
+ *
562
+ * Return: status code, EFI_SUCCESS if key received
563
+ */
508
564
efi_status_t efi_wait_for_key (unsigned long usec , efi_input_key_t * key )
509
565
{
510
566
efi_event_t events [2 ], timer ;
0 commit comments