|
PS2SDK
PS2 Homebrew Libraries
|
#include "types.h"#include "defs.h"#include "irx.h"#include "loadcore.h"#include "thbase.h"#include "thevent.h"#include "thsemap.h"#include "intrman.h"#include "stdio.h"#include "sysclib.h"#include <errno.h>#include "devfs.h"#include "sysmem.h"#include "iomanX.h"
Include dependency graph for devfs.c:Go to the source code of this file.
Data Structures | |
| struct | subdev_t |
| struct | _devfs_device |
| struct | _ioman_data |
| struct | _directory_file |
Typedefs | |
| typedef struct _devfs_device | devfs_device_t |
| typedef struct _ioman_data | ioman_data_t |
| typedef struct _directory_file | directory_file_t |
Functions | |
| IRX_ID (MODNAME, 1, 1) | |
| const char * | devfs_subdev_to_str (int subdev) |
| int | devfs_fill_dirent (iox_dirent_t *dirent, int devno) |
| devfs_device_t * | devfs_create_device (const devfs_node_t *node) |
| int | devfs_delete_device (devfs_device_t *dev) |
| devfs_device_t * | devfs_find_devicename (const char *name) |
| devfs_device_t * | devfs_find_deviceid (HDEV hDev) |
| int | devfs_open (iop_file_t *file, const char *name, int mode, int unused) |
| int | devfs_close (iop_file_t *file) |
| int | devfs_ioctl (iop_file_t *file, int cmd, void *args) |
| int | devfs_ioctl2 (iop_file_t *file, int cmd, void *args, unsigned int arglen, void *buf, unsigned int buflen) |
| int | devfs_read (iop_file_t *file, void *buf, int len) |
| int | devfs_write (iop_file_t *file, void *buf, int len) |
| int | devfs_lseek (iop_file_t *file, long loc, int whence) |
| int | devfs_lseek64 (iop_file_t *file, long long loc, int whence) |
| int | devfs_dopen (iop_file_t *file, const char *name) |
| int | devfs_dclose (iop_file_t *file) |
| int | devfs_dread (iop_file_t *file, iox_dirent_t *buf) |
| int | devfs_getstat (iop_file_t *file, const char *name, iox_stat_t *stat) |
| IOMANX_RETURN_VALUE_IMPL (0) | |
| IOMANX_RETURN_VALUE_IMPL (EPERM) | |
| int | init_devfs (void) |
| int | _start (int argc, char *argv[]) |
| int | devfs_check_devname (const char *name) |
| HDEV | DevFSAddDevice (const devfs_node_t *node) |
| int | DevFSDelDevice (HDEV hDev) |
| int | DevFSAddSubDevice (HDEV hDev, u32 subdev_no, s32 mode, devfs_loc_t extent, void *data) |
| int | DevFSDelSubDevice (HDEV hDev, u32 subdev_no) |
Variables | |
| struct irx_export_table | _exp_devfs |
| devfs_device_t * | root_device |
| HDEV | dev_count |
| directory_file_t | open_dirfiles [MAX_OPEN_DIRFILES] |
| static iop_device_ops_t | devfs_ops |
| static iop_device_t | devfs_device |
DevFS source file
Definition in file devfs.c.
| struct subdev_t |
Collaboration diagram for subdev_t:| Data Fields | ||
|---|---|---|
| void * | data | |
| s32 | valid | |
| u32 | mode | |
| u32 | open_refcount | |
| devfs_loc_t | extent | |
| struct _ioman_data * | open_files[MAX_OPENFILES] | |
| struct _devfs_device |
Collaboration diagram for _devfs_device:| Data Fields | ||
|---|---|---|
| struct _devfs_device * | forw |
Pointers to the next device in the chain |
| struct _devfs_device * | back | |
| HDEV | hDev | |
| devfs_node_t | node | |
| subdev_t | subdevs[DEVFS_MAX_SUBDEVS] | |
| u32 | subdev_count | |
| u32 | open_refcount | |
| struct _ioman_data |
Collaboration diagram for _ioman_data:| Data Fields | ||
|---|---|---|
| HDEV | hDev | |
| devfs_device_t * | dev |
Pointer to the main device, set to NULL if device closed |
| int | subdev | |
| u32 | mode | |
| devfs_loc_t | loc | |
| struct _directory_file |
| const char* devfs_subdev_to_str | ( | int | subdev | ) |
| int devfs_fill_dirent | ( | iox_dirent_t * | dirent, |
| int | devno | ||
| ) |
Scans the device list and fills in the corresponding directory entry
| dirent | Pointer to a iox_dirent_t structure. |
| devno | The sequential device number to read |
Definition at line 137 of file devfs.c.
References root_device.
| devfs_device_t* devfs_create_device | ( | const devfs_node_t * | node | ) |
Creates a new device based on the node data supplied
| node | Pointer to a devfs_node_t structure |
| int devfs_delete_device | ( | devfs_device_t * | dev | ) |
| devfs_device_t* devfs_find_devicename | ( | const char * | name | ) |
| devfs_device_t* devfs_find_deviceid | ( | HDEV | hDev | ) |
Finds a device from its device handle.
| hDev | Handle to the device. |
Definition at line 309 of file devfs.c.
References root_device.
Referenced by DevFSDelDevice(), and DevFSDelSubDevice().
| int devfs_open | ( | iop_file_t * | file, |
| const char * | name, | ||
| int | mode, | ||
| int | unused | ||
| ) |
| int devfs_close | ( | iop_file_t * | file | ) |
| int devfs_ioctl | ( | iop_file_t * | file, |
| int | cmd, | ||
| void * | args | ||
| ) |
| int devfs_ioctl2 | ( | iop_file_t * | file, |
| int | cmd, | ||
| void * | args, | ||
| unsigned int | arglen, | ||
| void * | buf, | ||
| unsigned int | buflen | ||
| ) |
ioman ioctl2 handler
| file | Pointer to an ioman file structure |
| cmd | ioctl command number |
| args | Pointer a buffer containing command arguments |
| arglen | Length of args buffer |
| buf | Pointer to a return buffer |
| buflen | Length of buf |
| int devfs_read | ( | iop_file_t * | file, |
| void * | buf, | ||
| int | len | ||
| ) |
| int devfs_write | ( | iop_file_t * | file, |
| void * | buf, | ||
| int | len | ||
| ) |
| int devfs_lseek | ( | iop_file_t * | file, |
| long | loc, | ||
| int | whence | ||
| ) |
| int devfs_lseek64 | ( | iop_file_t * | file, |
| long long | loc, | ||
| int | whence | ||
| ) |
| int devfs_dopen | ( | iop_file_t * | file, |
| const char * | name | ||
| ) |
| int devfs_dclose | ( | iop_file_t * | file | ) |
ioman dclose handler
| file | Pointer to an ioman file structure |
Definition at line 852 of file devfs.c.
References _directory_file::hDev, INVALID_HDEV, _directory_file::opened, and _iop_file::privdata.
| int devfs_getstat | ( | iop_file_t * | file, |
| const char * | name, | ||
| iox_stat_t * | stat | ||
| ) |
| int init_devfs | ( | void | ) |
DevFS initialise function
Definition at line 1026 of file devfs.c.
References root_device.
| int _start | ( | int | argc, |
| char * | argv[] | ||
| ) |
| int devfs_check_devname | ( | const char * | name | ) |
| devfs_device_t* root_device |
Pointer to the root device
Definition at line 82 of file devfs.c.
Referenced by devfs_fill_dirent(), devfs_find_deviceid(), and init_devfs().
|
static |
|
static |