---
name: "efidev"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/efidev"
---

# efidev(4)

user-mode access to UEFI runtime services

## NAME

**efidev**, **efirtc** – user-mode access to UEFI runtime services

## SYNOPSIS

To compile this driver into the kernel, place the following lines in your kernel configuration file:

**options EFIRT**

Alternatively, to load the driver as a module at boot time, place the following line in [loader.conf(5)](/loader.conf/5.md):

```
efirt_load="YES"
```

The driver may be disabled by setting the [loader(8)](/loader/8.md) tunable *efi.rt.disabled* to “1”.

## DESCRIPTION

The **efidev** device provides user-mode access to UEFI runtime services. **efidev** also includes a driver to provide a time-of-day clock using the UEFI real time clock (RTC). However, the RTC may not always be available, based on the UEFI firmware. If the RTC is not available, it will not be registered as a time-of-day clock and the time related ioctls below will not be functional.

**efidev** provides the following ioctls defined in ⟨sys/efiio.h⟩ with supplemental structures and constants defined in ⟨sys/efi.h⟩:

- EFIIOC\_GET\_TABLE (*struct efi\_get\_table\_ioc*)

  Copy the UEFI table specified by the *uuid* field of the *struct* *efi\_get\_table\_ioc* into the *buf* field. The memory size for the buf field can be queried by passing NULL pointer as a buf value. The required size will be stored in the *table\_len* field. The size of the allocated memory must be specified in the *buf\_len* field.

  ```
  struct efi_get_table_ioc {
  	void *buf;
  	struct uuid uuid;
  	size_t table_len;
  	size_t buf_len;
  };
  ```

- EFIIOC\_GET\_TIME (*struct efi\_tm*)

  Get the time from the RTC, if the RTC is available. The *struct* *efi\_tm* passed is populated with the current time, unless an error occurs.

  ```
  struct efi_tm {
  	uint16_t	tm_year;
  	uint8_t		tm_mon
  	uint8_t		tm_mday
  	uint8_t		tm_hour;
  	uint8_t		tm_min;
  	uint8_t		tm_sec;
  	uint8_t		 __pad1;
  	uint32_t	tm_nsec;
  	int16_t		tm_tz;
  	uint8_t		tm_dst;
  	uint8_t		__pad2;
  };
  ```

- EFIIOC\_SET\_TIME (*struct efi\_tm*)

  Sets the time stored by the RTC, if the RTC is available.

- EFIIOC\_VAR\_GET (*struct efi\_var\_ioc*)

  Gets data from the variable described by the vendor and name fields of the *struct* *efi\_var\_ioc* into the *data* field. EFIIOC\_VAR\_GET (*struct efi\_var\_ioc*) will also populate the *attrib* field.

  ```
  struct efi_var_ioc {
  	efi_char	*name;
  	size_t		 namesize;
  	struct uuid	 vendor;
  	uint32_t	 attrib;
  	void		*data;
  	size_t		 datasize;
  };
  ```

- EFIIOC\_VAR\_NEXT (*struct efi\_var\_ioc*)

  Used for enumerating all UEFI variables. The initial call should use an empty string for the name attribute. Subsequent calls should supply the vendor uuid and name of the last variable returned.

- EFIIOC\_VAR\_SET (*struct efi\_var\_ioc*)

  Sets data and attributes for the variable described by the name and vendor in the *struct* *efi\_var\_ioc*.

## FILES

- */dev/efi*

  ## SEE ALSO

[efivar(3)](/efivar/3.md), [efirt(9)](/efirt/9.md)

## HISTORY

A **efidev** device first appeared in FreeBSD 11.1.

## BUGS

**efidev** is currently only available on amd64 and arm64.
