|
iPXE
|
EFI local file access. More...
#include <string.h>#include <strings.h>#include <stdio.h>#include <errno.h>#include <assert.h>#include <ipxe/refcnt.h>#include <ipxe/malloc.h>#include <ipxe/xfer.h>#include <ipxe/open.h>#include <ipxe/uri.h>#include <ipxe/iobuf.h>#include <ipxe/process.h>#include <ipxe/errortab.h>#include <ipxe/efi/efi.h>#include <ipxe/efi/efi_strings.h>#include <ipxe/efi/efi_path.h>#include <ipxe/efi/Protocol/SimpleFileSystem.h>#include <ipxe/efi/Guid/FileInfo.h>#include <ipxe/efi/Guid/FileSystemInfo.h>Go to the source code of this file.
Data Structures | |
| struct | efi_local |
| An EFI local file. More... | |
Macros | |
| #define | EINFO_EEFI_OPEN __einfo_uniqify ( EINFO_EPLATFORM, 0x01, "Could not open" ) |
| #define | EINFO_EEFI_OPEN_NOT_FOUND |
| #define | EEFI_OPEN_NOT_FOUND __einfo_error ( EINFO_EEFI_OPEN_NOT_FOUND ) |
| #define | EEFI_OPEN(efirc) |
| #define | EFI_LOCAL_BLKSIZE 4096 |
| Download blocksize. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static void | efi_local_free (struct refcnt *refcnt) |
| Free local file. More... | |
| static void | efi_local_close (struct efi_local *local, int rc) |
| Close local file. More... | |
| static int | efi_local_check_volume_name (struct efi_local *local, EFI_HANDLE device, EFI_FILE_PROTOCOL *root, const char *volume) |
| Check for matching volume name. More... | |
| static int | efi_local_open_root (struct efi_local *local, EFI_HANDLE device, EFI_FILE_PROTOCOL **root) |
| Open root filesystem. More... | |
| static int | efi_local_open_volume (struct efi_local *local) |
| Open root filesystem of specified volume. More... | |
| static int | efi_local_open_resolved (struct efi_local *local, const char *resolved) |
| Open fully-resolved path. More... | |
| static int | efi_local_open_path (struct efi_local *local) |
| Open specified path. More... | |
| static int | efi_local_len (struct efi_local *local) |
| Get file length. More... | |
| static void | efi_local_step (struct efi_local *local) |
| Local file process. More... | |
| static int | efi_local_open (struct interface *xfer, struct uri *uri) |
| Open local file. More... | |
Variables | |
| struct errortab efi_local_errors [] | __errortab |
| Human-readable error messages. More... | |
| static struct interface_operation | efi_local_operations [] |
| Data transfer interface operations. More... | |
| static struct interface_descriptor | efi_local_xfer_desc |
| Data transfer interface descriptor. More... | |
| static struct process_descriptor | efi_local_process_desc |
| Process descriptor. More... | |
| struct uri_opener efi_local_uri_opener | __uri_opener |
| EFI local file URI opener. More... | |
EFI local file access.
Definition in file efi_local.c.
| #define EINFO_EEFI_OPEN __einfo_uniqify ( EINFO_EPLATFORM, 0x01, "Could not open" ) |
Definition at line 53 of file efi_local.c.
| #define EINFO_EEFI_OPEN_NOT_FOUND |
Definition at line 55 of file efi_local.c.
| #define EEFI_OPEN_NOT_FOUND __einfo_error ( EINFO_EEFI_OPEN_NOT_FOUND ) |
Definition at line 58 of file efi_local.c.
| #define EEFI_OPEN | ( | efirc | ) |
Definition at line 60 of file efi_local.c.
| #define EFI_LOCAL_BLKSIZE 4096 |
Download blocksize.
Definition at line 64 of file efi_local.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Free local file.
| refcnt | Reference count |
Definition at line 100 of file efi_local.c.
References container_of, free, efi_local::uri, and uri_put().
Referenced by efi_local_open().
|
static |
Close local file.
| local | Local file |
| rc | Reason for close |
Definition at line 114 of file efi_local.c.
References _EFI_FILE_PROTOCOL::Close, efi_local::file, intf_shutdown(), NULL, efi_local::process, process_del(), rc, efi_local::root, and efi_local::xfer.
Referenced by efi_local_step().
|
static |
Check for matching volume name.
| local | Local file |
| device | Device handle |
| root | Root filesystem handle |
| volume | Volume name |
| rc | Return status code |
Definition at line 144 of file efi_local.c.
References asprintf(), DBGC, DBGC2, EEFI, efi_file_system_info_id, efi_handle_name(), ENOENT, ENOMEM, free, info, malloc(), NULL, rc, root, size, strcasecmp(), strerror(), and efi_local::volume.
Referenced by efi_local_open_volume().
|
static |
Open root filesystem.
| local | Local file |
| device | Device handle |
| root | Root filesystem handle to fill in |
| rc | Return status code |
Definition at line 209 of file efi_local.c.
References DBGC, EEFI, efi_handle_name(), efi_open, efi_simple_file_system_protocol_guid, fs, rc, root, and strerror().
Referenced by efi_local_open_volume().
|
static |
Open root filesystem of specified volume.
| local | Local file |
| rc | Return status code |
Definition at line 240 of file efi_local.c.
References EFI_SYSTEM_TABLE::BootServices, ByProtocol, DBGC, device, EEFI, efi_devpath_text(), efi_handle_name(), efi_loaded_image_path, efi_local_check_volume_name(), efi_local_open_root(), efi_simple_file_system_protocol_guid, efi_systab, ENOENT, EFI_BOOT_SERVICES::FreePool, EFI_BOOT_SERVICES::LocateDevicePath, EFI_BOOT_SERVICES::LocateHandleBuffer, NULL, efi_local::path, protocol, rc, root, efi_local::root, strerror(), and efi_local::volume.
Referenced by efi_local_step().
|
static |
Open fully-resolved path.
| local | Local file |
| resolved | Resolved path |
| rc | Return status code |
Definition at line 330 of file efi_local.c.
References DBGC, EEFI_OPEN, EFI_FILE_MODE_READ, efi_snprintf(), efi_local::file, name, _EFI_FILE_PROTOCOL::Open, rc, efi_local::root, strerror(), and strlen().
Referenced by efi_local_open_path().
|
static |
Open specified path.
| local | Local file |
| rc | Return status code |
Definition at line 360 of file efi_local.c.
References assert(), base, container_of, DBGC, DBGC2, efi_loaded_image, efi_local_open_resolved(), efi_path_len(), efi_path_next(), ENOMEM, EFI_LOADED_IMAGE_PROTOCOL::FilePath, free, Header, len, memset(), next, efi_local::path, FILEPATH_DEVICE_PATH::PathName, rc, resolve_path(), snprintf(), and tmp.
Referenced by efi_local_step().
|
static |
Get file length.
| local | Local file |
| rc | Return status code |
Definition at line 421 of file efi_local.c.
References DBGC, EEFI, efi_file_info_id, ENOMEM, efi_local::file, free, _EFI_FILE_PROTOCOL::GetInfo, info, efi_local::len, malloc(), NULL, rc, size, and strerror().
Referenced by efi_local_step().
|
static |
Local file process.
| local | Local file |
Definition at line 465 of file efi_local.c.
References assert(), io_buffer::data, DBGC, EEFI, EFI_LOCAL_BLKSIZE, efi_local_close(), efi_local_len(), efi_local_open_path(), efi_local_open_volume(), ENOMEM, efi_local::file, free_iob(), iob_disown, iob_put, efi_local::len, NULL, rc, _EFI_FILE_PROTOCOL::Read, efi_local::root, size, strerror(), efi_local::xfer, xfer_alloc_iob(), xfer_deliver_iob(), xfer_seek(), and xfer_window().
Open local file.
| xfer | Data transfer interface |
| uri | Request URI |
| rc | Return status code |
Definition at line 567 of file efi_local.c.
References efi_local_free(), efi_local_process_desc, efi_local_xfer_desc, ENOMEM, uri::host, intf_init(), intf_plug_plug(), NULL, uri::opaque, efi_local::path, uri::path, efi_local::process, process_add(), process_init_stopped(), ref_init, ref_put, efi_local::refcnt, efi_local::uri, uri_get(), efi_local::volume, efi_local::xfer, and zalloc().
| struct errortab efi_local_errors [] __errortab |
|
static |
Data transfer interface operations.
Definition at line 547 of file efi_local.c.
|
static |
Data transfer interface descriptor.
Definition at line 553 of file efi_local.c.
Referenced by efi_local_open().
|
static |
Process descriptor.
Definition at line 557 of file efi_local.c.
Referenced by efi_local_open().
| struct uri_opener efi_local_uri_opener __uri_opener |
EFI local file URI opener.
Definition at line 592 of file efi_local.c.
1.8.15