Changeset 657 for trunk/kernel/fs/devfs.h
- Timestamp:
- Mar 18, 2020, 11:16:59 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/devfs.h
r612 r657 3 3 * 4 4 * Authors Mohamed Lamine Karaoui (2014,2015) 5 * Alain Greiner (2016,2017 )5 * Alain Greiner (2016,2017,2018,2019,2020) 6 6 * 7 7 * Copyright (c) 2011,2012 UPMC Sorbonne Universites … … 26 26 #define _DEVFS_H_ 27 27 28 28 29 ////////////////////////////////////////////////////////////////////////////////////////// 29 // The DEVFS File System contains inodes and dentries associated to all chdev descriptors30 // availablesin the architecture.30 // The DEVFS File System contains the inodes and dentries associated to the chdev 31 // descriptors available in the architecture. 31 32 // 32 33 // It is structured as a three levels tree structure : … … 41 42 // 42 43 // The DEVFS extensions to the generic VFS are the following: 43 // 1) The vfs_ctx_t "extend" void* field is pointing on the devfs_ctx_t structure. 44 // This structure contains two extended pointers on the DEVFS "dev" directory inode, 45 // and on the "external" directory inode. 46 // 2) The vfs_inode_t "extend" void* field is pointing on the chdev descriptor. 44 // 1) The vfs_ctx_t "extend" field is pointing on the devfs_ctx_t structure. 45 // 2) The vfs_inode_t "extend" field is pointing on the chdev descriptor. 47 46 ////////////////////////////////////////////////////////////////////////////////////////// 48 47 … … 57 56 } 58 57 devfs_ctx_t; 59 60 61 58 /***************************************************************************************** 62 * This fuction allocates memory from local cluster for a DEVFS context descriptor. 59 * This fuction allocates memory for a DEVFS context descriptor in cluster identified 60 * by the <cxy> argument. 63 61 ***************************************************************************************** 64 * @ return a pointer on the created context / return NULL if failure. 62 * @ cxy : [in] target cluster identifier. 63 * @ return an extended pointer on the created context / return NULL if failure. 65 64 ****************************************************************************************/ 66 devfs_ctx_t * devfs_ctx_alloc( void);65 xptr_t devfs_ctx_alloc( cxy_t cxy ); 67 66 68 67 /***************************************************************************************** … … 70 69 * to the relevant VFS context in the local cluster. 71 70 ***************************************************************************************** 72 * @ devfs_ctx : localpointer on DEVFS context.71 * @ devfs_ctx : [in] extended pointer on DEVFS context. 73 72 * @ devfs_dev_inode_xp : [out] extended pointer on <dev> inode. 74 73 * @ devfs_external_inode_xp : [out] extended pointer on <external> inode. 75 74 ****************************************************************************************/ 76 void devfs_ctx_init( devfs_ctx_t * devfs_ctx,77 xptr_t 78 xptr_t 75 void devfs_ctx_init( xptr_t devfs_ctx_xp, 76 xptr_t devfs_dev_inode_xp, 77 xptr_t devfs_external_inode_xp ); 79 78 80 79 /***************************************************************************************** … … 83 82 * @ devfs_ctx : local pointer on DEVFS context. 84 83 ****************************************************************************************/ 85 void devfs_ctx_destroy( devfs_ctx_t * devfs_ctx);84 void devfs_ctx_destroy( xptr_t devfs_ctx_xp ); 86 85 87 86 /***************************************************************************************** 88 * This function start to create the DEVFS subtree. 89 * This function should be called once in the cluster containing the VFS parent inode. 90 * More precisely, it creates in cluster 0 the "dev" and "external" DEVFS directories. 91 * For each one, it creates the inode and link the associated dentry to parent inode. 92 * The DEVFS root inode is linked to the VFS parent inode identified by <parent_inode_xp>. 87 * This function starts to create the DEVFS subtree. 88 * This function creates in cluster 0 the "dev" and "external" DEVFS directories. 89 * For each one, it creates the inode and the associated dentry. The DEVFS root inode 90 * <dev is linked to the VFS parent inode identified by <parent_inode_xp>. 93 91 ***************************************************************************************** 94 * @ parent_inode_xp : extended pointer on the parent VFS inode.92 * @ parent_inode_xp : [in] extended pointer on the parent VFS inode. 95 93 * @ devfs_dev_inode_xp : [out] extended pointer on created <dev> inode. 96 94 * @ devfs_external_inode_xp : [out] extended pointer on created <external> inode. … … 105 103 * 1. In each cluster (i), it creates the "internal" directory, 106 104 * linked to the DEVFS "dev" parent directory. 107 * 2. In each cluster (i), it creates - for each external chdev in cluster (i) -105 * 2. In each cluster (i), it creates, for each external chdev in cluster (i), 108 106 * a pseudo-file, linked to the DEVFS "external" parent directory. 109 * 3. In each cluster (i), it creates - for each internal chdev in cluster (i) -107 * 3. In each cluster (i), it creates, for each internal chdev in cluster (i), 110 108 * a pseudo-file, linked to the DEVFS "internal" parent directory. 111 109 ***************************************************************************************** 112 * @ devfs_dev_inode_xp : extended pointer on DEVFS root inode. 113 * @ devfs_external_inode_xp : extended pointer on DEVFS external inode. 114 * @ devfs_internal_inode_xp : [out] extended pointer on created <internal> inode. 110 * @ devfs_dev_inode_xp : [in] extended pointer on DEVFS root inode. 111 * @ devfs_external_inode_xp : [in] extended pointer on DEVFS external inode. 115 112 ****************************************************************************************/ 116 113 void devfs_local_init( xptr_t devfs_dev_inode_xp, 117 xptr_t devfs_external_inode_xp, 118 xptr_t * devfs_internal_inode_xp ); 114 xptr_t devfs_external_inode_xp ); 119 115 120 116 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.