X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Fasm-mips%2Frtlx.h;h=59162f74a7982b98801fe903aceafe0fe08354a5;hb=2fd592e45b9c89d69e126f172d0f991e2af955e5;hp=83cdf6ab0d1fbc82d601f9290f775e04360ce460;hpb=c7fb577e2a6cb04732541f2dc402bd46747f7558;p=powerpc.git diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h index 83cdf6ab0d..59162f74a7 100644 --- a/include/asm-mips/rtlx.h +++ b/include/asm-mips/rtlx.h @@ -3,32 +3,45 @@ * */ -#ifndef _RTLX_H -#define _RTLX_H_ +#ifndef __ASM_RTLX_H +#define __ASM_RTLX_H_ + +#include #define LX_NODE_BASE 10 -#define MIPSCPU_INT_BASE 16 #define MIPS_CPU_RTLX_IRQ 0 -#define RTLX_VERSION 1 +#define RTLX_VERSION 2 #define RTLX_xID 0x12345600 #define RTLX_ID (RTLX_xID | RTLX_VERSION) #define RTLX_CHANNELS 8 +#define RTLX_CHANNEL_STDIO 0 +#define RTLX_CHANNEL_DBG 1 +#define RTLX_CHANNEL_SYSIO 2 + +extern int rtlx_open(int index, int can_sleep); +extern int rtlx_release(int index); +extern ssize_t rtlx_read(int index, void *buff, size_t count, int user); +extern ssize_t rtlx_write(int index, void *buffer, size_t count, int user); +extern unsigned int rtlx_read_poll(int index, int can_sleep); +extern unsigned int rtlx_write_poll(int index); + enum rtlx_state { - RTLX_STATE_UNUSED = 0, + RTLX_STATE_UNUSED, RTLX_STATE_INITIALISED, RTLX_STATE_REMOTE_READY, RTLX_STATE_OPENED }; #define RTLX_BUFFER_SIZE 1024 + /* each channel supports read and write. linux (vpe0) reads lx_buffer and writes rt_buffer SP (vpe1) reads rt_buffer and writes lx_buffer */ -typedef struct rtlx_channel { +struct rtlx_channel { enum rtlx_state rt_state; enum rtlx_state lx_state; @@ -40,17 +53,13 @@ typedef struct rtlx_channel { int lx_write, lx_read; char *lx_buffer; +}; - void *queues; - -} rtlx_channel_t; - -typedef struct rtlx_info { +struct rtlx_info { unsigned long id; enum rtlx_state state; struct rtlx_channel channel[RTLX_CHANNELS]; +}; -} rtlx_info_t; - -#endif +#endif /* __ASM_RTLX_H_ */