Rev 2337 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2337 | Rev 2350 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup kbdarm32 arm32 |
29 | /** @addtogroup kbdarm32gxemul GXemul |
30 | * @brief HelenOS arm32 arch dependent parts of uspace keyboard handler. |
30 | * @brief HelenOS arm32 GXEmul uspace keyboard handler. |
31 | * @ingroup kbd |
31 | * @ingroup kbdarm32 |
32 | * @{ |
32 | * @{ |
33 | */ |
33 | */ |
34 | /** @file |
34 | /** @file |
- | 35 | * @brief GXemul uspace keyboard handler. |
|
35 | */ |
36 | */ |
36 | 37 | ||
37 | #include <arch/kbd.h> |
- | |
38 | #include <ipc/ipc.h> |
38 | #include <ipc/ipc.h> |
39 | #include <sysinfo.h> |
39 | #include <sysinfo.h> |
40 | #include <kbd.h> |
40 | #include <kbd.h> |
41 | #include <keys.h> |
41 | #include <keys.h> |
42 | 42 | ||
Line 51... | Line 51... | ||
51 | #define GXEMUL_KEY_F9 0x30325b1bL |
51 | #define GXEMUL_KEY_F9 0x30325b1bL |
52 | #define GXEMUL_KEY_F10 0x31325b1bL |
52 | #define GXEMUL_KEY_F10 0x31325b1bL |
53 | #define GXEMUL_KEY_F11 0x33325d1bL |
53 | #define GXEMUL_KEY_F11 0x33325d1bL |
54 | #define GXEMUL_KEY_F12 0x34325b1bL |
54 | #define GXEMUL_KEY_F12 0x34325b1bL |
55 | 55 | ||
- | 56 | /** Function keys start code (F1=0x101) */ |
|
56 | #define FUNCTION_KEYS 0x100 |
57 | #define FUNCTION_KEYS 0x100 |
57 | 58 | ||
58 | irq_cmd_t gxemul_cmds[] = { |
59 | irq_cmd_t gxemul_cmds[] = { |
59 | { |
60 | { |
60 | CMD_MEM_READ_1, |
61 | CMD_MEM_READ_1, |
Line 76... | Line 77... | ||
76 | { |
77 | { |
77 | return "0123456789ABCDEF"[v]; |
78 | return "0123456789ABCDEF"[v]; |
78 | } |
79 | } |
79 | */ |
80 | */ |
80 | 81 | ||
- | 82 | ||
- | 83 | /** Process data sent when a key is pressed. |
|
- | 84 | * |
|
- | 85 | * @param keybuffer Buffer of scan codes. |
|
- | 86 | * @param scan_code Scan code. |
|
- | 87 | * |
|
- | 88 | * @return Code of the pressed key. |
|
- | 89 | */ |
|
81 | static int gxemul_process_no_fb(keybuffer_t *keybuffer, int scan_code) |
90 | static int gxemul_process_no_fb(keybuffer_t *keybuffer, int scan_code) |
82 | { |
91 | { |
83 | 92 | ||
84 | static unsigned long buf = 0; |
93 | static unsigned long buf = 0; |
85 | static int count = 0; |
94 | static int count = 0; |
Line 216... | Line 225... | ||
216 | } |
225 | } |
217 | return 1; |
226 | return 1; |
218 | } |
227 | } |
219 | 228 | ||
220 | 229 | ||
- | 230 | /** Initializes keyboard handler. */ |
|
221 | int kbd_arch_init(void) |
231 | int kbd_arch_init(void) |
222 | { |
232 | { |
223 | gxemul_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual"); |
233 | gxemul_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual"); |
224 | ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &gxemul_kbd); |
234 | ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &gxemul_kbd); |
225 | return 0; |
235 | return 0; |
226 | } |
236 | } |
227 | 237 | ||
228 | 238 | ||
- | 239 | /** Process data sent when a key is pressed. |
|
- | 240 | * |
|
- | 241 | * @param keybuffer Buffer of scan codes. |
|
- | 242 | * @param call IPC call. |
|
- | 243 | * |
|
- | 244 | * @return Code of the pressed key. |
|
- | 245 | */ |
|
229 | int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call) |
246 | int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call) |
230 | { |
247 | { |
231 | int scan_code = IPC_GET_ARG2(*call); |
248 | int scan_code = IPC_GET_ARG2(*call); |
232 | static int esc_count=0; |
249 | static int esc_count = 0; |
233 | 250 |