From 7a404f4a4f1a5b2855b000d83a4ce01328b7dc93 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Fri, 6 Jul 2007 15:57:14 +0000 Subject: gpe-scap: Add fixed version 1.3 --- packages/gpe-scap/gpe-scap_1.3.bb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/gpe-scap/gpe-scap_1.3.bb diff --git a/packages/gpe-scap/gpe-scap_1.3.bb b/packages/gpe-scap/gpe-scap_1.3.bb new file mode 100644 index 0000000000..aec5819e6e --- /dev/null +++ b/packages/gpe-scap/gpe-scap_1.3.bb @@ -0,0 +1,13 @@ +DESCRIPTION = "GPE screenshot application" +LICENSE = "GPL" +PRIORITY = "optional" +SECTION = "gpe" +PR = "r0" + +RREPLACES = "gpe-screenshot" + +DEPENDS = "glib-2.0 gtk+ libgpewidget libglade libsoup" + +GPE_TARBALL_SUFFIX = "bz2" + +inherit gpe autotools -- cgit v1.2.3 From 4b37859e36525c4902b0f8f22c6cdc6339958171 Mon Sep 17 00:00:00 2001 From: Henning Heinold Date: Fri, 6 Jul 2007 16:21:19 +0000 Subject: obexftp needed same autotools-love because it depends on libiconv when compiling with uclibc. iconv.patch fix the Makefile.am so it uses libiconv in linker stage obexftp_0.20.bb bump PR make depends on libiconv --- packages/obexftp/files/iconv.patch | 24 ++++++++++++++++++++++++ packages/obexftp/obexftp_0.20.bb | 7 ++++--- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 packages/obexftp/files/iconv.patch diff --git a/packages/obexftp/files/iconv.patch b/packages/obexftp/files/iconv.patch new file mode 100644 index 0000000000..83b01a02fe --- /dev/null +++ b/packages/obexftp/files/iconv.patch @@ -0,0 +1,24 @@ +--- obexftp-0.20/obexftp/Makefile.am 2007-06-27 20:33:20.000000000 +0200 ++++ obexftp-0.20/obexftp/Makefile.am 2007-06-27 20:35:05.000000000 +0200 +@@ -4,12 +4,6 @@ + -I$(top_srcdir) \ + -I$(top_srcdir)/includes + +-LDADD = @OPENOBEX_LIBS@ +-# @BLUETOOTH_LIBS@ \ +-# @USB_LIBS@ \ +-# ../multicobex/libmulticobex.la \ +-# ../bfb/libbfb.la +- + obexftpincludedir = $(includedir)/obexftp + + libobexftp_la_SOURCES = object.c object.h \ +@@ -23,6 +17,8 @@ + uuid.h \ + object.h + ++libobexftp_la_LIBADD = @OPENOBEX_LIBS@ @LIBICONV@ ++ + libobexftp_la_LDFLAGS = -version-info $(OBEXFTP_VERSION) + + EXTRA_DIST = client.i diff --git a/packages/obexftp/obexftp_0.20.bb b/packages/obexftp/obexftp_0.20.bb index 23e360bbae..4920ae9eff 100644 --- a/packages/obexftp/obexftp_0.20.bb +++ b/packages/obexftp/obexftp_0.20.bb @@ -2,11 +2,12 @@ DESCRIPTION = "OBEX Ftp Client based on openobex." SECTION = "console/network" HOMEPAGE = "http://openobex.triq.net" LICENSE = "GPL" -DEPENDS = "openobex libgsm" -PR = "r2" +DEPENDS = "openobex libgsm libiconv" +PR = "r3" SRC_URI = "${SOURCEFORGE_MIRROR}/openobex/obexftp-${PV}.tar.gz \ - file://i-hate-libtool.patch;patch=1 \ + file://iconv.patch;patch=1 \ + file://i-hate-libtool.patch;patch=1 \ file://m4.patch;patch=1" inherit autotools -- cgit v1.2.3 From d30b363d49b7f9a3c9b734dcae4f7562c3a99357 Mon Sep 17 00:00:00 2001 From: Henning Heinold Date: Fri, 6 Jul 2007 16:44:23 +0000 Subject: Simpad updates taken from http://slackpad.svn.sourceforge.net/viewvc/slackpad/trunk/SIMpad-Kernel-2.6/2.6.21/patches/ amd tweaking the defconfig a little bit --- packages/linux/linux/simpad/defconfig | 98 ++++-- .../simpad/linux-2.6.21-SIMpad-cs3-simpad.patch | 333 +++++++-------------- .../linux-2.6.21-SIMpad-serial-and-gpio_keys.patch | 194 ------------ .../linux-2.6.21-SIMpad-ucb1x00-switches.patch | 222 ++++++++++++-- ...x-2.6.21-pcmcia-device-to-platform-driver.patch | 54 ---- packages/linux/linux_2.6.21.bb | 11 +- 6 files changed, 379 insertions(+), 533 deletions(-) delete mode 100644 packages/linux/linux/simpad/linux-2.6.21-SIMpad-serial-and-gpio_keys.patch delete mode 100644 packages/linux/linux/simpad/linux-2.6.21-pcmcia-device-to-platform-driver.patch diff --git a/packages/linux/linux/simpad/defconfig b/packages/linux/linux/simpad/defconfig index 36d5e942b4..279847c763 100644 --- a/packages/linux/linux/simpad/defconfig +++ b/packages/linux/linux/simpad/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.21 -# Sun May 6 14:01:42 2007 +# Tue Jul 3 21:29:59 2007 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -38,15 +38,16 @@ CONFIG_LOCALVERSION="oe1" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y -# CONFIG_IPC_NS is not set +CONFIG_IPC_NS=y CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y # CONFIG_TASKSTATS is not set # CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set -CONFIG_SYSFS_DEPRECATED=y +# CONFIG_SYSFS_DEPRECATED is not set # CONFIG_RELAY is not set # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -76,8 +77,9 @@ CONFIG_BASE_SMALL=0 # Loadable module support # CONFIG_MODULES=y -# CONFIG_MODULE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y @@ -186,7 +188,7 @@ CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set CONFIG_PCMCIA=y CONFIG_PCMCIA_LOAD_CIS=y -CONFIG_PCMCIA_IOCTL=y +# CONFIG_PCMCIA_IOCTL is not set # # PC-card bridges @@ -225,7 +227,7 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="mtdparts=sa1100:512k(boot),1m(kernel),-(root) console=ttySA0 root=1f02 noinitrd mem=64M jffs2_orphaned_inodes=delete rootfstype=jffs2" +CONFIG_CMDLINE="" # CONFIG_XIP_KERNEL is not set # CONFIG_KEXEC is not set @@ -257,10 +259,10 @@ CONFIG_BINFMT_MISC=m # Power management options # CONFIG_PM=y -# CONFIG_PM_LEGACY is not set +CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # CONFIG_PM_SYSFS_DEPRECATED is not set -# CONFIG_APM_EMULATION is not set +CONFIG_APM_EMULATION=y # # Networking @@ -587,10 +589,10 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 # Network device support # CONFIG_NETDEVICES=y -CONFIG_DUMMY=y +CONFIG_DUMMY=m # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set +CONFIG_TUN=m # # ARCnet devices @@ -674,12 +676,12 @@ CONFIG_NET_WIRELESS=y CONFIG_NET_PCMCIA=y CONFIG_PCMCIA_3C589=m CONFIG_PCMCIA_3C574=m -# CONFIG_PCMCIA_FMVJ18X is not set +CONFIG_PCMCIA_FMVJ18X=m CONFIG_PCMCIA_PCNET=m -# CONFIG_PCMCIA_NMCLAN is not set +CONFIG_PCMCIA_NMCLAN=m CONFIG_PCMCIA_SMC91C92=m CONFIG_PCMCIA_XIRC2PS=m -# CONFIG_PCMCIA_AXNET is not set +CONFIG_PCMCIA_AXNET=m # # Wan interfaces @@ -692,7 +694,7 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set +CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set CONFIG_SLHC=m @@ -734,13 +736,14 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_STOWAWAY is not set +CONFIG_KEYBOARD_NEWTON=m +CONFIG_KEYBOARD_STOWAWAY=m CONFIG_KEYBOARD_GPIO=y # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set +CONFIG_INPUT_MISC=y +CONFIG_INPUT_UINPUT=m # # Hardware I/O ports @@ -960,6 +963,7 @@ CONFIG_USB_ARCH_HAS_HCD=y # # MMC/SD Card support # +# CONFIG_MMC_SPI_BLOCK is not set # CONFIG_MMC is not set # @@ -987,7 +991,7 @@ CONFIG_REISERFS_FS=m CONFIG_REISERFS_PROC_INFO=y # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set +CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set # CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set @@ -1000,6 +1004,7 @@ CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set +CONFIG_GENERIC_ACL=y # # CD-ROM/DVD Filesystems @@ -1023,7 +1028,8 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_PROC_FS=y CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y -# CONFIG_TMPFS is not set +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # CONFIG_CONFIGFS_FS is not set @@ -1072,7 +1078,12 @@ CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set -# CONFIG_CIFS is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -1184,7 +1195,46 @@ CONFIG_DEBUG_LL=y # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_MANAGER=m +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +CONFIG_CRYPTO_SHA1=m +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_GF128MUL is not set +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_PCBC=m +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_TEA is not set +CONFIG_CRYPTO_ARC4=m +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# # # Library routines diff --git a/packages/linux/linux/simpad/linux-2.6.21-SIMpad-cs3-simpad.patch b/packages/linux/linux/simpad/linux-2.6.21-SIMpad-cs3-simpad.patch index 6d6c373271..cfb9aad906 100644 --- a/packages/linux/linux/simpad/linux-2.6.21-SIMpad-cs3-simpad.patch +++ b/packages/linux/linux/simpad/linux-2.6.21-SIMpad-cs3-simpad.patch @@ -1,6 +1,6 @@ diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/Makefile linux-2.6.21/arch/arm/mach-sa1100/Makefile ---- linux-2.6.21.vanilla/arch/arm/mach-sa1100/Makefile 2007-05-01 16:40:44.000000000 +0200 -+++ linux-2.6.21/arch/arm/mach-sa1100/Makefile 2007-05-01 16:52:10.000000000 +0200 +--- linux-2.6.21.vanilla/arch/arm/mach-sa1100/Makefile 2007-05-29 21:34:59.000000000 +0200 ++++ linux-2.6.21/arch/arm/mach-sa1100/Makefile 2007-05-30 17:44:04.000000000 +0200 @@ -40,6 +40,7 @@ obj-$(CONFIG_SA1100_SHANNON) += shannon.o @@ -11,10 +11,10 @@ diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/Makefile linux-2.6.21/arch/a # LEDs support diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/cs3-simpad.c linux-2.6.21/arch/arm/mach-sa1100/cs3-simpad.c --- linux-2.6.21.vanilla/arch/arm/mach-sa1100/cs3-simpad.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.21/arch/arm/mach-sa1100/cs3-simpad.c 2007-05-01 16:52:10.000000000 +0200 -@@ -0,0 +1,300 @@ ++++ linux-2.6.21/arch/arm/mach-sa1100/cs3-simpad.c 2007-05-30 17:45:51.000000000 +0200 +@@ -0,0 +1,169 @@ +/* -+ * cs3-simpad.c ++ * simpad-cs3.c + * + * This driver shows the GPIO states of the cs3 latch. You can also + * switch some GPIOS. @@ -25,6 +25,9 @@ diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/cs3-simpad.c linux-2.6.21/ar + * + * Some parts are based on battery.c + * ++ * mrdata: -added cs3_ro support ++ * -added preprocessor stuff ++ * + */ + +#include @@ -34,245 +37,97 @@ diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/cs3-simpad.c linux-2.6.21/ar + +#include + ++extern long get_cs3_ro(void); +extern long get_cs3_shadow(void); +extern void set_cs3_bit(int value); +extern void clear_cs3_bit(int value); + +struct cs3 { -+ struct class_device class_dev; -+ const char *name; -+ char *id; -+ int type; ++ struct class_device class_dev; ++ const char *name; ++ char *id; ++ int type; +}; + +struct cs3 cs3 ={ + .name = "latch_cs3", +}; + -+static ssize_t get_VCC_5V_EN (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & VCC_5V_EN ) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_VCC_3V_EN (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & VCC_3V_EN) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_EN1 (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & EN1) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_EN0 (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & EN0) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_DISPLAY_ON (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & DISPLAY_ON) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_PCMCIA_BUFF_DIS (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & PCMCIA_BUFF_DIS) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_MQ_RESET (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & MQ_RESET) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_PCMCIA_RESET (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & PCMCIA_RESET) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_DECT_POWER_ON (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & DECT_POWER_ON) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_IRDA_SD (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & IRDA_SD) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_RS232_ON (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & RS232_ON) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_SD_MEDIAQ (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & SD_MEDIAQ) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_LED2_ON (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & LED2_ON) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_IRDA_MODE (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & IRDA_MODE) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_ENABLE_5V (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & ENABLE_5V) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+static ssize_t get_RESET_SIMCARD (struct class_device *class_dev, char *buf) { -+ if (get_cs3_shadow() & RESET_SIMCARD) -+ return sprintf(buf, "1\n"); -+ else -+ return sprintf(buf, "0\n"); -+} -+ -+ -+static ssize_t write_DISPLAY_ON (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(DISPLAY_ON); -+ else if (val=='0') -+ clear_cs3_bit(DISPLAY_ON); -+ return strlen(buf); -+} -+ -+static ssize_t write_DECT_POWER_ON (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(DECT_POWER_ON); -+ else if (val=='0') -+ clear_cs3_bit(DECT_POWER_ON); -+ return strlen(buf); -+} -+ -+static ssize_t write_IRDA_SD (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(IRDA_SD); -+ else if (val=='0') -+ clear_cs3_bit(IRDA_SD); -+ return strlen(buf); -+} -+ -+static ssize_t write_SD_MEDIAQ (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(SD_MEDIAQ); -+ else if (val=='0') -+ clear_cs3_bit(SD_MEDIAQ); -+ return strlen(buf); -+} -+ -+static ssize_t write_LED2_ON (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(LED2_ON); -+ else if (val=='0') -+ clear_cs3_bit(LED2_ON); -+ return strlen(buf); -+} -+ -+static ssize_t write_IRDA_MODE (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(IRDA_MODE); -+ else if (val=='0') -+ clear_cs3_bit(IRDA_MODE); -+ return strlen(buf); -+} + -+static ssize_t write_RESET_SIMCARD (struct class_device *cdev, const char * buf, size_t count){ -+ char val; -+ if (sscanf(buf, "%c",&val) !=1) -+ return -EINVAL; -+ if (val=='1') -+ set_cs3_bit(RESET_SIMCARD); -+ else if (val=='0') -+ clear_cs3_bit(RESET_SIMCARD); -+ return strlen(buf); ++#define CS3_STORE_ATTR(namek,nameg) \ ++static ssize_t namek##_store (struct class_device *cdev, const char * buf, size_t count) \ ++{ \ ++ char val; \ ++ if (sscanf(buf, "%c",&val) != 1) \ ++ return -EINVAL; \ ++ if (val == '1') \ ++ set_cs3_bit(nameg); \ ++ else if (val == '0') \ ++ clear_cs3_bit(nameg); \ ++ return strlen(buf); \ +} + -+static CLASS_DEVICE_ATTR(vcc_5v_en, 0444, get_VCC_5V_EN, NULL); -+static CLASS_DEVICE_ATTR(vcc_3v_en, 0444, get_VCC_3V_EN, NULL); -+static CLASS_DEVICE_ATTR(en1, 0444, get_EN1, NULL); -+static CLASS_DEVICE_ATTR(en0, 0444, get_EN0, NULL); -+static CLASS_DEVICE_ATTR(display_on, 0664, get_DISPLAY_ON, write_DISPLAY_ON); -+static CLASS_DEVICE_ATTR(pcmcia_buff_dis, 0444, get_PCMCIA_BUFF_DIS, NULL); -+static CLASS_DEVICE_ATTR(mq_reset, 0444, get_MQ_RESET, NULL); -+static CLASS_DEVICE_ATTR(pcmcia_reset, 0444, get_PCMCIA_RESET, NULL); -+static CLASS_DEVICE_ATTR(dect_power_on, 0664, get_DECT_POWER_ON, write_DECT_POWER_ON); -+static CLASS_DEVICE_ATTR(irda_sd, 0664, get_IRDA_SD, write_IRDA_SD); -+static CLASS_DEVICE_ATTR(rs232_on, 0444, get_RS232_ON, NULL); -+static CLASS_DEVICE_ATTR(sd_mediaq, 0664, get_SD_MEDIAQ, write_SD_MEDIAQ); -+static CLASS_DEVICE_ATTR(led2_on, 0664, get_LED2_ON, write_LED2_ON); -+static CLASS_DEVICE_ATTR(irda_mode, 0664, get_IRDA_MODE, write_IRDA_MODE); -+static CLASS_DEVICE_ATTR(enable_5v, 0444, get_ENABLE_5V, NULL); -+static CLASS_DEVICE_ATTR(reset_simcard, 0664, get_RESET_SIMCARD, write_RESET_SIMCARD); ++CS3_STORE_ATTR(display_on, DISPLAY_ON); ++CS3_STORE_ATTR(dect_power_on, DECT_POWER_ON); ++CS3_STORE_ATTR(irda_sd, IRDA_SD); ++CS3_STORE_ATTR(sd_mediaq, SD_MEDIAQ); ++CS3_STORE_ATTR(led2_on, LED2_ON); ++CS3_STORE_ATTR(irda_mode, IRDA_MODE); ++CS3_STORE_ATTR(reset_simcard, RESET_SIMCARD); ++ ++ ++#define CS3_ATTR(shadro,namek,nameg,mode,store) \ ++static ssize_t namek##_show(struct class_device *class_dev, char *buf) \ ++{ \ ++ if (get_cs3_##shadro() & nameg ) \ ++ return sprintf(buf, "1\n"); \ ++ else \ ++ return sprintf(buf, "0\n"); \ ++} \ ++static CLASS_DEVICE_ATTR(namek, mode, namek##_show, store) ++ ++CS3_ATTR(shadow, vcc_5v_en, VCC_5V_EN, 0444, NULL); ++CS3_ATTR(shadow, vcc_3v_en, VCC_3V_EN, 0444, NULL); ++CS3_ATTR(shadow, en1, EN1, 0444, NULL); ++CS3_ATTR(shadow, en0, EN0, 0444, NULL); ++CS3_ATTR(shadow, display_on, DISPLAY_ON, 0664, display_on_store); ++CS3_ATTR(shadow, pcmcia_buff_dis, PCMCIA_BUFF_DIS, 0444, NULL); ++CS3_ATTR(shadow, mq_reset, MQ_RESET, 0444, NULL); ++CS3_ATTR(shadow, pcmcia_reset, PCMCIA_RESET, 0444, NULL); ++CS3_ATTR(shadow, dect_power_on, DECT_POWER_ON, 0664, dect_power_on_store); ++CS3_ATTR(shadow, irda_sd, IRDA_SD, 0664, irda_sd_store); ++CS3_ATTR(shadow, rs232_on, RS232_ON, 0444, NULL); ++CS3_ATTR(shadow, sd_mediaq, SD_MEDIAQ, 0664, sd_mediaq_store); ++CS3_ATTR(shadow, led2_on, LED2_ON, 0664, led2_on_store); ++CS3_ATTR(shadow, irda_mode, IRDA_MODE, 0664, irda_mode_store); ++CS3_ATTR(shadow, enable_5v, ENABLE_5V, 0444, NULL); ++CS3_ATTR(shadow, reset_simcard, RESET_SIMCARD, 0664, reset_simcard_store); ++CS3_ATTR(ro, pcmcia_bvd1, PCMCIA_BVD1, 0444, NULL); ++CS3_ATTR(ro, pcmcia_bvd2, PCMCIA_BVD2, 0444, NULL); ++CS3_ATTR(ro, pcmcia_vs1, PCMCIA_VS1, 0444, NULL); ++CS3_ATTR(ro, pcmcia_vs2, PCMCIA_VS2, 0444, NULL); ++CS3_ATTR(ro, lock_ind, LOCK_IND, 0444, NULL); ++CS3_ATTR(ro, charging_state, CHARGING_STATE, 0444, NULL); ++CS3_ATTR(ro, pcmcia_short, PCMCIA_SHORT, 0444, NULL); + +static struct class simpad_gpios_class = { -+ .name = "simpad" ++ .name = "simpad", +}; + -+#define create_entry_conditional(name) \ -+ rc = class_device_create_file(&cs3->class_dev, &class_device_attr_##name); \ -+ if (rc) goto out; \ ++#define create_entry_conditional(namek) \ ++ rc = class_device_create_file(&cs3->class_dev, &class_device_attr_##namek); \ ++ if (rc) goto out; \ + -+static int register_cs3_latch(struct cs3 *cs3){ ++static int register_cs3_latch(struct cs3 *cs3) ++{ + int rc = 0; -+ cs3->class_dev.class = &simpad_gpios_class; -+ strcpy(cs3->class_dev.class_id, cs3->name); -+ rc = class_device_register(&cs3->class_dev); -+ if(rc) -+ goto out; ++ cs3->class_dev.class = &simpad_gpios_class; ++ strcpy(cs3->class_dev.class_id, cs3->name); ++ rc = class_device_register(&cs3->class_dev); ++ if(rc) ++ goto out; + -+ create_entry_conditional(vcc_5v_en); ++ create_entry_conditional(vcc_5v_en); + create_entry_conditional(vcc_3v_en); + create_entry_conditional(en1); + create_entry_conditional(en0); @@ -288,28 +143,42 @@ diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/cs3-simpad.c linux-2.6.21/ar + create_entry_conditional(irda_mode); + create_entry_conditional(enable_5v); + create_entry_conditional(reset_simcard); -+ ++ create_entry_conditional(pcmcia_bvd1); ++ create_entry_conditional(pcmcia_bvd2); ++ create_entry_conditional(pcmcia_vs1); ++ create_entry_conditional(pcmcia_vs2); ++ create_entry_conditional(lock_ind); ++ create_entry_conditional(charging_state); ++ create_entry_conditional(pcmcia_short); ++ +out: + return rc; +} + +static int __init simpad_gpios_class_init(void) +{ -+ if (class_register(&simpad_gpios_class) != 0) -+ printk(KERN_ERR "cs3 latch class failed " -+ "to register properly\n"); -+ register_cs3_latch(&cs3); -+ return 0; ++ int rc = 0; ++ ++ rc = class_register(&simpad_gpios_class); ++ ++ if(rc != 0) ++ { ++ printk(KERN_ERR "cs3 latch class failed to register properly\n"); ++ return rc; ++ } ++ ++ rc = register_cs3_latch(&cs3); ++ return rc; +} + +static void __exit simpad_gpios_class_exit(void) +{ -+ class_unregister(&simpad_gpios_class); ++ class_unregister(&simpad_gpios_class); +} + +module_init(simpad_gpios_class_init); +module_exit(simpad_gpios_class_exit); -+ -+MODULE_DESCRIPTION("CS3_latch driver"); ++ +MODULE_AUTHOR("Bernhard Guillon"); ++MODULE_DESCRIPTION("CS3_latch driver"); +MODULE_LICENSE("GPL"); diff --git a/packages/linux/linux/simpad/linux-2.6.21-SIMpad-serial-and-gpio_keys.patch b/packages/linux/linux/simpad/linux-2.6.21-SIMpad-serial-and-gpio_keys.patch deleted file mode 100644 index 90ce4cb009..0000000000 --- a/packages/linux/linux/simpad/linux-2.6.21-SIMpad-serial-and-gpio_keys.patch +++ /dev/null @@ -1,194 +0,0 @@ -diff -uNr linux-2.6.21.vanilla/arch/arm/mach-sa1100/simpad.c linux-2.6.21/arch/arm/mach-sa1100/simpad.c ---- linux-2.6.21.vanilla/arch/arm/mach-sa1100/simpad.c 2007-05-01 16:40:44.000000000 +0200 -+++ linux-2.6.21/arch/arm/mach-sa1100/simpad.c 2007-05-01 19:23:29.000000000 +0200 -@@ -1,5 +1,14 @@ - /* - * linux/arch/arm/mach-sa1100/simpad.c -+ * -+ * 2007/04/11 mrdata: -+ * - insert simpad_uart_set_mctrl() -+ * simpad_uart_get_mctrl() -+ * - internal RS232/DECT/Bluetooth -+ * works again (based on 2.4 simpad-serial.patch) -+ * -+ * 2007/04/12 Bernhard Guillon: -+ * -added gpio_keys (based on h3000.c from hh.org) - */ - - #include -@@ -27,6 +36,8 @@ - - #include - #include -+#include -+#include - #include - - #include "generic.h" -@@ -55,6 +66,7 @@ - *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow; - } - -+EXPORT_SYMBOL(get_cs3_shadow); - EXPORT_SYMBOL(set_cs3_bit); - EXPORT_SYMBOL(clear_cs3_bit); - -@@ -73,23 +85,71 @@ - }; - - -+static void simpad_uart_set_mctrl(struct uart_port *port, u_int mctrl) -+{ -+ if (port->mapbase == _Ser1UTCR0) { -+ /* internal serial port (ttySA1, DECT/Bluetooth) */ -+ if (mctrl & TIOCM_RTS) GPCR = GPIO_UART1_RTS; -+ else GPSR = GPIO_UART1_RTS; -+ -+ if (mctrl & TIOCM_DTR) GPCR = GPIO_UART1_DTR; -+ else GPSR = GPIO_UART1_DTR; -+ } -+ -+ else if (port->mapbase == _Ser3UTCR0) { -+ /* external serial port (ttySA0, RS232) */ -+ if (mctrl & TIOCM_RTS) GPCR = GPIO_UART3_RTS; -+ else GPSR = GPIO_UART3_RTS; -+ -+ if (mctrl & TIOCM_DTR) GPCR = GPIO_UART3_DTR; -+ else GPSR = GPIO_UART3_DTR; -+ } -+} -+ -+ -+static u_int simpad_uart_get_mctrl(struct uart_port *port) -+{ -+ u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR; -+ -+ if (port->mapbase == _Ser1UTCR0) { -+ /* internal serial port (ttySA1, DECT/Bluetooth) */ -+ int gplr = GPLR; -+ if (gplr & GPIO_UART1_DCD) ret &= ~TIOCM_CD; -+ if (gplr & GPIO_UART1_CTS) ret &= ~TIOCM_CTS; -+ if (gplr & GPIO_UART1_DSR) ret &= ~TIOCM_DSR; -+ } -+ -+ else if (port->mapbase == _Ser3UTCR0) { -+ /* external serial port (ttySA0, RS232) */ -+ int gplr = GPLR; -+ if (gplr & GPIO_UART3_DCD) ret &= ~TIOCM_CD; -+ if (gplr & GPIO_UART3_CTS) ret &= ~TIOCM_CTS; -+ if (gplr & GPIO_UART3_DSR) ret &= ~TIOCM_DSR; -+ } -+ return ret; -+} -+ -+ - static void simpad_uart_pm(struct uart_port *port, u_int state, u_int oldstate) - { -- if (port->mapbase == (u_int)&Ser1UTCR0) { -- if (state) -- { -- clear_cs3_bit(RS232_ON); -- clear_cs3_bit(DECT_POWER_ON); -- }else -- { -- set_cs3_bit(RS232_ON); -- set_cs3_bit(DECT_POWER_ON); -- } -- } -+ if (port->mapbase == (u_int)&Ser3UTCR0) { -+ if (state) -+ { -+ clear_cs3_bit(RS232_ON); -+ /* clear_cs3_bit(DECT_POWER_ON); */ -+ }else -+ { -+ set_cs3_bit(RS232_ON); -+ /* set_cs3_bit(DECT_POWER_ON); */ -+ } -+ } - } - -+ - static struct sa1100_port_fns simpad_port_fns __initdata = { -- .pm = simpad_uart_pm, -+ .set_mctrl = simpad_uart_set_mctrl, -+ .get_mctrl = simpad_uart_get_mctrl, -+ .pm = simpad_uart_pm, - }; - - -@@ -150,7 +210,7 @@ - sa1100_register_uart(0, 3); /* serial interface */ - sa1100_register_uart(1, 1); /* DECT */ - -- // Reassign UART 1 pins -+ /* Reassign UART 1 pins */ - GAFR |= GPIO_UART_TXD | GPIO_UART_RXD; - GPDR |= GPIO_UART_TXD | GPIO_LDD13 | GPIO_LDD15; - GPDR &= ~GPIO_UART_RXD; -@@ -173,7 +233,7 @@ - - static void simpad_power_off(void) - { -- local_irq_disable(); // was cli -+ local_irq_disable(); /* was cli */ - set_cs3(0x800); /* only SD_MEDIAQ */ - - /* disable internal oscillator, float CS lines */ -@@ -197,19 +257,42 @@ - - - /* -+ * gpio_keys -+*/ -+ -+static struct gpio_keys_button simpad_button_table[] = { -+ { KEY_POWER, IRQ_GPIO_POWER_BUTTON, 0, "power button" }, -+}; -+ -+static struct gpio_keys_platform_data simpad_keys_data = { -+ .buttons = simpad_button_table, -+ .nbuttons = ARRAY_SIZE(simpad_button_table), -+}; -+ -+static struct platform_device simpad_keys = { -+ .name = "gpio-keys", -+ .dev = { -+ .platform_data = &simpad_keys_data, -+ }, -+}; -+ -+ -+/* - * MediaQ Video Device - */ -+ - static struct platform_device simpad_mq200fb = { - .name = "simpad-mq200", - .id = 0, - }; - -+ - static struct platform_device *devices[] __initdata = { -- &simpad_mq200fb -+ &simpad_keys, -+ &simpad_mq200fb, - }; - - -- - static int __init simpad_init(void) - { - int ret; -diff -uNr linux-2.6.21.vanilla/include/asm-arm/arch-sa1100/simpad.h linux-2.6.21/include/asm-arm/arch-sa1100/simpad.h ---- linux-2.6.21.vanilla/include/asm-arm/arch-sa1100/simpad.h 2007-05-01 16:40:51.000000000 +0200 -+++ linux-2.6.21/include/asm-arm/arch-sa1100/simpad.h 2007-05-01 19:22:45.000000000 +0200 -@@ -12,7 +12,7 @@ - #define __ASM_ARCH_SIMPAD_H - - --#define GPIO_UART1_RTS GPIO_GPIO14 -+#define GPIO_UART1_RTS GPIO_GPIO9 - #define GPIO_UART1_DTR GPIO_GPIO7 - #define GPIO_UART1_CTS GPIO_GPIO8 - #define GPIO_UART1_DCD GPIO_GPIO23 diff --git a/packages/linux/linux/simpad/linux-2.6.21-SIMpad-ucb1x00-switches.patch b/packages/linux/linux/simpad/linux-2.6.21-SIMpad-ucb1x00-switches.patch index ff2f50566c..552bb8b223 100644 --- a/packages/linux/linux/simpad/linux-2.6.21-SIMpad-ucb1x00-switches.patch +++ b/packages/linux/linux/simpad/linux-2.6.21-SIMpad-ucb1x00-switches.patch @@ -1,6 +1,6 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/Kconfig linux-2.6.21/drivers/mfd/Kconfig ---- linux-2.6.21.vanilla/drivers/mfd/Kconfig 2007-05-01 16:40:45.000000000 +0200 -+++ linux-2.6.21/drivers/mfd/Kconfig 2007-05-01 16:55:38.000000000 +0200 +--- linux-2.6.21.vanilla/drivers/mfd/Kconfig 2007-04-26 05:08:32.000000000 +0200 ++++ linux-2.6.21/drivers/mfd/Kconfig 2007-05-29 12:56:32.000000000 +0200 @@ -37,4 +37,7 @@ tristate "Touchscreen interface support" depends on MCP_UCB1200 && INPUT @@ -10,8 +10,8 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/Kconfig linux-2.6.21/drivers/mfd/Kcon + depends on MCP_UCB1200 && INPUT endmenu diff -uNr linux-2.6.21.vanilla/drivers/mfd/Makefile linux-2.6.21/drivers/mfd/Makefile ---- linux-2.6.21.vanilla/drivers/mfd/Makefile 2007-05-01 16:40:45.000000000 +0200 -+++ linux-2.6.21/drivers/mfd/Makefile 2007-05-01 16:55:38.000000000 +0200 +--- linux-2.6.21.vanilla/drivers/mfd/Makefile 2007-04-26 05:08:32.000000000 +0200 ++++ linux-2.6.21/drivers/mfd/Makefile 2007-05-29 12:56:32.000000000 +0200 @@ -8,7 +8,7 @@ obj-$(CONFIG_MCP_SA11X0) += mcp-sa11x0.o obj-$(CONFIG_MCP_UCB1200) += ucb1x00-core.o @@ -21,10 +21,10 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/Makefile linux-2.6.21/drivers/mfd/Mak ifeq ($(CONFIG_SA1100_ASSABET),y) obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o endif -diff -uNr linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.21/drivers/mfd/ucb1x00-switches.c ---- linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.21/drivers/mfd/ucb1x00-switches.c 2007-05-01 16:55:38.000000000 +0200 -@@ -0,0 +1,162 @@ +diff -Naur linux-2.6.21/drivers/mfd.old/ucb1x00-switches.c linux-2.6.21/drivers/mfd/ucb1x00-switches.c +--- linux-2.6.21/drivers/mfd/ucb1x00-switches.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.21/drivers/mfd/ucb1x00-switches.c 2007-07-04 23:59:39.000000000 +0200 +@@ -0,0 +1,332 @@ +/* + * linux/drivers/mfd/ucb1x00-switches.c + * @@ -42,48 +42,166 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.21/drive + * This driver is based on the 2.4 ucb1x00-switches, the 2.6 ucb1x00-assabet + * and the ucb1x00-ts driver. + * ++ * 2007/06/21 mrdata: ++ * - create new thread kswd() to handle irq_events for ucb1300-gpio's ++ * - found out, that not every key-press or key-release ++ * generate a irq_event ++ * -> establish key_state handling ++ * key_state, key_state_last <-> KEY_PRESS, KEY_RELEASE ++ * -> after irq_event polling the ucb1300-gpio's till all keys ++ * in key_state = KEY_RELEASE ++ * + */ +#include +#include +#include +#include ++#include ++#include ++#include + +#include + +#include "ucb1x00.h" + ++#define KEY_PRESS 1 ++#define KEY_RELEASE 0 ++ +static int key [6] = { KEY_PROG1,KEY_PROG2,KEY_UP,KEY_DOWN,KEY_LEFT,KEY_RIGHT }; + ++static unsigned short int key_state [6] = { 0, 0, 0, 0, 0, 0}; ++static unsigned short int key_state_last [6] = { 1, 1, 1, 1, 1, 1}; ++ +struct ucb1x00_switches { + struct input_dev *idev; + struct ucb1x00 *ucb; ++ ++ wait_queue_head_t irq_wait; ++ struct task_struct *rtask; ++ ++ int idx; ++ ++ unsigned int valid:1; +}; + -+static void ucb1x00_dev_irq(int idx, void *id) ++static int ucb1x00_thread(void *_switches_id) +{ -+ static unsigned short int last; -+ unsigned short int this; -+ struct ucb1x00_switches *switches = id; ++ unsigned short int this; ++ int idx_tmp; ++ int i; ++ struct ucb1x00_switches *switches = _switches_id; + struct input_dev *idev = switches->idev; ++ struct task_struct *tsk = current; ++ DECLARE_WAITQUEUE(wait, tsk); + -+ ucb1x00_enable(switches->ucb); ++ add_wait_queue(&switches->irq_wait, &wait); + -+ this=~ucb1x00_io_read(switches->ucb); -+ if (this==last) { -+ return; -+ } ++ while (!kthread_should_stop()) ++ { ++ signed long timeout; ++ ++ if ((switches->idx >= 0) && (switches->idx <= 5) && (switches->valid == 1)) ++ { ++ switches->valid = 0; ++ ++ idx_tmp = switches->idx; ++ ++ ucb1x00_enable(switches->ucb); ++ ++ this = ~ucb1x00_io_read(switches->ucb); + -+ last=this; ++ ucb1x00_disable(switches->ucb); ++ ++ if (key_state[idx_tmp] == KEY_RELEASE) ++ { ++ key_state_last[idx_tmp] = KEY_RELEASE; ++ key_state[idx_tmp] = KEY_PRESS; + -+ if ((idx >=0) && (idx <=5)) { -+ if ((this & (1<ucb); ++ this = ~ucb1x00_io_read(switches->ucb); ++ ucb1x00_disable(switches->ucb); ++ ++ for (i = 0; i < 6; i++) ++ { ++ if ((key_state[i] == KEY_PRESS) && (((this & (1 << i)) ? 1 : 0) == KEY_RELEASE)) ++ { ++ key_state_last[i] = KEY_PRESS; ++ key_state[i] = KEY_RELEASE; ++ ++ input_report_key(idev, key[i], KEY_RELEASE); ++ input_sync(idev); ++ } ++ ++ if ((key_state[i] == KEY_RELEASE) && (((this & (1 << i)) ? 1 : 0) == KEY_PRESS)) ++ { ++ key_state_last[i] = KEY_RELEASE; ++ key_state[i] = KEY_PRESS; ++ ++ input_report_key(idev, key[i], KEY_PRESS); ++ input_sync(idev); ++ } ++ ++ } ++ ++ // left loop, if no key press detect ++ if ((this | 0xff80) == 0xff80) ++ { ++ break; ++ } ++ ++ set_task_state(tsk, TASK_INTERRUPTIBLE); ++ ++ try_to_freeze(); ++ ++ timeout = HZ / 100; ++ ++ schedule_timeout(timeout); ++ } ++ } ++ ++ set_task_state(tsk, TASK_INTERRUPTIBLE); ++ ++ try_to_freeze(); ++ ++ timeout = MAX_SCHEDULE_TIMEOUT; ++ ++ schedule_timeout(timeout); + } -+ else { -+ printk(KERN_DEBUG "switches-ucb1x00 is BUGGY!!! \n"); -+ return; -+ } + ++ remove_wait_queue(&switches->irq_wait, &wait); ++ ++ switches->rtask = NULL; ++ ++ return 0; ++} ++ ++ ++static void ucb1x00_dev_irq(int idx, void *id) ++{ ++ struct ucb1x00_switches *switches = id; ++ ++ switches->idx = idx; ++ switches->valid = 1; ++ ++ wake_up(&switches->irq_wait); +} + +static int ucb1x00_switches_add(struct ucb1x00_dev *dev) @@ -121,6 +239,10 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.21/drive + switches->idev = idev; + dev->priv = switches; + ++ BUG_ON(switches->rtask); ++ ++ init_waitqueue_head(&switches->irq_wait); ++ + ucb1x00_enable(switches->ucb); + + ucb1x00_io_set_dir(switches->ucb, @@ -132,14 +254,37 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.21/drive + + for (i = 0; i < 6; ++i) { + ucb1x00_enable_irq(switches->ucb, i, UCB_RISING | UCB_FALLING); ++ + if (ucb1x00_hook_irq(switches->ucb, i, ucb1x00_dev_irq, switches) < 0) { + printk(KERN_ERR "unable to hook IRQ for " + "UCB1300 SWITCH_%d\n", i); + return -EBUSY; + } + } ++ ++ switches->rtask = kthread_run(ucb1x00_thread, switches, "kswd"); ++ if (!IS_ERR(switches->rtask)) ++ { ++ return 0; ++ } ++ else ++ { ++ input_unregister_device(switches->idev); + -+ return 0; ++ for (i = 5; i >= 0; --i) { ++ ucb1x00_disable_irq(switches->ucb, i, UCB_RISING | UCB_FALLING); ++ ++ /* Only error conditions are ENOENT and EINVAL; silently ++ * ignore: ++ */ ++ ucb1x00_free_irq(switches->ucb, i, NULL); ++ } ++ switches->rtask = NULL; ++ ucb1x00_disable(switches->ucb); ++ kfree(switches); ++ ++ return -EFAULT; ++ } + +fail: + input_free_device(idev); @@ -152,6 +297,12 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.21/drive +{ + int i; + struct ucb1x00_switches *switches = dev->priv; ++ ++ if (switches->rtask) ++ kthread_stop(switches->rtask); ++ ++ switches->rtask = NULL; ++ + input_unregister_device(switches->idev); + + for (i = 5; i >= 0; --i) { @@ -166,9 +317,28 @@ diff -uNr linux-2.6.21.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.21/drive + kfree(switches); +} + ++#ifdef CONFIG_PM ++static int ucb1x00_switches_resume(struct ucb1x00_dev *dev) ++{ ++ struct ucb1x00_switches *switches = dev->priv; ++ ++ if (switches->rtask != NULL) ++ { ++ switches->valid = 0; ++ wake_up(&switches->irq_wait); ++ ++ printk(KERN_DEBUG "ucb1x00-switches.c -> _switches_resume() kswd - restart *DONE*\n"); ++ } ++ return 0; ++} ++#else ++#define ucb1x00_switches_resume NULL ++#endif ++ +static struct ucb1x00_driver ucb1x00_switches_driver = { + .add = ucb1x00_switches_add, + .remove = ucb1x00_switches_remove, ++ .resume = ucb1x00_switches_resume, +}; + +static int __init ucb1x00_switches_init(void) diff --git a/packages/linux/linux/simpad/linux-2.6.21-pcmcia-device-to-platform-driver.patch b/packages/linux/linux/simpad/linux-2.6.21-pcmcia-device-to-platform-driver.patch deleted file mode 100644 index e6233cbe30..0000000000 --- a/packages/linux/linux/simpad/linux-2.6.21-pcmcia-device-to-platform-driver.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff -uNr linux-2.6.21.vanilla/drivers/pcmcia/sa1100_generic.c linux-2.6.21/drivers/pcmcia/sa1100_generic.c ---- linux-2.6.21.vanilla/drivers/pcmcia/sa1100_generic.c 2007-05-01 16:40:46.000000000 +0200 -+++ linux-2.6.21/drivers/pcmcia/sa1100_generic.c 2007-05-01 19:38:05.000000000 +0200 -@@ -28,6 +28,9 @@ - the provisions above, a recipient may use your version of this - file under either the MPL or the GPL. - -+ 2007 mrnice: added thesings changes from device_driver -+ to platform_driver - many thx to thesing -+ - ======================================================================*/ - - #include -@@ -81,13 +84,15 @@ - return ret; - } - --static struct device_driver sa11x0_pcmcia_driver = { -- .probe = sa11x0_drv_pcmcia_probe, -- .remove = soc_common_drv_pcmcia_remove, -- .name = "sa11x0-pcmcia", -- .bus = &platform_bus_type, -- .suspend = pcmcia_socket_dev_suspend, -- .resume = pcmcia_socket_dev_resume, -+static struct platform_driver sa11x0_pcmcia_driver = { -+ .driver = { -+ .name = "sa11x0-pcmcia", -+ .probe = sa11x0_drv_pcmcia_probe, -+ .remove = soc_common_drv_pcmcia_remove, -+ .suspend= pcmcia_socket_dev_suspend, -+ .resume = pcmcia_socket_dev_resume, -+ //.bus = &platform_bus_type, -+ }, - }; - - /* sa11x0_pcmcia_init() -@@ -100,7 +105,7 @@ - */ - static int __init sa11x0_pcmcia_init(void) - { -- return driver_register(&sa11x0_pcmcia_driver); -+ return platform_driver_register(&sa11x0_pcmcia_driver); - } - - /* sa11x0_pcmcia_exit() -@@ -110,7 +115,7 @@ - */ - static void __exit sa11x0_pcmcia_exit(void) - { -- driver_unregister(&sa11x0_pcmcia_driver); -+ platform_driver_unregister(&sa11x0_pcmcia_driver); - } - - MODULE_AUTHOR("John Dorsey "); diff --git a/packages/linux/linux_2.6.21.bb b/packages/linux/linux_2.6.21.bb index fda06caaf1..37c8f9cce5 100644 --- a/packages/linux/linux_2.6.21.bb +++ b/packages/linux/linux_2.6.21.bb @@ -2,7 +2,7 @@ require linux.inc DEFAULT_PREFERENCE_at91sam9263ek = "-1" -PR = "r4" +PR = "r5" SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \ file://defconfig \ @@ -11,9 +11,14 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \ SRC_URI_append_simpad = "\ file://linux-2.6.21-SIMpad-cs3-simpad.patch;patch=1 \ file://linux-2.6.21-SIMpad-mq200.patch;patch=1 \ - file://linux-2.6.21-SIMpad-serial-and-gpio_keys.patch;patch=1 \ + file://linux-2.6.21-SIMpad-serial-gpio_keys-and-cs3-ro.patch;patch=1 \ file://linux-2.6.21-SIMpad-ucb1x00-switches.patch;patch=1 \ - file://linux-2.6.21-pcmcia-device-to-platform-driver.patch;patch=1 \ + file://linux-2.6.21-SIMpad-pcmcia.patch;patch=1 \ + file://linux-2.6.21-SIMpad-net-shared-irq.patch;patch=1 \ + file://linux-2.6.21-SIMpad-ucb1x00-ts-supend-and-accuracy.patch;patch=1 \ + file://linux-2.6.21-SIMpad-GPIO-MMC-mod.patch;patch=1 \ + file://linux-2.6.21-SIMpad-battery-old-way-but-also-with-sysfs.patch;patch=1 \ + file://linux-2.6.21-SIMpad-usb-gadget.patch;patch=1 \ " SRC_URI_append_kb9202 = " http://maxim.org.za/AT91RM9200/2.6/2.6.21-at91.patch.gz;patch=1 " SRC_URI_append_at91sam9263ek = " http://maxim.org.za/AT91RM9200/2.6/2.6.21-at91.patch.gz;patch=1 " -- cgit v1.2.3 From e8149fc33657862b24ce407324229ff42109da23 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 6 Jul 2007 20:17:10 +0000 Subject: qemu-native: amd64-enabled 0.9.0 cvs snapshot from bug #2589. --- .../qemu/qemu-0.9.0+cvs20070701/.mtn2git_empty | 0 .../qemu-0.9.0+cvs20070701/arm_nptl-0.9.0.patch | 853 ++++++++++++++++++++ .../qemu-0.9.0+cvs20070701/configure-0.9.0.patch | 12 + .../pl110_rgb-r0-0.9.0.patch | 217 +++++ .../qemu-0.9.0+cvs20070701/qemu-0.9.0-gcc4.patch | 881 +++++++++++++++++++++ .../qemu-amd64-32b-mapping-0.9.0.patch | 21 + .../qemu-sdl-cursor-0.9.0.patch | 12 + packages/qemu/qemu-native_0.9.0.bb | 3 + packages/qemu/qemu_0.9.0.bb | 20 + 9 files changed, 2019 insertions(+) create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/.mtn2git_empty create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/arm_nptl-0.9.0.patch create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/configure-0.9.0.patch create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/pl110_rgb-r0-0.9.0.patch create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/qemu-0.9.0-gcc4.patch create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/qemu-amd64-32b-mapping-0.9.0.patch create mode 100644 packages/qemu/qemu-0.9.0+cvs20070701/qemu-sdl-cursor-0.9.0.patch create mode 100644 packages/qemu/qemu-native_0.9.0.bb create mode 100644 packages/qemu/qemu_0.9.0.bb diff --git a/packages/qemu/qemu-0.9.0+cvs20070701/.mtn2git_empty b/packages/qemu/qemu-0.9.0+cvs20070701/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/qemu/qemu-0.9.0+cvs20070701/arm_nptl-0.9.0.patch b/packages/qemu/qemu-0.9.0+cvs20070701/arm_nptl-0.9.0.patch new file mode 100644 index 0000000000..fe1f0945b6 --- /dev/null +++ b/packages/qemu/qemu-0.9.0+cvs20070701/arm_nptl-0.9.0.patch @@ -0,0 +1,853 @@ +diff -Naru qemu-snapshot-2007-06-24_05.orig/configure qemu-snapshot-2007-06-24_05/configure +--- qemu-snapshot-2007-06-24_05.orig/configure 2007-06-24 16:31:54.000000000 +0200 ++++ qemu-snapshot-2007-06-24_05/configure 2007-06-24 16:33:58.000000000 +0200 +@@ -101,6 +101,7 @@ + darwin_user="no" + build_docs="no" + uname_release="" ++nptl="yes" + + # OS specific + targetos=`uname -s` +@@ -287,6 +288,8 @@ + *) echo "undefined SPARC architecture. Exiting";exit 1;; + esac + ;; ++ --disable-nptl) nptl="no" ++ ;; + esac + done + +@@ -530,6 +533,23 @@ + } + EOF + ++# check NPTL support ++cat > $TMPC < ++void foo() ++{ ++#ifndef CLONE_SETTLS ++#error bork ++#endif ++} ++EOF ++ ++if $cc -c -o $TMPO $TMPC 2> /dev/null ; then ++ : ++else ++ nptl="no" ++fi ++ + ########################################## + # SDL probe + +@@ -681,6 +701,7 @@ + echo "Target Sparc Arch $sparc_cpu" + fi + echo "kqemu support $kqemu" ++echo "NPTL support $nptl" + echo "Documentation $build_docs" + [ ! -z "$uname_release" ] && \ + echo "uname -r $uname_release" +@@ -1063,6 +1084,14 @@ + echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak + fi + fi ++else ++ if test "$nptl" = "yes" ; then ++ case "$target_cpu" in ++ arm | armeb) ++ echo "#define USE_NPTL 1" >> $config_h ++ ;; ++ esac ++ fi + fi + + if test "$cocoa" = "yes" ; then +diff -Naru qemu-snapshot-2007-06-24_05.orig/exec-all.h qemu-snapshot-2007-06-24_05/exec-all.h +--- qemu-snapshot-2007-06-24_05.orig/exec-all.h 2007-05-23 21:58:10.000000000 +0200 ++++ qemu-snapshot-2007-06-24_05/exec-all.h 2007-06-24 16:33:58.000000000 +0200 +@@ -360,170 +360,7 @@ + extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4]; + extern void *io_mem_opaque[IO_MEM_NB_ENTRIES]; + +-#if defined(__powerpc__) +-static inline int testandset (int *p) +-{ +- int ret; +- __asm__ __volatile__ ( +- "0: lwarx %0,0,%1\n" +- " xor. %0,%3,%0\n" +- " bne 1f\n" +- " stwcx. %2,0,%1\n" +- " bne- 0b\n" +- "1: " +- : "=&r" (ret) +- : "r" (p), "r" (1), "r" (0) +- : "cr0", "memory"); +- return ret; +-} +-#elif defined(__i386__) +-static inline int testandset (int *p) +-{ +- long int readval = 0; +- +- __asm__ __volatile__ ("lock; cmpxchgl %2, %0" +- : "+m" (*p), "+a" (readval) +- : "r" (1) +- : "cc"); +- return readval; +-} +-#elif defined(__x86_64__) +-static inline int testandset (int *p) +-{ +- long int readval = 0; +- +- __asm__ __volatile__ ("lock; cmpxchgl %2, %0" +- : "+m" (*p), "+a" (readval) +- : "r" (1) +- : "cc"); +- return readval; +-} +-#elif defined(__s390__) +-static inline int testandset (int *p) +-{ +- int ret; +- +- __asm__ __volatile__ ("0: cs %0,%1,0(%2)\n" +- " jl 0b" +- : "=&d" (ret) +- : "r" (1), "a" (p), "0" (*p) +- : "cc", "memory" ); +- return ret; +-} +-#elif defined(__alpha__) +-static inline int testandset (int *p) +-{ +- int ret; +- unsigned long one; +- +- __asm__ __volatile__ ("0: mov 1,%2\n" +- " ldl_l %0,%1\n" +- " stl_c %2,%1\n" +- " beq %2,1f\n" +- ".subsection 2\n" +- "1: br 0b\n" +- ".previous" +- : "=r" (ret), "=m" (*p), "=r" (one) +- : "m" (*p)); +- return ret; +-} +-#elif defined(__sparc__) +-static inline int testandset (int *p) +-{ +- int ret; +- +- __asm__ __volatile__("ldstub [%1], %0" +- : "=r" (ret) +- : "r" (p) +- : "memory"); +- +- return (ret ? 1 : 0); +-} +-#elif defined(__arm__) +-static inline int testandset (int *spinlock) +-{ +- register unsigned int ret; +- __asm__ __volatile__("swp %0, %1, [%2]" +- : "=r"(ret) +- : "0"(1), "r"(spinlock)); +- +- return ret; +-} +-#elif defined(__mc68000) +-static inline int testandset (int *p) +-{ +- char ret; +- __asm__ __volatile__("tas %1; sne %0" +- : "=r" (ret) +- : "m" (p) +- : "cc","memory"); +- return ret; +-} +-#elif defined(__ia64) +- +-#include +- +-static inline int testandset (int *p) +-{ +- return __sync_lock_test_and_set (p, 1); +-} +-#elif defined(__mips__) +-static inline int testandset (int *p) +-{ +- int ret; +- +- __asm__ __volatile__ ( +- " .set push \n" +- " .set noat \n" +- " .set mips2 \n" +- "1: li $1, 1 \n" +- " ll %0, %1 \n" +- " sc $1, %1 \n" +- " beqz $1, 1b \n" +- " .set pop " +- : "=r" (ret), "+R" (*p) +- : +- : "memory"); +- +- return ret; +-} +-#else +-#error unimplemented CPU support +-#endif +- +-typedef int spinlock_t; +- +-#define SPIN_LOCK_UNLOCKED 0 +- +-#if defined(CONFIG_USER_ONLY) +-static inline void spin_lock(spinlock_t *lock) +-{ +- while (testandset(lock)); +-} +- +-static inline void spin_unlock(spinlock_t *lock) +-{ +- *lock = 0; +-} +- +-static inline int spin_trylock(spinlock_t *lock) +-{ +- return !testandset(lock); +-} +-#else +-static inline void spin_lock(spinlock_t *lock) +-{ +-} +- +-static inline void spin_unlock(spinlock_t *lock) +-{ +-} +- +-static inline int spin_trylock(spinlock_t *lock) +-{ +- return 1; +-} +-#endif ++#include "qemu_spinlock.h" + + extern spinlock_t tb_lock; + +diff -Naru qemu-snapshot-2007-06-24_05.orig/linux-user/arm/syscall.h qemu-snapshot-2007-06-24_05/linux-user/arm/syscall.h +--- qemu-snapshot-2007-06-24_05.orig/linux-user/arm/syscall.h 2005-04-27 22:11:21.000000000 +0200 ++++ qemu-snapshot-2007-06-24_05/linux-user/arm/syscall.h 2007-06-24 16:33:58.000000000 +0200 +@@ -28,7 +28,9 @@ + #define ARM_SYSCALL_BASE 0x900000 + #define ARM_THUMB_SYSCALL 0 + +-#define ARM_NR_cacheflush (ARM_SYSCALL_BASE + 0xf0000 + 2) ++#define ARM_NR_BASE 0xf0000 ++#define ARM_NR_cacheflush (ARM_NR_BASE + 2) ++#define ARM_NR_set_tls (ARM_NR_BASE + 5) + + #define ARM_NR_semihosting 0x123456 + #define ARM_NR_thumb_semihosting 0xAB +diff -Naru qemu-snapshot-2007-06-24_05.orig/linux-user/main.c qemu-snapshot-2007-06-24_05/linux-user/main.c +--- qemu-snapshot-2007-06-24_05.orig/linux-user/main.c 2007-06-22 00:55:02.000000000 +0200 ++++ qemu-snapshot-2007-06-24_05/linux-user/main.c 2007-06-24 16:33:58.000000000 +0200 +@@ -325,6 +325,50 @@ + } + } + ++/* Handle a jump to the kernel code page. */ ++static int ++do_kernel_trap(CPUARMState *env) ++{ ++ uint32_t addr; ++ uint32_t *ptr; ++ uint32_t cpsr; ++ ++ switch (env->regs[15]) { ++ case 0xffff0fc0: /* __kernel_cmpxchg */ ++ /* XXX: This only works between threads, not between processes. ++ Use native atomic operations. */ ++ /* ??? This probably breaks horribly if the access segfaults. */ ++ cpu_lock(); ++ ptr = (uint32_t *)env->regs[2]; ++ cpsr = cpsr_read(env); ++ if (*ptr == env->regs[0]) { ++ *ptr = env->regs[1]; ++ env->regs[0] = 0; ++ cpsr |= CPSR_C; ++ } else { ++ env->regs[0] = -1; ++ cpsr &= ~CPSR_C; ++ } ++ cpsr_write(env, cpsr, CPSR_C); ++ cpu_unlock(); ++ break; ++ case 0xffff0fe0: /* __kernel_get_tls */ ++ env->regs[0] = env->cp15.c13_tls; ++ break; ++ default: ++ return 1; ++ } ++ /* Jump back to the caller. */ ++ addr = env->regs[14]; ++ if (addr & 1) { ++ env->thumb = 1; ++ addr &= ~1; ++ } ++ env->regs[15] = addr; ++ ++ return 0; ++} ++ + void cpu_loop(CPUARMState *env) + { + int trapnr; +@@ -381,10 +425,8 @@ + } + } + +- if (n == ARM_NR_cacheflush) { +- arm_cache_flush(env->regs[0], env->regs[1]); +- } else if (n == ARM_NR_semihosting +- || n == ARM_NR_thumb_semihosting) { ++ if (n == ARM_NR_semihosting ++ || n == ARM_NR_thumb_semihosting) { + env->regs[0] = do_arm_semihosting (env); + } else if (n == 0 || n >= ARM_SYSCALL_BASE + || (env->thumb && n == ARM_THUMB_SYSCALL)) { +@@ -395,14 +437,34 @@ + n -= ARM_SYSCALL_BASE; + env->eabi = 0; + } +- env->regs[0] = do_syscall(env, +- n, +- env->regs[0], +- env->regs[1], +- env->regs[2], +- env->regs[3], +- env->regs[4], +- env->regs[5]); ++ if ( n > ARM_NR_BASE) { ++ switch (n) ++ { ++ case ARM_NR_cacheflush: ++ arm_cache_flush(env->regs[0], env->regs[1]); ++ break; ++#ifdef USE_NPTL ++ case ARM_NR_set_tls: ++ cpu_set_tls(env, env->regs[0]); ++ env->regs[0] = 0; ++ break; ++#endif ++ default: ++ printf ("Error: Bad syscall: %x\n", n); ++ goto error; ++ } ++ } ++ else ++ { ++ env->regs[0] = do_syscall(env, ++ n, ++ env->regs[0], ++ env->regs[1], ++ env->regs[2], ++ env->regs[3], ++ env->regs[4], ++ env->regs[5]); ++ } + } else { + goto error; + } +@@ -441,6 +503,10 @@ + } + } + break; ++ case EXCP_KERNEL_TRAP: ++ if (do_kernel_trap(env)) ++ goto error; ++ break; + default: + error: + fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n", +@@ -2074,6 +2140,10 @@ + ts->heap_base = info->brk; + /* This will be filled in on the first SYS_HEAPINFO call. */ + ts->heap_limit = 0; ++ /* Register the magic kernel code page. The cpu will generate a ++ special exception when it tries to execute code here. We can't ++ put real code here because it may be in use by the host kernel. */ ++ page_set_flags(0xffff0000, 0xffff0fff, 0); + #endif + + if (gdbstub_port) { +diff -Naru qemu-snapshot-2007-06-24_05.orig/linux-user/qemu.h qemu-snapshot-2007-06-24_05/linux-user/qemu.h +--- qemu-snapshot-2007-06-24_05.orig/linux-user/qemu.h 2007-05-26 17:09:38.000000000 +0200 ++++ qemu-snapshot-2007-06-24_05/linux-user/qemu.h 2007-06-24 16:33:58.000000000 +0200 +@@ -81,6 +81,9 @@ + uint32_t heap_limit; + #endif + int used; /* non zero if used */ ++#ifdef USE_NPTL ++ uint32_t *child_tidptr; ++#endif + struct image_info *info; + uint8_t stack[0]; + } __attribute__((aligned(16))) TaskState; +diff -Naru qemu-snapshot-2007-06-24_05.orig/linux-user/syscall.c qemu-snapshot-2007-06-24_05/linux-user/syscall.c +--- qemu-snapshot-2007-06-24_05.orig/linux-user/syscall.c 2007-06-21 23:57:11.000000000 +0200 ++++ qemu-snapshot-2007-06-24_05/linux-user/syscall.c 2007-06-24 16:33:58.000000000 +0200 +@@ -70,9 +70,18 @@ + #include + + #include "qemu.h" ++#include "qemu_spinlock.h" + + //#define DEBUG + ++#ifdef USE_NPTL ++#define CLONE_NPTL_FLAGS2 (CLONE_SETTLS | \ ++ CLONE_PARENT_SETTID | CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID) ++#else ++/* XXX: Hardcode the above values. */ ++#define CLONE_NPTL_FLAGS2 0 ++#endif ++ + #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \ + || defined(TARGET_M68K) || defined(TARGET_SH4) + /* 16 bit uid wrappers emulation */ +@@ -2121,20 +2130,38 @@ + thread/process */ + #define NEW_STACK_SIZE 8192 + ++#ifdef USE_NPTL ++static spinlock_t nptl_lock = SPIN_LOCK_UNLOCKED; ++#endif ++ + static int clone_func(void *arg) + { + CPUState *env = arg; ++#ifdef HAVE_NPTL ++ /* Wait until the parent has finshed initializing the tls state. */ ++ while (!spin_trylock(&nptl_lock)) ++ usleep(1); ++ spin_unlock(&nptl_lock); ++#endif + cpu_loop(env); + /* never exits */ + return 0; + } + +-int do_fork(CPUState *env, unsigned int flags, unsigned long newsp) ++int do_fork(CPUState *env, unsigned int flags, unsigned long newsp, ++ uint32_t *parent_tidptr, void *newtls, ++ uint32_t *child_tidptr) + { + int ret; + TaskState *ts; + uint8_t *new_stack; + CPUState *new_env; ++#ifdef USE_NPTL ++ unsigned int nptl_flags; ++ ++ if (flags & CLONE_PARENT_SETTID) ++ *parent_tidptr = gettid(); ++#endif + + if (flags & CLONE_VM) { + ts = malloc(sizeof(TaskState) + NEW_STACK_SIZE); +@@ -2201,16 +2228,60 @@ + #error unsupported target CPU + #endif + new_env->opaque = ts; ++#ifdef USE_NPTL ++ nptl_flags = flags; ++ flags &= ~CLONE_NPTL_FLAGS2; ++ if (nptl_flags & CLONE_CHILD_CLEARTID) { ++ ts->child_tidptr = child_tidptr; ++ } ++ if (nptl_flags & CLONE_SETTLS) ++ cpu_set_tls (new_env, newtls); ++ /* Grab the global cpu lock so that the thread setup appears ++ atomic. */ ++ if (nptl_flags & CLONE_CHILD_SETTID) ++ spin_lock(&nptl_lock); ++#else ++ if (flags & CLONE_NPTL_FLAGS2) ++ return -EINVAL; ++#endif ++ + #ifdef __ia64__ + ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); + #else + ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); + #endif ++#ifdef USE_NPTL ++ if (ret != -1) { ++ if (nptl_flags & CLONE_CHILD_SETTID) ++ *child_tidptr = ret; ++ } ++ /* Allow the child to continue. */ ++ if (nptl_flags & CLONE_CHILD_SETTID) ++ spin_unlock(&nptl_lock); ++#endif + } else { +- /* if no CLONE_VM, we consider it is a fork */ +- if ((flags & ~CSIGNAL) != 0) +- return -EINVAL; +- ret = fork(); ++ /* if no CLONE_VM, we consider it is a fork */ ++ if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0) ++ return -EINVAL; ++ ret = fork(); ++#ifdef USE_NPTL ++ /* There is a race condition here. The parent process could ++ theoretically read the TID in the child process before the child ++ tid is set. This would require using either ptrace ++ (not implemented) or having *_tidptr to point at a shared memory ++ mapping. We can't repeat the spinlock hack used above because ++ the child process gets its own copy of the lock. */ ++ if (ret == 0) { ++ /* Child Process. */ ++ if (flags & CLONE_CHILD_SETTID) ++ *child_tidptr = gettid(); ++ ts = (TaskState *)env->opaque; ++ if (flags & CLONE_CHILD_CLEARTID) ++ ts->child_tidptr = child_tidptr; ++ if (flags & CLONE_SETTLS) ++ cpu_set_tls (env, newtls); ++ } ++#endif + } + return ret; + } +@@ -2487,7 +2558,7 @@ + ret = do_brk(arg1); + break; + case TARGET_NR_fork: +- ret = get_errno(do_fork(cpu_env, SIGCHLD, 0)); ++ ret = get_errno(do_fork(cpu_env, SIGCHLD, 0, NULL, NULL, NULL)); + break; + #ifdef TARGET_NR_waitpid + case TARGET_NR_waitpid: +@@ -3651,7 +3722,8 @@ + ret = get_errno(fsync(arg1)); + break; + case TARGET_NR_clone: +- ret = get_errno(do_fork(cpu_env, arg1, arg2)); ++ ret = get_errno(do_fork(cpu_env, arg1, arg2, (uint32_t *)arg3, ++ (void *)arg4, (uint32_t *)arg5)); + break; + #ifdef __NR_exit_group + /* new thread calls */ +@@ -4039,7 +4111,8 @@ + #endif + #ifdef TARGET_NR_vfork + case TARGET_NR_vfork: +- ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0)); ++ ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0, ++ NULL, NULL, NULL)); + break; + #endif + #ifdef TARGET_NR_ugetrlimit +@@ -4632,4 +4705,3 @@ + #endif + return ret; + } +- +diff -Naru qemu-snapshot-2007-06-24_05.orig/qemu_spinlock.h qemu-snapshot-2007-06-24_05/qemu_spinlock.h +--- qemu-snapshot-2007-06-24_05.orig/qemu_spinlock.h 1970-01-01 01:00:00.000000000 +0100 ++++ qemu-snapshot-2007-06-24_05/qemu_spinlock.h 2007-06-24 16:33:58.000000000 +0200 +@@ -0,0 +1,182 @@ ++/* ++ * internal execution defines for qemu ++ * ++ * Copyright (c) 2003 Fabrice Bellard ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef _QEMU_SPINLOCK_H ++#define _QEMU_SPINLOCK_H ++ ++#ifdef __powerpc__ ++static inline int testandset (int *p) ++{ ++ int ret; ++ __asm__ __volatile__ ( ++ "0: lwarx %0,0,%1\n" ++ " xor. %0,%3,%0\n" ++ " bne 1f\n" ++ " stwcx. %2,0,%1\n" ++ " bne- 0b\n" ++ "1: " ++ : "=&r" (ret) ++ : "r" (p), "r" (1), "r" (0) ++ : "cr0", "memory"); ++ return ret; ++} ++#endif ++ ++#ifdef __i386__ ++static inline int testandset (int *p) ++{ ++ long int readval = 0; ++ ++ __asm__ __volatile__ ("lock; cmpxchgl %2, %0" ++ : "+m" (*p), "+a" (readval) ++ : "r" (1) ++