diff options
Diffstat (limited to 'arch/mips/include/asm/rtlx.h')
-rw-r--r-- | arch/mips/include/asm/rtlx.h | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/arch/mips/include/asm/rtlx.h b/arch/mips/include/asm/rtlx.h index 90985b61dbd9..c1020654876e 100644 --- a/arch/mips/include/asm/rtlx.h +++ b/arch/mips/include/asm/rtlx.h | |||
@@ -1,13 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. | 2 | * This file is subject to the terms and conditions of the GNU General Public |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
3 | * | 5 | * |
6 | * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. | ||
7 | * Copyright (C) 2013 Imagination Technologies Ltd. | ||
4 | */ | 8 | */ |
5 | |||
6 | #ifndef __ASM_RTLX_H_ | 9 | #ifndef __ASM_RTLX_H_ |
7 | #define __ASM_RTLX_H_ | 10 | #define __ASM_RTLX_H_ |
8 | 11 | ||
9 | #include <irq.h> | 12 | #include <irq.h> |
10 | 13 | ||
14 | #define RTLX_MODULE_NAME "rtlx" | ||
15 | |||
11 | #define LX_NODE_BASE 10 | 16 | #define LX_NODE_BASE 10 |
12 | 17 | ||
13 | #define MIPS_CPU_RTLX_IRQ 0 | 18 | #define MIPS_CPU_RTLX_IRQ 0 |
@@ -15,18 +20,31 @@ | |||
15 | #define RTLX_VERSION 2 | 20 | #define RTLX_VERSION 2 |
16 | #define RTLX_xID 0x12345600 | 21 | #define RTLX_xID 0x12345600 |
17 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) | 22 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) |
23 | #define RTLX_BUFFER_SIZE 2048 | ||
18 | #define RTLX_CHANNELS 8 | 24 | #define RTLX_CHANNELS 8 |
19 | 25 | ||
20 | #define RTLX_CHANNEL_STDIO 0 | 26 | #define RTLX_CHANNEL_STDIO 0 |
21 | #define RTLX_CHANNEL_DBG 1 | 27 | #define RTLX_CHANNEL_DBG 1 |
22 | #define RTLX_CHANNEL_SYSIO 2 | 28 | #define RTLX_CHANNEL_SYSIO 2 |
23 | 29 | ||
24 | extern int rtlx_open(int index, int can_sleep); | 30 | void rtlx_starting(int vpe); |
25 | extern int rtlx_release(int index); | 31 | void rtlx_stopping(int vpe); |
26 | extern ssize_t rtlx_read(int index, void __user *buff, size_t count); | 32 | |
27 | extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count); | 33 | int rtlx_open(int index, int can_sleep); |
28 | extern unsigned int rtlx_read_poll(int index, int can_sleep); | 34 | int rtlx_release(int index); |
29 | extern unsigned int rtlx_write_poll(int index); | 35 | ssize_t rtlx_read(int index, void __user *buff, size_t count); |
36 | ssize_t rtlx_write(int index, const void __user *buffer, size_t count); | ||
37 | unsigned int rtlx_read_poll(int index, int can_sleep); | ||
38 | unsigned int rtlx_write_poll(int index); | ||
39 | |||
40 | int __init rtlx_module_init(void); | ||
41 | void __exit rtlx_module_exit(void); | ||
42 | |||
43 | void _interrupt_sp(void); | ||
44 | |||
45 | extern struct vpe_notifications rtlx_notify; | ||
46 | extern const struct file_operations rtlx_fops; | ||
47 | extern void (*aprp_hook)(void); | ||
30 | 48 | ||
31 | enum rtlx_state { | 49 | enum rtlx_state { |
32 | RTLX_STATE_UNUSED = 0, | 50 | RTLX_STATE_UNUSED = 0, |
@@ -35,10 +53,15 @@ enum rtlx_state { | |||
35 | RTLX_STATE_OPENED | 53 | RTLX_STATE_OPENED |
36 | }; | 54 | }; |
37 | 55 | ||
38 | #define RTLX_BUFFER_SIZE 2048 | 56 | extern struct chan_waitqueues { |
57 | wait_queue_head_t rt_queue; | ||
58 | wait_queue_head_t lx_queue; | ||
59 | atomic_t in_open; | ||
60 | struct mutex mutex; | ||
61 | } channel_wqs[RTLX_CHANNELS]; | ||
39 | 62 | ||
40 | /* each channel supports read and write. | 63 | /* each channel supports read and write. |
41 | linux (vpe0) reads lx_buffer and writes rt_buffer | 64 | linux (vpe0) reads lx_buffer and writes rt_buffer |
42 | SP (vpe1) reads rt_buffer and writes lx_buffer | 65 | SP (vpe1) reads rt_buffer and writes lx_buffer |
43 | */ | 66 | */ |
44 | struct rtlx_channel { | 67 | struct rtlx_channel { |
@@ -55,11 +78,11 @@ struct rtlx_channel { | |||
55 | char *lx_buffer; | 78 | char *lx_buffer; |
56 | }; | 79 | }; |
57 | 80 | ||
58 | struct rtlx_info { | 81 | extern struct rtlx_info { |
59 | unsigned long id; | 82 | unsigned long id; |
60 | enum rtlx_state state; | 83 | enum rtlx_state state; |
84 | int ap_int_pending; /* Status of 0 or 1 for CONFIG_MIPS_CMP only */ | ||
61 | 85 | ||
62 | struct rtlx_channel channel[RTLX_CHANNELS]; | 86 | struct rtlx_channel channel[RTLX_CHANNELS]; |
63 | }; | 87 | } *rtlx; |
64 | |||
65 | #endif /* __ASM_RTLX_H_ */ | 88 | #endif /* __ASM_RTLX_H_ */ |