drivers/firmware/efi/runtime-wrappers.c
Source file repositories/reference/linux-study-clean/drivers/firmware/efi/runtime-wrappers.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/efi/runtime-wrappers.c- Extension
.c- Size
- 17086 bytes
- Lines
- 605
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bug.hlinux/efi.hlinux/irqflags.hlinux/mutex.hlinux/semaphore.hlinux/stringify.hlinux/workqueue.hlinux/completion.hasm/efi.h
Detected Declarations
function efi_runtime_servicesfunction efi_call_virt_check_flagsfunction efi_runtime_servicefunction __efi_queue_workfunction virt_efi_get_timefunction virt_efi_set_timefunction virt_efi_get_wakeup_timefunction virt_efi_set_wakeup_timefunction virt_efi_get_variablefunction virt_efi_get_next_variablefunction virt_efi_set_variablefunction virt_efi_set_variable_nbfunction virt_efi_query_variable_infofunction virt_efi_query_variable_info_nbfunction virt_efi_get_next_high_mono_countfunction virt_efi_reset_systemfunction virt_efi_update_capsulefunction virt_efi_query_capsule_capsfunction efi_native_runtime_setupfunction efi_call_acpi_prm_handlerfunction efi_runtime_assert_lock_held
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* runtime-wrappers.c - Runtime Services function call wrappers
*
* Implementation summary:
* -----------------------
* 1. When user/kernel thread requests to execute efi_runtime_service(),
* enqueue work to efi_rts_wq.
* 2. Caller thread waits for completion until the work is finished
* because it's dependent on the return status and execution of
* efi_runtime_service().
* For instance, get_variable() and get_next_variable().
*
* Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
*
* Split off from arch/x86/platform/efi/efi.c
*
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 1999-2002 Hewlett-Packard Co.
* Copyright (C) 2005-2008 Intel Co.
* Copyright (C) 2013 SuSE Labs
*/
#define pr_fmt(fmt) "efi: " fmt
#include <linux/bug.h>
#include <linux/efi.h>
#include <linux/irqflags.h>
#include <linux/mutex.h>
#include <linux/semaphore.h>
#include <linux/stringify.h>
#include <linux/workqueue.h>
#include <linux/completion.h>
#include <asm/efi.h>
/*
* Wrap around the new efi_call_virt_generic() macros so that the
* code doesn't get too cluttered:
*/
#define efi_call_virt(f, args...) \
arch_efi_call_virt(efi.runtime, f, args)
union efi_rts_args {
struct {
efi_time_t *time;
efi_time_cap_t *capabilities;
} GET_TIME;
struct {
efi_time_t *time;
} SET_TIME;
struct {
efi_bool_t *enabled;
efi_bool_t *pending;
efi_time_t *time;
} GET_WAKEUP_TIME;
struct {
efi_bool_t enable;
efi_time_t *time;
} SET_WAKEUP_TIME;
struct {
efi_char16_t *name;
efi_guid_t *vendor;
u32 *attr;
unsigned long *data_size;
void *data;
} GET_VARIABLE;
struct {
unsigned long *name_size;
efi_char16_t *name;
efi_guid_t *vendor;
} GET_NEXT_VARIABLE;
struct {
efi_char16_t *name;
efi_guid_t *vendor;
u32 attr;
unsigned long data_size;
void *data;
} SET_VARIABLE;
struct {
u32 attr;
u64 *storage_space;
Annotation
- Immediate include surface: `linux/bug.h`, `linux/efi.h`, `linux/irqflags.h`, `linux/mutex.h`, `linux/semaphore.h`, `linux/stringify.h`, `linux/workqueue.h`, `linux/completion.h`.
- Detected declarations: `function efi_runtime_services`, `function efi_call_virt_check_flags`, `function efi_runtime_service`, `function __efi_queue_work`, `function virt_efi_get_time`, `function virt_efi_set_time`, `function virt_efi_get_wakeup_time`, `function virt_efi_set_wakeup_time`, `function virt_efi_get_variable`, `function virt_efi_get_next_variable`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.