From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyoIZ-00034t-NC for qemu-devel@nongnu.org; Fri, 16 Oct 2009 11:00:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyoIS-00030k-Jl for qemu-devel@nongnu.org; Fri, 16 Oct 2009 11:00:52 -0400 Received: from [199.232.76.173] (port=60153 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyoIR-00030a-M3 for qemu-devel@nongnu.org; Fri, 16 Oct 2009 11:00:47 -0400 Received: from cantor.suse.de ([195.135.220.2]:41330 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MyoIQ-0003H9-UM for qemu-devel@nongnu.org; Fri, 16 Oct 2009 11:00:47 -0400 From: Ulrich Hecht Date: Fri, 16 Oct 2009 17:00:44 +0200 Message-Id: <1255705244-28375-1-git-send-email-uli@suse.de> Subject: [Qemu-devel] [PATCH] linux-user: KD/VT/FB ioctls List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: riku.voipio@iki.fi everything needed to run SDL on a framebuffer device in the userspace emulator Signed-off-by: Ulrich Hecht --- linux-user/ioctls.h | 14 ++++++++++++ linux-user/syscall.c | 2 + linux-user/syscall_defs.h | 16 +++++++++++++ linux-user/syscall_types.h | 51 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 0 deletions(-) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 685cc71..769e1bc 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -53,7 +53,10 @@ IOCTL(KIOCSOUND, 0, TYPE_INT) IOCTL(KDMKTONE, 0, TYPE_INT) + IOCTL(KDSETMODE, 0, TYPE_INT) IOCTL(KDGKBTYPE, IOC_R, MK_PTR(TYPE_CHAR)) + IOCTL(KDGKBMODE, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(KDSKBMODE, 0, TYPE_INT) IOCTL(KDGKBENT, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_kbentry))) IOCTL(KDGKBSENT, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_kbsentry))) @@ -314,3 +317,14 @@ IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop))) IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget))) IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos))) + + IOCTL(FBIOGET_FSCREENINFO, IOC_R, MK_PTR(MK_STRUCT(STRUCT_fb_fix_screeninfo))) + IOCTL(FBIOGET_VSCREENINFO, IOC_R, MK_PTR(MK_STRUCT(STRUCT_fb_var_screeninfo))) + IOCTL(FBIOPUT_VSCREENINFO, IOC_W, MK_PTR(MK_STRUCT(STRUCT_fb_var_screeninfo))) + + IOCTL(VT_OPENQRY, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(VT_GETSTATE, IOC_R, MK_PTR(MK_STRUCT(STRUCT_vt_stat))) + IOCTL(VT_ACTIVATE, 0, TYPE_INT) + IOCTL(VT_WAITACTIVE, 0, TYPE_INT) + IOCTL(VT_LOCKSWITCH, 0, TYPE_INT) + IOCTL(VT_UNLOCKSWITCH, 0, TYPE_INT) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bf06d14..dcbdcac 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -79,6 +79,8 @@ #include #include #include +#include +#include #include "linux_loop.h" #include "qemu.h" diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index c018165..15dbfb2 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -660,6 +660,9 @@ struct target_pollfd { #define TARGET_KIOCSOUND 0x4B2F /* start sound generation (0 for off) */ #define TARGET_KDMKTONE 0x4B30 /* generate tone */ #define TARGET_KDGKBTYPE 0x4b33 +#define TARGET_KDSETMODE 0x4b3a +#define TARGET_KDGKBMODE 0x4b44 +#define TARGET_KDSKBMODE 0x4b45 #define TARGET_KDGKBENT 0x4B46 /* gets one entry in translation table */ #define TARGET_KDGKBSENT 0x4B48 /* gets one function key string entry */ @@ -874,6 +877,19 @@ struct target_pollfd { #define TARGET_LOOP_GET_STATUS64 0x4C05 #define TARGET_LOOP_CHANGE_FD 0x4C06 +/* fb ioctls */ +#define TARGET_FBIOGET_VSCREENINFO 0x4600 +#define TARGET_FBIOPUT_VSCREENINFO 0x4601 +#define TARGET_FBIOGET_FSCREENINFO 0x4602 + +/* vt ioctls */ +#define TARGET_VT_OPENQRY 0x5600 +#define TARGET_VT_GETSTATE 0x5603 +#define TARGET_VT_ACTIVATE 0x5606 +#define TARGET_VT_WAITACTIVE 0x5607 +#define TARGET_VT_LOCKSWITCH 0x560b +#define TARGET_VT_UNLOCKSWITCH 0x560c + /* from asm/termbits.h */ #define TARGET_NCC 8 diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index d3f3df9..340dbd3 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -114,3 +114,54 @@ STRUCT(mtop, TYPE_SHORT, TYPE_INT) STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_INT, TYPE_INT) STRUCT(mtpos, TYPE_LONG) + +STRUCT(fb_fix_screeninfo, + MK_ARRAY(TYPE_CHAR, 16), /* id */ + TYPE_ULONG, /* smem_start */ + TYPE_INT, /* smem_len */ + TYPE_INT, /* type */ + TYPE_INT, /* type_aux */ + TYPE_INT, /* visual */ + TYPE_SHORT, /* xpanstep */ + TYPE_SHORT, /* ypanstep */ + TYPE_SHORT, /* ywrapstep */ + TYPE_INT, /* line_length */ + TYPE_ULONG, /* mmio_start */ + TYPE_INT, /* mmio_len */ + TYPE_INT, /* accel */ + MK_ARRAY(TYPE_CHAR, 3)) /* reserved */ + +STRUCT(fb_var_screeninfo, + TYPE_INT, /* xres */ + TYPE_INT, /* yres */ + TYPE_INT, /* xres_virtual */ + TYPE_INT, /* yres_virtual */ + TYPE_INT, /* xoffset */ + TYPE_INT, /* yoffset */ + TYPE_INT, /* bits_per_pixel */ + TYPE_INT, /* grayscale */ + MK_ARRAY(TYPE_INT, 3), /* red */ + MK_ARRAY(TYPE_INT, 3), /* green */ + MK_ARRAY(TYPE_INT, 3), /* blue */ + MK_ARRAY(TYPE_INT, 3), /* transp */ + TYPE_INT, /* nonstd */ + TYPE_INT, /* activate */ + TYPE_INT, /* height */ + TYPE_INT, /* width */ + TYPE_INT, /* accel_flags */ + TYPE_INT, /* pixclock */ + TYPE_INT, /* left_margin */ + TYPE_INT, /* right_margin */ + TYPE_INT, /* upper_margin */ + TYPE_INT, /* lower_margin */ + TYPE_INT, /* hsync_len */ + TYPE_INT, /* vsync_len */ + TYPE_INT, /* sync */ + TYPE_INT, /* vmode */ + TYPE_INT, /* rotate */ + MK_ARRAY(TYPE_INT, 5)) /* reserved */ + +STRUCT(vt_stat, + TYPE_SHORT, /* v_active */ + TYPE_SHORT, /* v_signal */ + TYPE_SHORT) /* v_state */ -- 1.6.2.1