From: John Hodge Date: Mon, 20 May 2013 08:18:24 +0000 (+0800) Subject: Usermode/ld-acess - PTY 2D commands X-Git-Tag: rel0.15~462 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=8481db38ad481ab13963d44c33352bc8af740f25;p=tpg%2Facess2.git Usermode/ld-acess - PTY 2D commands --- diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices.h b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices.h index 9ee77b0d..53c8361d 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices.h @@ -8,6 +8,10 @@ #ifndef _ACESS_DRIVERS_H #define _ACESS_DRIVERS_H +#ifndef PACKED +#define PACKED __attribute((packed)) +#endif + // === COMMON === enum eDrv_Common { /** diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty.h b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty.h index c929e9b5..005703de 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty.h @@ -8,6 +8,7 @@ #ifndef _ACESS_DEVICES_PTY_H_ #define _ACESS_DEVICES_PTY_H_ + #include "../devices.h" #define PTYIMODE_CANON 0x001 @@ -30,12 +31,12 @@ struct ptydims short H; short PW; short PH; -}; +} PACKED; struct ptymode { unsigned int OutputMode; unsigned int InputMode; -}; +} PACKED; enum { diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty_cmds.h b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty_cmds.h index 4b28190a..2ec0cd07 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty_cmds.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/devices/pty_cmds.h @@ -22,12 +22,27 @@ enum PTY2D_CMD_RECV, }; +struct ptycmd_header +{ + uint8_t cmd; + uint8_t len_low; + uint16_t len_hi; +} PACKED; + struct ptycmd_setcursorpos { - uint16_t cmd; + struct ptycmd_header hdr; uint16_t x; uint16_t y; -}; +} PACKED; + +struct ptycmd_setcursorbmp +{ + struct ptycmd_header hdr; + uint16_t w; + uint16_t h; + char data[]; +} PACKED; #endif