mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 10:04:26 +00:00

Move debugfs to Vendor-Specific EL3 Monitor Service Calls. Function Identifier for Vendor-Specific EL3 Monitor Service is '7' and allocated subranges of Function identifiers to different services are: 0x87000000-0x8700FFFF-SMC32: Vendor-Specific EL3 Monitor Service Calls 0xC7000000-0xC700FFFF-SMC64: Vendor-Specific EL3 Monitor Service Calls Amend Debugfs FID's to use this range and id. Add a deprecation notice to inform debugfs moved from arm-sip range to Vendor-Specific EL3 range. Debugfs support from arm-sip range will be removed and will not be available after TF-A 2.12 release. Reference to debugfs component level documentation: https://trustedfirmware-a.readthedocs.io/en/latest/components/debugfs-design.html#overview Change-Id: I97a50170178f361f70c95ed0049bc4e278de59d7 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
95 lines
2.7 KiB
C
95 lines
2.7 KiB
C
/*
|
|
* Copyright (c) 2019-2024, Arm Limited. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef DEBUGFS_H
|
|
#define DEBUGFS_H
|
|
|
|
#define NAMELEN 13 /* Maximum length of a file name */
|
|
#define PATHLEN 41 /* Maximum length of a path */
|
|
#define STATLEN 41 /* Size of static part of dir format */
|
|
#define ROOTLEN (2 + 4) /* Size needed to encode root string */
|
|
#define FILNAMLEN (2 + NAMELEN) /* Size needed to encode filename */
|
|
#define DIRLEN (STATLEN + FILNAMLEN + 3*ROOTLEN) /* Size of dir entry */
|
|
|
|
#define KSEEK_SET 0
|
|
#define KSEEK_CUR 1
|
|
#define KSEEK_END 2
|
|
|
|
#define NELEM(tab) (sizeof(tab) / sizeof((tab)[0]))
|
|
|
|
typedef unsigned short qid_t; /* FIXME: short type not recommended? */
|
|
|
|
/*******************************************************************************
|
|
* This structure contains the necessary information to represent a 9p
|
|
* directory.
|
|
******************************************************************************/
|
|
typedef struct {
|
|
char name[NAMELEN];
|
|
long length;
|
|
unsigned char mode;
|
|
unsigned char index;
|
|
unsigned char dev;
|
|
qid_t qid;
|
|
} dir_t;
|
|
|
|
/* Permission definitions used as flags */
|
|
#define O_READ (1 << 0)
|
|
#define O_WRITE (1 << 1)
|
|
#define O_RDWR (1 << 2)
|
|
#define O_BIND (1 << 3)
|
|
#define O_DIR (1 << 4)
|
|
#define O_STAT (1 << 5)
|
|
|
|
/* 9p interface */
|
|
int mount(const char *srv, const char *mnt, const char *spec);
|
|
int create(const char *name, int flags);
|
|
int open(const char *name, int flags);
|
|
int close(int fd);
|
|
int read(int fd, void *buf, int n);
|
|
int write(int fd, void *buf, int n);
|
|
int seek(int fd, long off, int whence);
|
|
int bind(const char *path, const char *where);
|
|
int stat(const char *path, dir_t *dir);
|
|
|
|
/* DebugFS initialization */
|
|
void debugfs_init(void);
|
|
int debugfs_smc_setup(void);
|
|
|
|
/* Debugfs version returned through SMC interface */
|
|
#define DEBUGFS_VERSION (0x000000001U)
|
|
|
|
/* Function ID for accessing the debugfs interface from
|
|
* Vendor-Specific EL3 Range.
|
|
*/
|
|
#define DEBUGFS_FID_VALUE (0x10U)
|
|
|
|
#define is_debugfs_fid(_fid) \
|
|
(((_fid) & FUNCID_NUM_MASK) == DEBUGFS_FID_VALUE)
|
|
|
|
|
|
/* Function ID for accessing the debugfs interface from arm sip.
|
|
* This is now deprecated FID and will be removed after 2.12 release.
|
|
*/
|
|
#define DEBUGFS_FID_VALUE_DEPRECATED (0x30U)
|
|
|
|
#define is_debugfs_fid_deprecated(_fid) \
|
|
(((_fid) & FUNCID_NUM_MASK) == DEBUGFS_FID_VALUE_DEPRECATED)
|
|
|
|
|
|
/* Error code for debugfs SMC interface failures */
|
|
#define DEBUGFS_E_INVALID_PARAMS (-2)
|
|
#define DEBUGFS_E_DENIED (-3)
|
|
|
|
uintptr_t debugfs_smc_handler(unsigned int smc_fid,
|
|
u_register_t cmd,
|
|
u_register_t arg2,
|
|
u_register_t arg3,
|
|
u_register_t arg4,
|
|
void *cookie,
|
|
void *handle,
|
|
uintptr_t flags);
|
|
|
|
#endif /* DEBUGFS_H */
|