devfs.h 546 B

1234567891011121314151617181920
  1. #pragma once
  2. #include "devfs-types.h"
  3. /**
  4. * @brief 初始化devfs
  5. *
  6. */
  7. void devfs_init();
  8. /**
  9. * @brief 在devfs中注册设备
  10. *
  11. * @param device_type 设备主类型
  12. * @param sub_type 设备子类型
  13. * @param file_ops 设备的文件操作接口
  14. * @param ret_private_inode_info_ptr 返回的指向inode私有信息结构体的指针
  15. * @return int 错误码
  16. */
  17. int devfs_register_device(uint16_t device_type, uint16_t sub_type, struct vfs_file_operations_t *file_ops, struct devfs_private_inode_info_t **ret_private_inode_info_ptr);