forked from Imagelibrary/rtems
Added termios submission from Eric Norum and Katsutoshi Shibuya.
This commit is contained in:
@@ -32,7 +32,7 @@ typedef struct {
|
|||||||
char *pathname; /* opened pathname */
|
char *pathname; /* opened pathname */
|
||||||
Objects_Id sem;
|
Objects_Id sem;
|
||||||
unsigned32 data0; /* private to "driver" */
|
unsigned32 data0; /* private to "driver" */
|
||||||
unsigned32 data1; /* ... */
|
void *data1; /* ... */
|
||||||
} rtems_libio_t;
|
} rtems_libio_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ int __rtems_isatty(int _fd);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
||||||
int (*close)(int fd);
|
int (*close)(int fd);
|
||||||
int (*read)(int fd, void *buffer, unsigned32 count);
|
int (*read)(int fd, void *buffer);
|
||||||
int (*write)(int fd, const void *buffer, unsigned32 count);
|
int (*write)(int fd, const void *buffer, unsigned32 count);
|
||||||
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
||||||
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
||||||
@@ -128,4 +128,24 @@ void rtems_register_libio_handler(int handler_flag,
|
|||||||
#define RTEMS_IO_GET_ATTRIBUTES 1
|
#define RTEMS_IO_GET_ATTRIBUTES 1
|
||||||
#define RTEMS_IO_SET_ATTRIBUTES 2
|
#define RTEMS_IO_SET_ATTRIBUTES 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Termios prototypes
|
||||||
|
*/
|
||||||
|
void rtems_termios_initialize (void);
|
||||||
|
rtems_status_code rtems_termios_open (
|
||||||
|
rtems_device_major_number major,
|
||||||
|
rtems_device_minor_number minor,
|
||||||
|
void *arg,
|
||||||
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
|
int (*deviceRead)(int minor, char *buf),
|
||||||
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
|
);
|
||||||
|
|
||||||
|
rtems_status_code rtems_termios_close (void *arg);
|
||||||
|
rtems_status_code rtems_termios_read (void *arg);
|
||||||
|
rtems_status_code rtems_termios_write (void *arg);
|
||||||
|
rtems_status_code rtems_termios_ioctl (void *arg);
|
||||||
|
void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
|
||||||
|
|
||||||
#endif /* _RTEMS_LIBIO_H */
|
#endif /* _RTEMS_LIBIO_H */
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ typedef struct {
|
|||||||
char *pathname; /* opened pathname */
|
char *pathname; /* opened pathname */
|
||||||
Objects_Id sem;
|
Objects_Id sem;
|
||||||
unsigned32 data0; /* private to "driver" */
|
unsigned32 data0; /* private to "driver" */
|
||||||
unsigned32 data1; /* ... */
|
void *data1; /* ... */
|
||||||
} rtems_libio_t;
|
} rtems_libio_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ int __rtems_isatty(int _fd);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
||||||
int (*close)(int fd);
|
int (*close)(int fd);
|
||||||
int (*read)(int fd, void *buffer, unsigned32 count);
|
int (*read)(int fd, void *buffer);
|
||||||
int (*write)(int fd, const void *buffer, unsigned32 count);
|
int (*write)(int fd, const void *buffer, unsigned32 count);
|
||||||
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
||||||
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
||||||
@@ -128,4 +128,24 @@ void rtems_register_libio_handler(int handler_flag,
|
|||||||
#define RTEMS_IO_GET_ATTRIBUTES 1
|
#define RTEMS_IO_GET_ATTRIBUTES 1
|
||||||
#define RTEMS_IO_SET_ATTRIBUTES 2
|
#define RTEMS_IO_SET_ATTRIBUTES 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Termios prototypes
|
||||||
|
*/
|
||||||
|
void rtems_termios_initialize (void);
|
||||||
|
rtems_status_code rtems_termios_open (
|
||||||
|
rtems_device_major_number major,
|
||||||
|
rtems_device_minor_number minor,
|
||||||
|
void *arg,
|
||||||
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
|
int (*deviceRead)(int minor, char *buf),
|
||||||
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
|
);
|
||||||
|
|
||||||
|
rtems_status_code rtems_termios_close (void *arg);
|
||||||
|
rtems_status_code rtems_termios_read (void *arg);
|
||||||
|
rtems_status_code rtems_termios_write (void *arg);
|
||||||
|
rtems_status_code rtems_termios_ioctl (void *arg);
|
||||||
|
void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
|
||||||
|
|
||||||
#endif /* _RTEMS_LIBIO_H */
|
#endif /* _RTEMS_LIBIO_H */
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ typedef struct {
|
|||||||
char *pathname; /* opened pathname */
|
char *pathname; /* opened pathname */
|
||||||
Objects_Id sem;
|
Objects_Id sem;
|
||||||
unsigned32 data0; /* private to "driver" */
|
unsigned32 data0; /* private to "driver" */
|
||||||
unsigned32 data1; /* ... */
|
void *data1; /* ... */
|
||||||
} rtems_libio_t;
|
} rtems_libio_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ int __rtems_isatty(int _fd);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
||||||
int (*close)(int fd);
|
int (*close)(int fd);
|
||||||
int (*read)(int fd, void *buffer, unsigned32 count);
|
int (*read)(int fd, void *buffer);
|
||||||
int (*write)(int fd, const void *buffer, unsigned32 count);
|
int (*write)(int fd, const void *buffer, unsigned32 count);
|
||||||
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
||||||
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
||||||
@@ -128,4 +128,24 @@ void rtems_register_libio_handler(int handler_flag,
|
|||||||
#define RTEMS_IO_GET_ATTRIBUTES 1
|
#define RTEMS_IO_GET_ATTRIBUTES 1
|
||||||
#define RTEMS_IO_SET_ATTRIBUTES 2
|
#define RTEMS_IO_SET_ATTRIBUTES 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Termios prototypes
|
||||||
|
*/
|
||||||
|
void rtems_termios_initialize (void);
|
||||||
|
rtems_status_code rtems_termios_open (
|
||||||
|
rtems_device_major_number major,
|
||||||
|
rtems_device_minor_number minor,
|
||||||
|
void *arg,
|
||||||
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
|
int (*deviceRead)(int minor, char *buf),
|
||||||
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
|
);
|
||||||
|
|
||||||
|
rtems_status_code rtems_termios_close (void *arg);
|
||||||
|
rtems_status_code rtems_termios_read (void *arg);
|
||||||
|
rtems_status_code rtems_termios_write (void *arg);
|
||||||
|
rtems_status_code rtems_termios_ioctl (void *arg);
|
||||||
|
void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
|
||||||
|
|
||||||
#endif /* _RTEMS_LIBIO_H */
|
#endif /* _RTEMS_LIBIO_H */
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ typedef struct {
|
|||||||
char *pathname; /* opened pathname */
|
char *pathname; /* opened pathname */
|
||||||
Objects_Id sem;
|
Objects_Id sem;
|
||||||
unsigned32 data0; /* private to "driver" */
|
unsigned32 data0; /* private to "driver" */
|
||||||
unsigned32 data1; /* ... */
|
void *data1; /* ... */
|
||||||
} rtems_libio_t;
|
} rtems_libio_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ int __rtems_isatty(int _fd);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
|
||||||
int (*close)(int fd);
|
int (*close)(int fd);
|
||||||
int (*read)(int fd, void *buffer, unsigned32 count);
|
int (*read)(int fd, void *buffer);
|
||||||
int (*write)(int fd, const void *buffer, unsigned32 count);
|
int (*write)(int fd, const void *buffer, unsigned32 count);
|
||||||
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
int (*ioctl)(int fd, unsigned32 command, void *buffer);
|
||||||
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
|
||||||
@@ -128,4 +128,24 @@ void rtems_register_libio_handler(int handler_flag,
|
|||||||
#define RTEMS_IO_GET_ATTRIBUTES 1
|
#define RTEMS_IO_GET_ATTRIBUTES 1
|
||||||
#define RTEMS_IO_SET_ATTRIBUTES 2
|
#define RTEMS_IO_SET_ATTRIBUTES 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Termios prototypes
|
||||||
|
*/
|
||||||
|
void rtems_termios_initialize (void);
|
||||||
|
rtems_status_code rtems_termios_open (
|
||||||
|
rtems_device_major_number major,
|
||||||
|
rtems_device_minor_number minor,
|
||||||
|
void *arg,
|
||||||
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
|
int (*deviceRead)(int minor, char *buf),
|
||||||
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
|
);
|
||||||
|
|
||||||
|
rtems_status_code rtems_termios_close (void *arg);
|
||||||
|
rtems_status_code rtems_termios_read (void *arg);
|
||||||
|
rtems_status_code rtems_termios_write (void *arg);
|
||||||
|
rtems_status_code rtems_termios_ioctl (void *arg);
|
||||||
|
void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
|
||||||
|
|
||||||
#endif /* _RTEMS_LIBIO_H */
|
#endif /* _RTEMS_LIBIO_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user