File: ven-el3-debugfs.rst

package info (click to toggle)
arm-trusted-firmware 2.12.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 43,768 kB
  • sloc: ansic: 451,243; asm: 28,729; python: 2,703; makefile: 2,048; javascript: 139; sh: 33
file content (343 lines) | stat: -rw-r--r-- 8,978 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
DebugFS interface
=================

The optional DebugFS interface is accessed through a Vendor specific EL3 service. Refer
to the component documentation for details.

String parameters are passed through a shared buffer using a specific union:

.. code:: c

    union debugfs_parms {
        struct {
            char fname[MAX_PATH_LEN];
        } open;

        struct mount {
            char srv[MAX_PATH_LEN];
            char where[MAX_PATH_LEN];
            char spec[MAX_PATH_LEN];
        } mount;

        struct {
            char path[MAX_PATH_LEN];
            dir_t dir;
        } stat;

        struct {
            char oldpath[MAX_PATH_LEN];
            char newpath[MAX_PATH_LEN];
        } bind;
    };

Format of the dir_t structure as such:

.. code:: c

    typedef struct {
        char		name[NAMELEN];
        long		length;
        unsigned char	mode;
        unsigned char	index;
        unsigned char	dev;
        qid_t		qid;
    } 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
======================== =============================================

MOUNT
~~~~~

Description
^^^^^^^^^^^
This operation mounts a blob of data pointed to by path stored in `src`, at
filesystem location pointed to by path stored in `where`, using driver pointed
to by path in `spec`.

Parameters
^^^^^^^^^^
======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``MOUNT``
======== ============================================================

Return values
^^^^^^^^^^^^^

=============== ==========================================================
int32_t         w0 == SMC_OK on success

                w0 == DEBUGFS_E_INVALID_PARAMS if mount operation failed
=============== ==========================================================

OPEN
~~~~

Description
^^^^^^^^^^^
This operation opens the file path pointed to by `fname`.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``OPEN``
uint32_t mode
======== ============================================================

mode can be one of:

.. code:: c

    enum mode {
        O_READ   = 1 << 0,
        O_WRITE  = 1 << 1,
        O_RDWR   = 1 << 2,
        O_BIND   = 1 << 3,
        O_DIR    = 1 << 4,
        O_STAT   = 1 << 5
    };

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.
=============== ==========================================================

CLOSE
~~~~~

Description
^^^^^^^^^^^

This operation closes a file described by a file descriptor obtained by a
previous call to OPEN.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``CLOSE``
uint32_t File descriptor id returned by OPEN
======== ============================================================

Return values
^^^^^^^^^^^^^
=============== ==========================================================
int32_t         w0 == SMC_OK on success

                w0 == DEBUGFS_E_INVALID_PARAMS if close operation failed
=============== ==========================================================

READ
~~~~

Description
^^^^^^^^^^^

This operation reads a number of bytes from a file descriptor obtained by
a previous call to OPEN.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``READ``
uint32_t File descriptor id returned by OPEN
uint32_t Number of bytes to read
======== ============================================================

Return values
^^^^^^^^^^^^^

On success, the read data is retrieved from the shared buffer after the
operation.

=============== ==========================================================
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.
=============== ==========================================================

SEEK
~~~~

Description
^^^^^^^^^^^

Move file pointer for file described by given `file descriptor` of given
`offset` related to `whence`.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``SEEK``
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
========= ============================================================

Return values
^^^^^^^^^^^^^

=============== ==========================================================
int32_t         w0 == SMC_OK on success

                w0 == DEBUGFS_E_INVALID_PARAMS if seek operation failed
=============== ==========================================================

BIND
~~~~

Description
^^^^^^^^^^^

Create a link from `oldpath` to `newpath`.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``BIND``
======== ============================================================

Return values
^^^^^^^^^^^^^

=============== ==========================================================
int32_t         w0 == SMC_OK on success

                w0 == DEBUGFS_E_INVALID_PARAMS if bind operation failed
=============== ==========================================================

STAT
~~~~

Description
^^^^^^^^^^^

Perform a stat operation on provided file `name` and returns the directory
entry statistics into `dir`.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``STAT``
======== ============================================================

Return values
^^^^^^^^^^^^^

=============== ==========================================================
int32_t         w0 == SMC_OK on success

                w0 == DEBUGFS_E_INVALID_PARAMS if stat operation failed
=============== ==========================================================

INIT
~~~~

Description
^^^^^^^^^^^
Initial call to setup the shared exchange buffer. Notice if successful once,
subsequent calls fail after a first initialization. The caller maps the same
page frame in its virtual space and uses this buffer to exchange string
parameters with filesystem primitives.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``INIT``
uint64_t Physical address of the shared buffer.
======== ============================================================

Return values
^^^^^^^^^^^^^

=============== ======================================================
int32_t         w0 == SMC_OK on success

                w0 == DEBUGFS_E_INVALID_PARAMS if already initialized,
                or internal error occurred.
=============== ======================================================

VERSION
~~~~~~~

Description
^^^^^^^^^^^
Returns the debugfs interface version if implemented in TF-A.

Parameters
^^^^^^^^^^

======== ============================================================
uint32_t FunctionID (0x87000010 / 0xC7000010)
uint32_t ``VERSION``
======== ============================================================

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 bits
                value with major version number in upper 16 bits and
                minor version in lower 16 bits.
=============== ======================================================

* CREATE(1) and WRITE (5) command identifiers are unimplemented and
  return `SMC_UNK`.

--------------

*Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.*