ncloader  0.1
 모두 데이타 구조 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 매크로 그룹들 페이지들
device.h
이 파일의 문서화 페이지로 가기
1 
23 enum DEVICE {
25  DEVICE_COM1 = 0x0200,
26  DEVICE_COM2 = 0x0201,
27  DEVICE_COM3 = 0x0202,
28  DEVICE_COM4 = 0x0203,
29  DEVICE_FDC = 0x0300,
30 };
31 
32 enum IOCTL {
34 };
35 
37 #define MAJOR(id) ((id) >> 8)
38 
40 #define MINOR(id) ((id) & 0xFF)
41 
42 struct device_op {
43  int (*open)(int id, int ctx_id);
44  int (*read)(int ctx_id, char *buffer, int size);
45  int (*write)(int ctx_id, const char *buffer, int size);
46  int (*seek)(int ctx_id, int offset, int whence);
47  int (*ctrl)(int ctx_id, int cmd, va_list ap);
48  int (*close)(int ctx_id);
49 };
50 
55 extern int device_init(void);
56 
63 extern int device_open(int id);
64 
74 extern int device_read(int handle, char *buffer, int size);
75 
85 extern int device_write(int handle, const char *buffer, int size);
86 
94 extern int device_seek(int handle, int offset, int whence);
95 
103 extern int device_ctrl(int handle, int cmd, ...);
104 
111 extern int device_close(int handle);
112 
120 extern int device_register(int id, struct device_op *ops);
121 
128 extern int device_unregister(int id);
129