4.23.DebugFS interface
The optional DebugFS interface is accessed through a Vendor specific EL3 service. Referto the component documentation for details.
String parameters are passed through a shared buffer using a specific union:
uniondebugfs_parms{struct{charfname[MAX_PATH_LEN];}open;structmount{charsrv[MAX_PATH_LEN];charwhere[MAX_PATH_LEN];charspec[MAX_PATH_LEN];}mount;struct{charpath[MAX_PATH_LEN];dir_tdir;}stat;struct{charoldpath[MAX_PATH_LEN];charnewpath[MAX_PATH_LEN];}bind;};
Format of the dir_t structure as such:
typedefstruct{charname[NAMELEN];longlength;unsignedcharmode;unsignedcharindex;unsignedchardev;qid_tqid;}dir_t;
Identifiers
SMC_OK | 0 |
SMC_UNK | -1 |
DEBUGFS_E_INVALID_PARAMS | -2 |
MOUNT | 0 |
CREATE | 1 |
OPEN | 2 |
CLOSE | 3 |
READ | 4 |
WRITE | 5 |
SEEK | 6 |
BIND | 7 |
STAT | 8 |
INIT | 10 |
VERSION | 11 |
4.23.1.MOUNT
4.23.1.1.Description
This operation mounts a blob of data pointed to by path stored insrc, atfilesystem location pointed to by path stored inwhere, using driver pointedto by path inspec.
4.23.1.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
4.23.1.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if mount operation failed |
4.23.2.OPEN
4.23.2.1.Description
This operation opens the file path pointed to byfname.
4.23.2.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
uint32_t | mode |
mode can be one of:
enummode{O_READ=1<<0,O_WRITE=1<<1,O_RDWR=1<<2,O_BIND=1<<3,O_DIR=1<<4,O_STAT=1<<5};
4.23.2.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if open operation failed |
uint32_t | w1: file descriptor id on success. |
4.23.3.CLOSE
4.23.3.1.Description
This operation closes a file described by a file descriptor obtained by aprevious call to OPEN.
4.23.3.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
uint32_t | File descriptor id returned by OPEN |
4.23.3.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if close operation failed |
4.23.4.READ
4.23.4.1.Description
This operation reads a number of bytes from a file descriptor obtained bya previous call to OPEN.
4.23.4.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
uint32_t | File descriptor id returned by OPEN |
uint32_t | Number of bytes to read |
4.23.4.3.Return values
On success, the read data is retrieved from the shared buffer after theoperation.
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if read operation failed |
uint32_t | w1: number of bytes read on success. |
4.23.5.SEEK
4.23.5.1.Description
Move file pointer for file described by givenfile descriptor of givenoffset related towhence.
4.23.5.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
uint32_t | File descriptor id returned by OPEN |
sint32_t | offset in the file relative to whence |
uint32_t | whence |
whence can be one of:
KSEEK_SET | 0 |
KSEEK_CUR | 1 |
KSEEK_END | 2 |
4.23.5.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if seek operation failed |
4.23.6.BIND
4.23.6.1.Description
Create a link fromoldpath tonewpath.
4.23.6.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
4.23.6.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if bind operation failed |
4.23.7.STAT
4.23.7.1.Description
Perform a stat operation on provided filename and returns the directoryentry statistics intodir.
4.23.7.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
4.23.7.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if stat operation failed |
4.23.8.INIT
4.23.8.1.Description
Initial call to setup the shared exchange buffer. Notice if successful once,subsequent calls fail after a first initialization. The caller maps the samepage frame in its virtual space and uses this buffer to exchange stringparameters with filesystem primitives.
4.23.8.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
uint64_t | Physical address of the shared buffer. |
4.23.8.3.Return values
int32_t | w0 == SMC_OK on success w0 == DEBUGFS_E_INVALID_PARAMS if already initialized,or internal error occurred. |
4.23.9.VERSION
4.23.9.1.Description
Returns the debugfs interface version if implemented in TF-A.
4.23.9.2.Parameters
uint32_t | FunctionID (0x87000010 / 0xC7000010) |
uint32_t |
|
4.23.9.3.Return values
int32_t | w0 == SMC_OK on success w0 == SMC_UNK if interface is not implemented |
uint32_t | w1: On success, debugfs interface version, 32 bitsvalue with major version number in upper 16 bits andminor version in lower 16 bits. |
CREATE(1) and WRITE (5) command identifiers are unimplemented andreturnSMC_UNK.
Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.