summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCliff Brake <cbrake@bec-systems.com>2008-10-23 21:34:47 -0400
committerCliff Brake <cbrake@bec-systems.com>2008-10-23 21:34:47 -0400
commit97f239bff818c4836572495c05f983a9fab09202 (patch)
tree52341b9eefdf1b551d7d2a3fdd0ee391270f10fd
parenta57a4df1e3d3ec67465253688a638adecc8caf6d (diff)
parent3a83d1fb3fd0fdbbf763e5f495ef9046f09e15b9 (diff)
Merge commit 'openembedded.org/org.openembedded.dev' into org.openembedded.dev
-rw-r--r--classes/rootfs_deb.bbclass2
-rw-r--r--conf/checksums.ini24
-rw-r--r--conf/distro/include/sane-srcrevs.inc6
-rw-r--r--conf/distro/mamona.conf26
-rw-r--r--packages/alsa/alsa-state/nokia800/asound.state (renamed from packages/mamona/mamona-sound-n800/asound.state)0
-rw-r--r--packages/apt/apt-0.7.14/no-ko-translation.patch9
-rw-r--r--packages/apt/apt-0.7.14/noconfigure.patch35
-rw-r--r--packages/apt/apt-0.7.14/nodoc.patch19
-rw-r--r--packages/apt/apt-0.7.14/use-host.patch44
-rw-r--r--packages/apt/apt-native.inc7
-rw-r--r--packages/apt/apt-native_0.7.14.bb7
-rw-r--r--packages/apt/apt-package.inc2
-rw-r--r--packages/apt/apt.inc3
-rw-r--r--packages/apt/apt_0.7.14.bb27
-rw-r--r--packages/apt/files/no-curl.patch44
-rw-r--r--packages/dpkg/dpkg-1.14.19/ignore_extra_fields.patch26
-rw-r--r--packages/dpkg/dpkg-native_1.13.22.bb3
-rw-r--r--packages/dpkg/dpkg-native_1.14.19.bb15
-rw-r--r--packages/dpkg/dpkg.inc3
-rw-r--r--packages/dpkg/dpkg_1.13.22.bb4
-rw-r--r--packages/dpkg/dpkg_1.13.25.bb4
-rw-r--r--packages/dpkg/dpkg_1.14.19.bb12
-rw-r--r--packages/dsplink/codec-engine_2.21.bb2
-rw-r--r--packages/dsplink/ti-cmemk-module_2.21.bb83
-rw-r--r--packages/dsplink/ti-lpm-module_2.21.bb82
-rw-r--r--packages/mamona/bash-noemu-3.2/006-add_internal_libcpwd_functions.patch752
-rw-r--r--packages/mamona/bash-noemu_3.2.bb6
-rw-r--r--packages/mamona/binutils-noemu-2.18/110-arm-eabi-conf.patch24
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-2.16.1-e300c2c3.patch19
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch39
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-configure-texinfo-version.patch22
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-uclibc-100-uclibc-conf.patch34
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-001_ld_makefile_patch.patch50
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-006_better_file_error.patch43
-rw-r--r--packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-012_check_ldrunpath_length.patch47
-rw-r--r--packages/mamona/binutils-noemu_2.17.50.0.5.bb3
-rw-r--r--packages/mamona/binutils-noemu_2.18.bb38
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/770_performance_improvements.patch307
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/create_sysfs_link_for_wlan0.patch11
-rwxr-xr-xpackages/mamona/cx3110x-770he-0.8.1/cx3110x37
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/cx3110x.patch492
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/defconfig1380
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/fix_cross_makefile.patch11
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/fix_mem_allign.patch94
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/fix_mem_corruption.patch53
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/fix_opps_while_connecting_with_nm.patch128
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/fix_ssid_data_length.patch13
-rw-r--r--packages/mamona/cx3110x-770he-0.8.1/series7
-rw-r--r--packages/mamona/cx3110x-770he_0.8.1.bb30
-rw-r--r--packages/mamona/cx3110x-chinooke-2.0.15/create_sysfs_link_for_wlan0.patch11
-rwxr-xr-xpackages/mamona/cx3110x-chinooke-2.0.15/cx3110x37
-rw-r--r--packages/mamona/cx3110x-chinooke-2.0.15/cx3110x.patch492
-rw-r--r--packages/mamona/cx3110x-chinooke-2.0.15/fix_old_include.patch13
-rw-r--r--packages/mamona/cx3110x-chinooke_2.0.15.bb31
-rw-r--r--packages/mamona/cx3110x-diablo-2.0.15/create_sysfs_link_for_wlan0.patch11
-rwxr-xr-xpackages/mamona/cx3110x-diablo-2.0.15/cx3110x40
-rw-r--r--packages/mamona/cx3110x-diablo-2.0.15/cx3110x.patch492
-rw-r--r--packages/mamona/cx3110x-diablo-2.0.15/fix_old_include.patch13
-rw-r--r--packages/mamona/cx3110x-diablo_2.0.15.bb25
-rw-r--r--packages/mamona/cx3110x.inc29
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/.mtn2git_empty0
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/100-uclibc-conf.patch544
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/110-arm-eabi.patch27
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/200-uclibc-locale.patch3239
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/300-libstdc++-pic.patch46
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/301-missing-execinfo_h.patch11
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/302-c99-snprintf.patch11
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/303-c99-complex-ugly-hack.patch12
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/304-index_macro.patch24
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/602-sdk-libstdc++-includes.patch20
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/740-sh-pr24836.patch25
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/800-arm-bigendian.patch127
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/801-arm-bigendian-eabi.patch14
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/README4
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/arm-nolibfloat.patch24
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/arm-softfloat.patch16
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/arm-thumb-cache.patch29
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/arm-thumb.patch64
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/cache-amnesia.patch13
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff18
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/gcc-4.0.2-e300c2c3.patch311
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/gcc41-configure.in.patch22
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/gfortran.patch40
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/ldflags.patch22
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/pr34130.patch16
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/sdk-libstdc++-includes.patch22
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/sh3-installfix-fixheaders.patch11
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/unbreak-armv4t.patch12
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/zecke-no-host-includes.patch31
-rw-r--r--packages/mamona/gcc-noemu-4.1.2/zecke-xgcc-cpp.patch16
-rw-r--r--packages/mamona/gcc-noemu_4.1.1.bb3
-rw-r--r--packages/mamona/gcc-noemu_4.1.2.bb104
-rw-r--r--packages/mamona/gcc-package-noemu.inc71
-rw-r--r--packages/mamona/mamona-input-methods_git.bb78
-rw-r--r--packages/mamona/mamona-sound-n770/asound.conf22
-rw-r--r--packages/mamona/mamona-sound-n770/dsp-n800.rules6
-rw-r--r--packages/mamona/mamona-sound-n770_0.1.0.bb32
-rw-r--r--packages/mamona/mamona-sound-n800_0.1.0.bb7
-rw-r--r--packages/mamona/mamonaim-e-applet_git.bb36
-rw-r--r--packages/mamona/udev-usbserial/80-usbconsole.rules1
-rw-r--r--packages/mamona/udev-usbserial_0.1.bb30
-rw-r--r--packages/mamona/uinput-2.6.21/nokia800/defconfig1556
-rwxr-xr-xpackages/mamona/uinput-2.6.21/uinput5
-rw-r--r--packages/mamona/uinput_2.6.21.bb43
-rw-r--r--packages/meta/mamona-buildall.inc4
-rw-r--r--packages/meta/meta-mamona.bb99
-rw-r--r--packages/opkg/opkg_svn.bb3
-rw-r--r--packages/pidgin/pidgin.inc2
-rw-r--r--packages/qemu/qemu-0.9.1+svn/05_non-fatal_if_linux_hd_missing.patch17
-rw-r--r--packages/qemu/qemu-0.9.1+svn/06_exit_segfault.patch45
-rw-r--r--packages/qemu/qemu-0.9.1+svn/10_signal_jobs.patch26
-rw-r--r--packages/qemu/qemu-0.9.1+svn/11_signal_sigaction.patch21
-rw-r--r--packages/qemu/qemu-0.9.1+svn/22_net_tuntap_stall.patch18
-rw-r--r--packages/qemu/qemu-0.9.1+svn/31_syscalls.patch48
-rw-r--r--packages/qemu/qemu-0.9.1+svn/32_syscall_sysctl.patch55
-rw-r--r--packages/qemu/qemu-0.9.1+svn/33_syscall_ppc_clone.patch22
-rw-r--r--packages/qemu/qemu-0.9.1+svn/39_syscall_fadvise64.patch21
-rw-r--r--packages/qemu/qemu-0.9.1+svn/52_ne2000_return.patch17
-rw-r--r--packages/qemu/qemu-0.9.1+svn/61_safe_64bit_int.patch27
-rw-r--r--packages/qemu/qemu-0.9.1+svn/63_sparc_build.patch18
-rw-r--r--packages/qemu/qemu-0.9.1+svn/64_ppc_asm_constraints.patch18
-rw-r--r--packages/qemu/qemu-0.9.1+svn/65_kfreebsd.patch35
-rw-r--r--packages/qemu/qemu-0.9.1+svn/66_tls_ld.patch55
-rw-r--r--packages/qemu/qemu-0.9.1+svn/91-oh-sdl-cursor.patch18
-rw-r--r--packages/qemu/qemu-0.9.1+svn/configure_symlinkpath_fix.patch28
-rw-r--r--packages/qemu/qemu-0.9.1+svn/fix_brk.patch59
-rw-r--r--packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch14
-rw-r--r--packages/qemu/qemu-0.9.1+svn/fix_segfault.patch37
-rw-r--r--packages/qemu/qemu-0.9.1+svn/no-strip.patch26
-rw-r--r--packages/qemu/qemu-0.9.1+svn/qemu-0.9.0-nptl.patch1100
-rw-r--r--packages/qemu/qemu-0.9.1+svn/qemu-amd64-32b-mapping-0.9.0.patch37
-rw-r--r--packages/qemu/qemu-0.9.1+svn/qemu-n800-support.patch2381
-rw-r--r--packages/qemu/qemu-0.9.1+svn/revert_arm_tcg.patch.gzbin0 -> 97991 bytes
-rw-r--r--packages/qemu/qemu-0.9.1+svn/series25
-rw-r--r--packages/qemu/qemu-0.9.1+svn/workaround_bad_futex_headers.patch25
-rw-r--r--packages/qemu/qemu-native_svn.bb2
-rw-r--r--packages/qemu/qemu_svn.bb48
-rw-r--r--packages/tasks/mamona-sdk.inc25
-rw-r--r--packages/tasks/task-mamona-base.bb26
-rw-r--r--packages/tasks/task-mamona-devel.bb38
-rw-r--r--packages/tasks/task-mamona-e.bb37
-rw-r--r--packages/tasks/task-mamona-extras.bb174
-rw-r--r--packages/tasks/task-mamona-noemu.bb12
-rw-r--r--packages/tasks/task-mamona-nokia-it.bb27
-rw-r--r--packages/tasks/task-mamona-python.bb79
-rw-r--r--packages/tasks/task-mamona-sdk-noemu.bb16
-rw-r--r--packages/tasks/task-mamona-sdk.bb16
-rw-r--r--packages/tasks/task-mamona-systemtap.bb11
-rw-r--r--packages/tasks/task-mamona-wm.bb17
-rw-r--r--packages/tasks/task-mamona.bb36
-rw-r--r--packages/u-boot/u-boot-mkimage-native-1.3.2/fix-arm920t-eabi.patch22
-rw-r--r--packages/u-boot/u-boot-mkimage-native_1.3.2.bb22
152 files changed, 16611 insertions, 386 deletions
diff --git a/classes/rootfs_deb.bbclass b/classes/rootfs_deb.bbclass
index 3a69b82010..1b93767463 100644
--- a/classes/rootfs_deb.bbclass
+++ b/classes/rootfs_deb.bbclass
@@ -25,7 +25,7 @@ fakeroot rootfs_deb_do_rootfs () {
# if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
rm -f Packages.gz Packages Packages.bz2
# fi
- apt-ftparchive packages . | bzip2 > Packages.bz2
+ dpkg-scanpackages . | bzip2 > Packages.bz2
echo "Label: $arch" > Release
echo "deb file:${DEPLOY_DIR_DEB}/$arch/ ./" >> ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
diff --git a/conf/checksums.ini b/conf/checksums.ini
index fb4bfd397c..061fa32dd1 100644
--- a/conf/checksums.ini
+++ b/conf/checksums.ini
@@ -942,14 +942,30 @@ sha256=8cd84eb2031a91572e1be2975f4171730a9be72c4cd88718c4c40ac7dc4fd7d3
md5=26b37525371cdaaec552237e0667305d
sha256=57de084860870cccf510de62eb8ded252f5951a6e59e34a963d61d69de3aff10
+[ftp://ftp.pl.debian.org/pub/debian/pool/main/a/apt/apt_0.5.28.6.tar.gz]
+md5=26b37525371cdaaec552237e0667305d
+sha256=57de084860870cccf510de62eb8ded252f5951a6e59e34a963d61d69de3aff10
+
+[ftp://ftp.pl.debian.org/pub/debian/pool/main/a/apt/apt_0.6.25.tar.gz]
+md5=6569fd95e829036c141a5ccaf8e5948c
+sha256=fa00ce910ab6f0987c4a210962be357d4f013fc89ef72b015f39ae8649522b59
+
[ftp://ftp.debian.org/debian/pool/main/a/apt/apt_0.6.46.2.tar.gz]
md5=67d439a252996357b0313b3ad999739a
sha256=6f1a7340d0de2a9a524055d0ed4289aa919dc29e9e1fe60aae598f2019105686
+[ftp://ftp.pl.debian.org/pub/debian/pool/main/a/apt/apt_0.6.46.2.tar.gz]
+md5=67d439a252996357b0313b3ad999739a
+sha256=6f1a7340d0de2a9a524055d0ed4289aa919dc29e9e1fe60aae598f2019105686
+
[ftp://ftp.pl.debian.org/pub/debian/pool/main/a/apt/apt_0.7.14.tar.gz]
md5=19efa18fb1ef20c58b9b44e94258b814
sha256=8fc06effaf8a4e4333308eedcdc6840f1c8056f2e924210f151dfc076bcd4045
+[ftp://ftp.pl.debian.org/pub/debian/pool/main/a/apt/apt_0.7.2.tar.gz]
+md5=c66f943203fa24e85ed8c48f6ac5ad1e
+sha256=e7d58e2b202713b4df8cd5fd58bc20ba8d31c0da6e5e3b3c89a138dbf0b24ad9
+
[ftp://ftp.pl.debian.org/pub/debian/pool/main/a/apt/apt_0.7.3.tar.gz]
md5=e2e6e23f43bfdf135b923205659dfaf1
sha256=d3a71446234e567a24740b02abe5bc6c695836343df6139eb7c03ec11871e710
@@ -3006,6 +3022,10 @@ sha256=8955fad7d9e7aef36f7a82f9577c3ae4901db1ded6ce57aec0d93e39c8899b65
md5=0fc9fffc2c2cfa7107d8f422815078c1
sha256=c33aeb300d93eaeac55927ce81dc6f3a1cf74b3b759b65182c9bfca31b75b98f
+[ftp://ftp.pl.debian.org/pub/debian/pool/main/d/dpkg/dpkg_1.13.22.tar.gz]
+md5=0fc9fffc2c2cfa7107d8f422815078c1
+sha256=c33aeb300d93eaeac55927ce81dc6f3a1cf74b3b759b65182c9bfca31b75b98f
+
[ftp://ftp.pl.debian.org/pub/debian/pool/main/d/dpkg/dpkg_1.13.24.tar.gz]
md5=d8ec0b2bf86d5277fb50f8d391c0dd4a
sha256=8b1ed52659c5f6723f37bf1122508d7f1b82e064aa9db04d18d726bde34c2713
@@ -4506,6 +4526,10 @@ sha256=aeef281072cf3e045b73e7047bd9830a71128b828920b3d389a5b7b7cbd0beff
md5=f754d2ddea7107c5dff5f846f9426d30
sha256=69b3269a6b1ca26357e1e72c6be7f0ed742cd88d2042243c0bb9ba76e4acac99
+[http://www.kernel.org/pub/software/scm/git/git-1.5.6.5.tar.bz2]
+md5=5175d142ad0745b9e22a64904aa86c45
+sha256=692901194603cc4fb4072d8f907487d867caef6b62161f50f0f44dbeb001066e
+
[http://downloads.sourceforge.net/gizmod/gizmod-2.3.tar.bz2]
md5=b7200b08149599c4c0f56d88f0c7f208
sha256=53af32530e58ba23cbb752f063364612bbea57b31de2ee35814973452c2f63f2
diff --git a/conf/distro/include/sane-srcrevs.inc b/conf/distro/include/sane-srcrevs.inc
index cb6340a172..98da2835c4 100644
--- a/conf/distro/include/sane-srcrevs.inc
+++ b/conf/distro/include/sane-srcrevs.inc
@@ -86,6 +86,8 @@ SRCREV_pn-linux-openmoko-devel ?= "04f54c7001fb609e11ff4b2b4575c04188dbefef"
SRCREV_pn-llvm-gcc4 ?= "374"
SRCREV_pn-llvm-gcc4-cross ?= "374"
SRCREV_pn-maemo-mapper ?= "118"
+SRCREV_pn-mamonaim_e_applet ?= "51c747849f71981bd1dc9eb1807df4993ad97d04"
+SRCREV_pn-mamona_input_methods ?= "7e6a8cc947689a045d0fba90015da599275347d9"
SRCREV_pn-matchbox-desktop-2 ?= "1778"
SRCREV_pn-matchbox-keyboard ?= "1910"
SRCREV_pn-matchbox-keyboard-inputmethod ?= "1910"
@@ -169,6 +171,10 @@ SRCREV_pn-python-gsmd = "148"
SRCREV_pn-python-lightmediascanner = "68"
SRCREV_pn-python-pyrtc = "d1f32060474767582dd4248d5e5c2adc63931d5a"
SRCREV_pn-python-pyyaml = "294"
+QEMUSRCREV = "4242"
+SRCREV_pn-qemu-native ?= "${QEMUSRCREV}"
+SRCREV_pn-qemu-sdk ?= "${QEMUSRCREV}"
+SRCREV_pn-qemu ?= "${QEMUSRCREV}"
SRCREV_pn-remoko = "115"
SRCREV_pn-remoko-server = "115"
SRCREV_pn-s3c24xx-gpio ?= "4130"
diff --git a/conf/distro/mamona.conf b/conf/distro/mamona.conf
index 264a064521..83e102663c 100644
--- a/conf/distro/mamona.conf
+++ b/conf/distro/mamona.conf
@@ -16,6 +16,7 @@ require conf/distro/include/sane-srcrevs.inc
INHERIT += "angstrom-mirrors mamona-mirrors"
INHERIT += "package_deb debian"
+INHERIT += "buildallpkgs"
CXXFLAGS += "-fvisibility-inlines-hidden"
@@ -26,17 +27,17 @@ KERNEL = "kernel26"
MACHINE_KERNEL_VERSION = "2.6"
PREFERRED_VERSION_linux-omap1 ?= "2.6.22-omap1"
PREFERRED_VERSION_linux-libc-headers ?= "2.6.22"
-PREFERRED_VERSION_linux = "2.6.16"
+PREFERRED_VERSION_linux ?= "2.6.22"
PREFERRED_VERSION_linux-libc-headers_nokia770 = "2.6.16.osso7"
+PREFERRED_PROVIDER_linux-libc-headers = "linux-libc-headers"
# Toolchain
# =========
# gcc
-PREFERRED_PROVIDERS_virtual/${TARGET_PREFIX}gcc-initial = "gcc-cross-initial"
-PREFERRED_PROVIDERS_virtual/${TARGET_PREFIX}gcc-intermediate = "gcc-cross-intermediate"
-PREFERRED_PROVIDERS_virtual/${TARGET_PREFIX}gcc = "gcc-cross"
-PREFERRED_PROVIDERS_virtual/${TARGET_PREFIX}g++ = "gcc-cross"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "gcc-cross-initial"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "gcc-cross"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "gcc-cross"
PREFERRED_VERSION_gcc ?= "4.1.2"
PREFERRED_VERSION_gcc-cross ?= "4.1.2"
@@ -45,6 +46,7 @@ PREFERRED_VERSION_gcc-cross-initial ?= "4.1.2"
PREFERRED_VERSION_gcc-cross-intermediate ?= "4.1.2"
# binutils
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "binutils-cross"
PREFERRED_VERSION_binutils ?= "2.18"
PREFERRED_VERSION_binutils-cross ?= "2.18"
PREFERRED_VERSION_binutils-cross-sdk ?= "2.18"
@@ -57,6 +59,7 @@ PREFERRED_PROVIDER_virtual/libc = "glibc"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial ?= "glibc-initial"
PREFERRED_VERSION_glibc ?= "2.5"
+PREFERRED_VERSION_glibc-intermediate ?= "2.5"
PREFERRED_VERSION_glibc-initial ?= "2.5"
PREFERRED_VERSION_uclibc ?= "0.9.29"
@@ -75,6 +78,7 @@ PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-dpkg"
PREFERRED_PROVIDER_virtual/ecore ?= "ecore-x11"
PREFERRED_PROVIDER_virtual/evas ?= "evas-x11"
PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
+PREFERRED_PROVIDER_virtual/libsdl ?= "libsdl-x11"
PREFERRED_PROVIDER_virtual/db ?= "db"
PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
PREFERRED_PROVIDER_avahi = "avahi"
@@ -83,3 +87,15 @@ PREFERRED_PROVIDER_gconf = "gconf-dbus"
PREFERRED_VERSION_apt = "0.7.6"
PREFERRED_VERSION_gpsd ?= "2.33"
PREFERRED_VERSION_hal_nokia770 = "0.5.7"
+PREFERRED_VERSION_networkmanager ?= "0.6.6"
+
+# Mplayer
+PREFERRED_VERSION_mplayer_nokia770 ?= "1.0maemo0"
+PREFERRED_VERSION_mplayer_nokia800 ?= "1.0maemo0"
+
+# Network
+PREFERRED_VERSION_wpa-supplicant = "0.5.7"
+
+# Mozilla
+PREFERRED_PROVIDER_gtk+ = "gtk+"
+PREFERRED_VERSION_gtk+ = "2.10.14"
diff --git a/packages/mamona/mamona-sound-n800/asound.state b/packages/alsa/alsa-state/nokia800/asound.state
index 6ae874c2e2..6ae874c2e2 100644
--- a/packages/mamona/mamona-sound-n800/asound.state
+++ b/packages/alsa/alsa-state/nokia800/asound.state
diff --git a/packages/apt/apt-0.7.14/no-ko-translation.patch b/packages/apt/apt-0.7.14/no-ko-translation.patch
new file mode 100644
index 0000000000..5f3634b32a
--- /dev/null
+++ b/packages/apt/apt-0.7.14/no-ko-translation.patch
@@ -0,0 +1,9 @@
+---
+ po/LINGUAS | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- apt-0.7.14.orig/po/LINGUAS
++++ apt-0.7.14/po/LINGUAS
+@@ -1 +1 @@
+-ar bg bs ca cs cy da de dz el en_GB es eu fi fr gl he hu it ja km ko ku mr nb ne nl nn pl pt pt_BR ro ru sk sl sv th tl uk vi zh_CN zh_TW
++ar bg bs ca cs cy da de dz el en_GB es eu fi fr gl he hu it ja km ku mr nb ne nl nn pl pt pt_BR ro ru sk sl sv th tl uk vi zh_CN zh_TW
diff --git a/packages/apt/apt-0.7.14/noconfigure.patch b/packages/apt/apt-0.7.14/noconfigure.patch
new file mode 100644
index 0000000000..682a96da24
--- /dev/null
+++ b/packages/apt/apt-0.7.14/noconfigure.patch
@@ -0,0 +1,35 @@
+---
+ apt-pkg/packagemanager.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- apt-0.6.45exp2.orig/apt-pkg/packagemanager.cc
++++ apt-0.6.45exp2/apt-pkg/packagemanager.cc
+@@ -534,10 +534,12 @@ bool pkgPackageManager::SmartUnPack(PkgI
+
+ List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
+
++#if 0
+ // Perform immedate configuration of the package.
+ if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
+ if (SmartConfigure(Pkg) == false)
+ return _error->Error("Internal Error, Could not perform immediate configuration (2) on %s",Pkg.Name());
++#endif
+
+ return true;
+ }
+@@ -609,6 +611,7 @@ pkgPackageManager::OrderResult pkgPackag
+ DoneSomething = true;
+ }
+
++#if 0
+ // Final run through the configure phase
+ if (ConfigureAll() == false)
+ return Failed;
+@@ -623,6 +626,7 @@ pkgPackageManager::OrderResult pkgPackag
+ return Failed;
+ }
+ }
++#endif
+
+ return Completed;
+ }
diff --git a/packages/apt/apt-0.7.14/nodoc.patch b/packages/apt/apt-0.7.14/nodoc.patch
new file mode 100644
index 0000000000..db8cf93717
--- /dev/null
+++ b/packages/apt/apt-0.7.14/nodoc.patch
@@ -0,0 +1,19 @@
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- apt-0.7.14.orig/Makefile
++++ apt-0.7.14/Makefile
+@@ -15,11 +15,11 @@ all headers library clean veryclean bina
+ $(MAKE) -C apt-inst $@
+ $(MAKE) -C methods $@
+ $(MAKE) -C cmdline $@
+ $(MAKE) -C ftparchive $@
+ $(MAKE) -C dselect $@
+- $(MAKE) -C doc $@
++# $(MAKE) -C doc $@
+ $(MAKE) -C po $@
+
+ # Some very common aliases
+ .PHONY: maintainer-clean dist-clean distclean pristine sanity
+ maintainer-clean dist-clean distclean pristine sanity: veryclean
diff --git a/packages/apt/apt-0.7.14/use-host.patch b/packages/apt/apt-0.7.14/use-host.patch
new file mode 100644
index 0000000000..894a697661
--- /dev/null
+++ b/packages/apt/apt-0.7.14/use-host.patch
@@ -0,0 +1,44 @@
+---
+ buildlib/sizetable | 4 +++-
+ configure.in | 2 +-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- apt-0.7.14.orig/buildlib/sizetable
++++ apt-0.7.14/buildlib/sizetable
+@@ -9,16 +9,19 @@
+ #
+ # This is used primarily for the MD5 algorithm.
+ # The format is:-
+ # CPU endian sizeof: char, int, short, long
+ i386 little 1 4 2 4
++i486 little 1 4 2 4
++i586 little 1 4 2 4
++i686 little 1 4 2 4
+ armeb big 1 4 2 4
+ arm little 1 4 2 4
+ alpha little 1 4 2 8
+ mipsel little 1 4 2 4
+ sparc big 1 4 2 4
+ sparc64 big 1 4 2 8
+ m68k big 1 4 2 4
+ powerpc big 1 4 2 4
+ mips big 1 4 2 4
+ hppa big 1 4 2 4
+-m32r big 1 4 2 4
+\ No newline at end of file
++m32r big 1 4 2 4
+--- apt-0.7.14.orig/configure.in
++++ apt-0.7.14/configure.in
+@@ -86,11 +86,11 @@ AC_SUBST(BDBLIB)
+ dnl Converts the ARCH to be something singular for this general CPU family
+ dnl This is often the dpkg architecture string.
+ dnl First check against the full canonical canoncial-system-type in $target
+ dnl and if that fails, just look for the cpu
+ AC_MSG_CHECKING(debian architecture)
+-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
++archset="`echo $host_alias|cut -d'-' -f1`"
+ if test "x$archset" = "x"; then
+ AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
+ fi
+ AC_MSG_RESULT($archset)
+ AC_DEFINE_UNQUOTED(COMMON_ARCH,"$archset")
diff --git a/packages/apt/apt-native.inc b/packages/apt/apt-native.inc
index 75cd8f47cd..6ee26e491a 100644
--- a/packages/apt/apt-native.inc
+++ b/packages/apt/apt-native.inc
@@ -1,10 +1,10 @@
require apt.inc
inherit native
-DEPENDS += "dpkg-native curl-native db-native"
+DEPENDS += "dpkg-native gettext-native"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/apt-${PV}"
PACKAGES = ""
-USE_NLS = "no"
+USE_NLS = "yes"
SRC_URI += "file://db_linking_hack.patch;patch=1"
@@ -37,7 +37,6 @@ do_stage_base () {
install -m 0755 bin/apt-get ${bindir}/
install -m 0755 bin/apt-config ${bindir}/
install -m 0755 bin/apt-cache ${bindir}/
- install -m 0755 bin/apt-ftparchive ${bindir}/
install -m 0755 bin/apt-sortpkgs ${bindir}/
install -m 0755 bin/apt-extracttemplates ${bindir}/
@@ -60,4 +59,6 @@ do_stage_base () {
install -d ${sysconfdir}/apt
install -d ${localstatedir}/lib/apt/lists/partial
install -d ${localstatedir}/cache/apt/archives/partial
+
+ install -d ${localstatedir}/log/apt/
}
diff --git a/packages/apt/apt-native_0.7.14.bb b/packages/apt/apt-native_0.7.14.bb
new file mode 100644
index 0000000000..268e9df720
--- /dev/null
+++ b/packages/apt/apt-native_0.7.14.bb
@@ -0,0 +1,7 @@
+require apt-native.inc
+
+PR = "r2"
+
+SRC_URI += "file://nodoc.patch;patch=1 \
+ file://noconfigure.patch;patch=1 \
+ file://no-curl.patch;patch=1"
diff --git a/packages/apt/apt-package.inc b/packages/apt/apt-package.inc
index 605eb956af..2b4f6d54a8 100644
--- a/packages/apt/apt-package.inc
+++ b/packages/apt/apt-package.inc
@@ -58,7 +58,7 @@ FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
${libdir}/apt ${libdir}/libapt*.so.* \
${localstatedir} ${sysconfdir} \
${libdir}/dpkg"
-FILES_${PN}-dbg += = "${libdir}/apt/*/.debug"
+FILES_${PN}-dbg += "${libdir}/apt/*/.debug"
FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, bb.data.getVar('apt-manpages', d, 1))} \
${docdir}/apt"
diff --git a/packages/apt/apt.inc b/packages/apt/apt.inc
index 92507be188..5c49887be8 100644
--- a/packages/apt/apt.inc
+++ b/packages/apt/apt.inc
@@ -1,11 +1,10 @@
DESCRIPTION = "Advanced front-end for dpkg."
LICENSE = "GPL"
SECTION = "base"
-DEPENDS = "curl db"
-RDEPENDS = "dpkg"
SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/apt_${PV}.tar.gz \
file://environment.patch;patch=1"
+
S = "${WORKDIR}/apt-${PV}"
inherit autotools gettext
diff --git a/packages/apt/apt_0.7.14.bb b/packages/apt/apt_0.7.14.bb
new file mode 100644
index 0000000000..251ed6416d
--- /dev/null
+++ b/packages/apt/apt_0.7.14.bb
@@ -0,0 +1,27 @@
+DEPENDS = "curl db"
+RDEPENDS = "dpkg"
+
+require apt.inc
+
+SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/apt_${PV}.tar.gz \
+ file://no-ko-translation.patch;patch=1 \
+ file://use-host.patch;patch=1 "
+PR = "r2"
+
+SRC_URI += "file://nodoc.patch;patch=1"
+
+require apt-package.inc
+
+FILES_${PN} += "${bindir}/apt-key"
+apt-manpages += "doc/apt-key.8"
+
+do_stage() {
+ install -d ${STAGING_LIBDIR} ${STAGING_INCDIR}/apt-pkg
+ eval `cat environment.mak | grep ^GLIBC_VER | sed -e's, = ,=,'`
+ oe_libinstall -so -C bin libapt-pkg$GLIBC_VER-6 ${STAGING_LIBDIR}/
+ ln -sf libapt-pkg$GLIBC_VER-6.so ${STAGING_LIBDIR}/libapt-pkg.so
+ oe_libinstall -so -C bin libapt-inst$GLIBC_VER-6 ${STAGING_LIBDIR}/
+ ln -sf libapt-inst$GLIBC_VER-6.so ${STAGING_LIBDIR}/libapt-inst.so
+
+ install -m 0644 include/apt-pkg/*.h ${STAGING_INCDIR}/apt-pkg/
+}
diff --git a/packages/apt/files/no-curl.patch b/packages/apt/files/no-curl.patch
new file mode 100644
index 0000000000..4e07c8f2dc
--- /dev/null
+++ b/packages/apt/files/no-curl.patch
@@ -0,0 +1,44 @@
+---
+ configure.in | 6 ------
+ methods/makefile | 7 -------
+ 2 files changed, 13 deletions(-)
+
+--- apt-0.7.14.orig/configure.in
++++ apt-0.7.14/configure.in
+@@ -84,16 +84,10 @@ AC_CHECK_HEADER(db.h,
+ )]
+ )
+
+ LIBS="$saveLIBS"
+
+-AC_CHECK_LIB(curl, curl_easy_init,
+- [AC_CHECK_HEADER(curl/curl.h,
+- curl_ok=yes,
+- curl_ok=no)],
+- AC_MSG_ERROR([failed: I need CURL due https support]),
+-)
+
+ AC_SUBST(BDBLIB)
+
+ dnl Converts the ARCH to be something singular for this general CPU family
+ dnl This is often the dpkg architecture string.
+--- apt-0.7.14.orig/methods/makefile
++++ apt-0.7.14/methods/makefile
+@@ -50,17 +50,10 @@ PROGRAM=http
+ SLIBS = -lapt-pkg $(SOCKETLIBS)
+ LIB_MAKES = apt-pkg/makefile
+ SOURCE = http.cc rfc2553emu.cc connect.cc
+ include $(PROGRAM_H)
+
+-# The https method
+-PROGRAM=https
+-SLIBS = -lapt-pkg -lcurl
+-LIB_MAKES = apt-pkg/makefile
+-SOURCE = https.cc
+-include $(PROGRAM_H)
+-
+ # The ftp method
+ PROGRAM=ftp
+ SLIBS = -lapt-pkg $(SOCKETLIBS)
+ LIB_MAKES = apt-pkg/makefile
+ SOURCE = ftp.cc rfc2553emu.cc connect.cc
diff --git a/packages/dpkg/dpkg-1.14.19/ignore_extra_fields.patch b/packages/dpkg/dpkg-1.14.19/ignore_extra_fields.patch
new file mode 100644
index 0000000000..d09343c6e5
--- /dev/null
+++ b/packages/dpkg/dpkg-1.14.19/ignore_extra_fields.patch
@@ -0,0 +1,26 @@
+ dpkg-deb/build.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- dpkg-1.14.19.orig/dpkg-deb/build.c
++++ dpkg-1.14.19/dpkg-deb/build.c
+@@ -241,18 +241,18 @@ void do_build(const char *const *argv) {
+ if (checkedinfo->priority == pri_other) {
+ fprintf(stderr, _("warning, `%s' contains user-defined Priority value `%s'\n"),
+ controlfile, checkedinfo->otherpriority);
+ warns++;
+ }
+- for (field= checkedinfo->available.arbs; field; field= field->next) {
++ /*for (field= checkedinfo->available.arbs; field; field= field->next) {
+ if (known_arbitrary_field(field))
+ continue;
+
+ fprintf(stderr, _("warning, `%s' contains user-defined field `%s'\n"),
+ controlfile, field->name);
+ warns++;
+- }
++ }*/
+ checkversion(checkedinfo->available.version.version,"(upstream) version",&errs);
+ checkversion(checkedinfo->available.version.revision,"Debian revision",&errs);
+ if (errs) ohshit(_("%d errors in control file"),errs);
+
+ if (subdir) {
diff --git a/packages/dpkg/dpkg-native_1.13.22.bb b/packages/dpkg/dpkg-native_1.13.22.bb
index 7087f1f90a..5dcf53c164 100644
--- a/packages/dpkg/dpkg-native_1.13.22.bb
+++ b/packages/dpkg/dpkg-native_1.13.22.bb
@@ -1,5 +1,5 @@
require dpkg.inc
-PR = "r3"
+PR = "r4"
DEPENDS += "zlib-native virtual/update-alternatives-native"
SRC_URI += "file://noman.patch;patch=1"
@@ -10,4 +10,5 @@ EXTRA_OECONF = "--without-static-progs \
--with-start-stop-daemon \
--with-zlib \
--with-bz2lib \
+ --without-selinux \
--without-sgml-doc"
diff --git a/packages/dpkg/dpkg-native_1.14.19.bb b/packages/dpkg/dpkg-native_1.14.19.bb
new file mode 100644
index 0000000000..f8d6705bb7
--- /dev/null
+++ b/packages/dpkg/dpkg-native_1.14.19.bb
@@ -0,0 +1,15 @@
+require dpkg.inc
+DEPENDS += "bzip2-native zlib-native virtual/update-alternatives-native"
+SRC_URI += "file://noman.patch;patch=1"
+
+FILESPATH += "dpkg-${PV}"
+
+inherit native
+
+EXTRA_OECONF = "--without-static-progs \
+ --without-dselect \
+ --with-start-stop-daemon \
+ --with-zlib \
+ --with-bz2lib \
+ --without-selinux \
+ --without-sgml-doc"
diff --git a/packages/dpkg/dpkg.inc b/packages/dpkg/dpkg.inc
index 1065f2c186..eb5778fa3b 100644
--- a/packages/dpkg/dpkg.inc
+++ b/packages/dpkg/dpkg.inc
@@ -10,6 +10,8 @@ S = "${WORKDIR}/dpkg-${PV}"
DEPENDS_${PN} += "update-alternatives"
+RDEPENDS += "perl perl-module-base perl-module-carp perl-module-cwd perl-module-english perl-module-exporter perl-module-exporter-heavy perl-module-fcntl perl-module-file-spec-unix perl-module-file-temp perl-module-io perl-module-io-handle perl-module-posix perl-module-strict perl-module-vars perl-module-warnings perl-module-warnings-register perl-module-autoloader perl-module-config perl-module-constant perl-module-errno perl-module-file-basename perl-module-file-path perl-module-file-spec perl-module-overload perl-module-selectsaver perl-module-symbol perl-module-xsloader"
+
PARALLEL_MAKE = ""
inherit autotools gettext
@@ -24,6 +26,7 @@ if [ "x$D" != "x" ]; then
# this happens at S98 where our good 'ole packages script used to run
printf "#!/bin/sh
dpkg --configure -a
+ rm -f /${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
\n" > ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
chmod 0755 ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
fi
diff --git a/packages/dpkg/dpkg_1.13.22.bb b/packages/dpkg/dpkg_1.13.22.bb
index fb301a6db9..e4e7a3b279 100644
--- a/packages/dpkg/dpkg_1.13.22.bb
+++ b/packages/dpkg/dpkg_1.13.22.bb
@@ -1,6 +1,6 @@
require dpkg.inc
-PR = "r4"
-DEPENDS += "ncurses zlib bzip2"
+PR = "r5"
+DEPENDS += "zlib bzip2"
SRC_URI += "file://noman.patch;patch=1"
EXTRA_OECONF = "--without-static-progs \
diff --git a/packages/dpkg/dpkg_1.13.25.bb b/packages/dpkg/dpkg_1.13.25.bb
index a0bb1dcf47..8a2c8abae0 100644
--- a/packages/dpkg/dpkg_1.13.25.bb
+++ b/packages/dpkg/dpkg_1.13.25.bb
@@ -1,6 +1,6 @@
require dpkg.inc
-PR = "r0"
-DEPENDS += "ncurses zlib bzip2"
+PR = "r1"
+DEPENDS += "zlib bzip2"
SRC_URI += "file://noman.patch;patch=1"
EXTRA_OECONF = "--without-static-progs \
diff --git a/packages/dpkg/dpkg_1.14.19.bb b/packages/dpkg/dpkg_1.14.19.bb
new file mode 100644
index 0000000000..0377ce10f1
--- /dev/null
+++ b/packages/dpkg/dpkg_1.14.19.bb
@@ -0,0 +1,12 @@
+require dpkg.inc
+PR = "r1"
+DEPENDS += "zlib bzip2"
+#RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives}"
+SRC_URI += "file://noman.patch;patch=1"
+
+EXTRA_OECONF = "--without-static-progs \
+ --without-dselect \
+ --with-start-stop-daemon \
+ --with-zlib \
+ --with-bz2lib \
+ --without-sgml-doc"
diff --git a/packages/dsplink/codec-engine_2.21.bb b/packages/dsplink/codec-engine_2.21.bb
index 2e79e78eea..4cb227ed23 100644
--- a/packages/dsplink/codec-engine_2.21.bb
+++ b/packages/dsplink/codec-engine_2.21.bb
@@ -161,7 +161,7 @@ do_stage() {
INHIBIT_PACKAGE_STRIP = "1"
PACKAGES =+ "ti-cmemk-module"
-FILES_cmemk-module = "${sysconfdir} /lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/cmemk.ko"
+FILES_ti-cmemk-module = "${sysconfdir} /lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/cmemk.ko"
pkg_postinst_ti-cmemk-module () {
if [ -n "$D" ]; then
diff --git a/packages/dsplink/ti-cmemk-module_2.21.bb b/packages/dsplink/ti-cmemk-module_2.21.bb
new file mode 100644
index 0000000000..82e5fb61e4
--- /dev/null
+++ b/packages/dsplink/ti-cmemk-module_2.21.bb
@@ -0,0 +1,83 @@
+DESCRIPTION = "Codec Engine for TI ARM/DSP processors - cmemk module"
+
+DEPENDS = "virtual/kernel perl-native"
+RDEPENDS = "update-modules"
+
+inherit module
+
+# tconf from xdctools dislikes '.' in pwd :/
+PR = "r1"
+PV = "221"
+
+# Get CE tarball from TI website, place in sources and calculate
+# md5sum
+# Look for tarball at https://www-a.ti.com/downloads/sds_support/targetcontent/CE/index.html
+
+SRC_URI = "http://install.tarball.in.source.dir/codec_engine_2_21_00_06.tar.gz \
+ file://Makefile.dsplink \
+ "
+
+S = "${WORKDIR}/codec_engine_2_21_00_06"
+
+require ti-paths.inc
+
+export DSPLINK="${S}/cetools/packages/dsplink"
+
+PARALLEL_MAKE = ""
+
+
+do_compile() {
+ echo "MVTOOL_PREFIX=${TARGET_PREFIX}" > ${S}/Rules.make
+ echo "UCTOOL_PREFIX=${TARGET_PREFIX}" >> ${S}/Rules.make
+ echo "LINUXKERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR}" >> ${S}/Rules.make
+
+ # Build the cmem kernel module
+ # We unset CFLAGS because kernel modules need different ones, this is basically a verbatim copy of kernel.bbclass and module-base.bbclass
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ cd ${S}/cetools/packages/ti/sdo/linuxutils/cmem
+
+ oe_runmake clean
+ # We probably don't need to build all 3, but atm it doesn't hurt us
+ oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_SRC=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}" \
+ release
+ oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_SRC=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}" \
+ debug
+ oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_SRC=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}"
+
+}
+
+
+do_install() {
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+ cp ${S}/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+FILES_ti-cmemk-module = "${sysconfdir} /lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/cmemk.ko"
+
+pkg_postinst_ti-cmemk-module () {
+ if [ -n "$D" ]; then
+ exit 1
+ fi
+ depmod -a
+ update-modules || true
+}
+
+pkg_postrm_ti-cmemk-module () {
+ update-modules || true
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/packages/dsplink/ti-lpm-module_2.21.bb b/packages/dsplink/ti-lpm-module_2.21.bb
new file mode 100644
index 0000000000..cbbc5c8ce5
--- /dev/null
+++ b/packages/dsplink/ti-lpm-module_2.21.bb
@@ -0,0 +1,82 @@
+DESCRIPTION = "Codec Engine for TI ARM/DSP processors - power module"
+
+DEPENDS = "virtual/kernel perl-native dsplink"
+RDEPENDS = "update-modules"
+
+inherit module
+
+# tconf from xdctools dislikes '.' in pwd :/
+PR = "r1"
+PV = "221"
+
+# Get CE tarball from TI website, place in sources and calculate
+# md5sum
+# Look for tarball at https://www-a.ti.com/downloads/sds_support/targetcontent/CE/index.html
+
+SRC_URI = "http://install.tarball.in.source.dir/codec_engine_2_21_00_06.tar.gz \
+ file://Makefile.dsplink \
+ "
+
+S = "${WORKDIR}/codec_engine_2_21_00_06"
+
+require ti-paths.inc
+
+PARALLEL_MAKE = ""
+
+do_compile() {
+ echo "MVTOOL_PREFIX=${TARGET_PREFIX}" > ${S}/Rules.make
+ echo "UCTOOL_PREFIX=${TARGET_PREFIX}" >> ${S}/Rules.make
+ echo "LINUXKERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR}" >> ${S}/Rules.make
+
+ # Build the DSP power manager kernel module
+ cd ${S}/cetools/packages/ti/bios/power
+
+ # Unpack all kernel sources for the DSP power manager module
+ for dsp in $(ls | grep bld | awk -F, '{print $2}' | awk -F_ '{print $1}') ; do
+ if ! [ -e $dsp ] ; then tar xf ti_bios_power,${dsp}_bld.tar ; fi
+ done
+
+ cd ${DSPPOWERSOC}/lpm
+
+ export KERNEL_DIR=${STAGING_KERNEL_DIR}
+ export TOOL_PREFIX=${TARGET_PREFIX}
+
+ # Different SoCs use different toolchains by default, we just want them to use the OE one, so replace the entries because they can't be overloaded within the environment
+ sed -i -e s:/db/toolsrc/library/tools/vendors/mvl/arm/omap3/OMAP35x_SDK_0.9.7/src/linux/kernel_org/2.6_kernel:${STAGING_KERNEL_DIR}:g \
+ -e s:/db/toolsrc/library/tools/vendors/cs/arm/arm-2007q3/bin/arm-none-linux-gnueabi-:${TARGET_PREFIX}:g \
+ -e s:/db/atree/library/trees/power/power-d02x/imports:${STAGING_DIR}/${MULTIMACH_TARGET_SYS}:g \
+ -e s:/db/toolsrc/library/tools/vendors/mvl/arm/dm6446/REL_LSP_02_00_00_010/montavista/pro/devkit/lsp/ti-davinci/linux-2.6.18_pro500:${STAGING_KERNEL_DIR}:g \
+ -e s:/db/toolsrc/library/tools/vendors/mvl/arm/mvl5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-:${TARGET_PREFIX}:g \
+ Makefile
+
+ oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_SRC=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}"
+}
+
+
+do_install() {
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+ cp ${S}/cetools/packages/ti/bios/power/${DSPPOWERSOC}/lpm/*.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp || true
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+FILES_ti-lpm-module = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/*lpm*ko"
+
+pkg_postinst_ti-lpm-module () {
+ if [ -n "$D" ]; then
+ exit 1
+ fi
+ depmod -a
+ update-modules || true
+}
+
+pkg_postrm_ti-lpm-module () {
+ update-modules || true
+}
+
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/packages/mamona/bash-noemu-3.2/006-add_internal_libcpwd_functions.patch b/packages/mamona/bash-noemu-3.2/006-add_internal_libcpwd_functions.patch
new file mode 100644
index 0000000000..c0f501dcbc
--- /dev/null
+++ b/packages/mamona/bash-noemu-3.2/006-add_internal_libcpwd_functions.patch
@@ -0,0 +1,752 @@
+Index: bash-3.2/libcnisint.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ bash-3.2/libcnisint.c 2008-08-01 17:52:42.000000000 -0300
+@@ -0,0 +1,296 @@
++#include "libcnisint.h"
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <errno.h>
++#include <string.h>
++
++# undef ENTDATA
++
++struct parser_data
++ {
++#ifdef ENTDATA
++ struct ENTDATA entdata;
++# define ENTDATA_DECL(data) struct ENTDATA *const entdata = &data->entdata;
++#else
++# define ENTDATA_DECL(data)
++#endif
++ char linebuffer[0];
++ };
++
++
++static FILE *stream = NULL;
++static struct passwd passwd;
++static char buffer[NSS_BUFLEN_PASSWD];
++
++# define STRING_FIELD(variable, terminator_p, swallow) \
++ { \
++ variable = line; \
++ while (*line != '\0' && !terminator_p (*line)) \
++ ++line; \
++ if (*line != '\0') \
++ { \
++ *line = '\0'; \
++ do \
++ ++line; \
++ while (swallow && terminator_p (*line)); \
++ } \
++ }
++
++# define STRUCTURE passwd
++# define TRAILING_LIST_PARSER
++
++# define LINE_PARSER(EOLSET, BODY) \
++int parse_line (char *line, struct STRUCTURE *result, \
++ struct parser_data *data, size_t datalen) \
++{ \
++ ENTDATA_DECL (data) \
++ char *p = strpbrk (line, EOLSET "\n"); \
++ if (p != NULL) \
++ *p = '\0'; \
++ BODY; \
++ TRAILING_LIST_PARSER; \
++ return 1; \
++}
++
++# define INT_FIELD_MAYBE_NULL(variable, terminator_p, swallow, base, convert, default) \
++ { \
++ char *endp; \
++ if (*line == '\0') \
++ /* We expect some more input, so don't allow the string to end here. */ \
++ return 0; \
++ variable = convert (strtoul (line, &endp, base)); \
++ if (endp == line) \
++ variable = default; \
++ if (terminator_p (*endp)) \
++ do \
++ ++endp; \
++ while (swallow && terminator_p (*endp)); \
++ else if (*endp != '\0') \
++ return 0; \
++ line = endp; \
++ }
++
++# define INT_FIELD(variable, terminator_p, swallow, base, convert) \
++ { \
++ char *endp; \
++ variable = convert (strtoul (line, &endp, base)); \
++ if (endp == line) \
++ return 0; \
++ else if (terminator_p (*endp)) \
++ do \
++ ++endp; \
++ while (swallow && terminator_p (*endp)); \
++ else if (*endp != '\0') \
++ return 0; \
++ line = endp; \
++ }
++
++# define ISCOLON(c) ((c) == ':')
++
++LINE_PARSER (,
++ STRING_FIELD (result->pw_name, ISCOLON, 0)
++ if (line[0] == '\0'
++ && (result->pw_name[0] == '+' || result->pw_name[0] == '-'))
++ {
++ /* This a special case. We allow lines containing only a `+' sign
++ since this is used for nss_compat. All other services will
++ reject this entry later. Initialize all other fields now. */
++ result->pw_passwd = NULL;
++ result->pw_uid = 0;
++ result->pw_gid = 0;
++ result->pw_gecos = NULL;
++ result->pw_dir = NULL;
++ result->pw_shell = NULL;
++ }
++ else
++ {
++ STRING_FIELD (result->pw_passwd, ISCOLON, 0)
++ if (result->pw_name[0] == '+' || result->pw_name[0] == '-')
++ {
++ INT_FIELD_MAYBE_NULL (result->pw_uid, ISCOLON, 0, 10, , 0)
++ INT_FIELD_MAYBE_NULL (result->pw_gid, ISCOLON, 0, 10, , 0)
++ }
++ else
++ {
++ INT_FIELD (result->pw_uid, ISCOLON, 0, 10,)
++ INT_FIELD (result->pw_gid, ISCOLON, 0, 10,)
++ }
++ STRING_FIELD (result->pw_gecos, ISCOLON, 0)
++ STRING_FIELD (result->pw_dir, ISCOLON, 0)
++ result->pw_shell = line;
++ }
++ )
++
++
++void internal_setpwent (void)
++{
++ if (stream == NULL)
++ {
++ stream = fopen ("/etc/passwd", "rme");
++
++ if (stream == NULL)
++ fprintf (stderr, "ERROR: Cannot fopen \"/etc/passwd\". Errno: %d", errno);
++ }
++ else
++ rewind (stream);
++
++}
++
++void internal_endpwent (void)
++{
++ if (stream != NULL)
++ {
++ fclose (stream);
++ stream = NULL;
++ }
++}
++
++struct passwd *internal_getpwent (void)
++{
++ struct parser_data *data = (void *) &buffer;
++ struct passwd *result = &passwd;
++ int buflen = NSS_BUFLEN_PASSWD;
++
++ while (1)
++ {
++ fpos_t pos;
++ char *p;
++ int parse_res;
++
++ do
++ {
++ /* We need at least 3 characters for one line. */
++ if (buflen < 3)
++ {
++ erange:
++ fprintf (stderr, "ERROR: Range error");
++ return NULL;
++ }
++
++ fgetpos (stream, &pos);
++ buffer[buflen - 1] = '\xff';
++ p = fgets (buffer, buflen, stream);
++ if (p == NULL && feof (stream))
++ return NULL;
++
++ if (p == NULL || buffer[buflen - 1] != '\xff')
++ {
++ erange_reset:
++ fsetpos (stream, &pos);
++ goto erange;
++ }
++
++ /* Terminate the line for any case. */
++ buffer[buflen - 1] = '\0';
++
++ /* Skip leading blanks. */
++ while (isspace (*p))
++ ++p;
++ }
++ while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
++ /* Parse the line. If it is invalid, loop to
++ get the next line of the file to parse. */
++ !(parse_res = parse_line (p, result, data, buflen)));
++
++ if (parse_res == -1)
++ /* The parser ran out of space. */
++ goto erange_reset;
++
++ if (result->pw_name[0] != '+' && result->pw_name[0] != '-')
++ /* This is a real entry. */
++ break;
++
++ /* XXX Ignoring
++ *
++ * -@netgroup
++ * +@netgroup
++ * -user
++ * +user
++ * +:...
++ *
++ * as we don't suppose to use them */
++
++ }
++
++ return result;
++
++}
++
++/* Searches in /etc/passwd and the NSS subsystem for a special user id */
++struct passwd *internal_getpwuid (uid_t uid)
++{
++ struct parser_data *data = (void *) buffer;
++ struct passwd *result = &passwd;
++ int buflen = NSS_BUFLEN_PASSWD;
++
++ internal_setpwent ();
++
++ while (1)
++ {
++ fpos_t pos;
++ char *p;
++ int parse_res;
++
++ do
++ {
++ /* We need at least 3 characters for one line. */
++ if (buflen < 3)
++ {
++ erange:
++ fprintf (stderr, "ERROR: Range error");
++ return NULL;
++ }
++
++ fgetpos (stream, &pos);
++ buffer[buflen - 1] = '\xff';
++ p = fgets (buffer, buflen, stream);
++ if (p == NULL && feof (stream))
++ return NULL;
++
++ if (p == NULL || buffer[buflen - 1] != '\xff')
++ {
++ erange_reset:
++ fsetpos (stream, &pos);
++ goto erange;
++ }
++
++ /* Terminate the line for any case. */
++ buffer[buflen - 1] = '\0';
++
++ /* Skip leading blanks. */
++ while (isspace (*p))
++ ++p;
++ }
++ while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
++ /* Parse the line. If it is invalid, loop to
++ get the next line of the file to parse. */
++ !(parse_res = parse_line (p, result, data, buflen)));
++
++ if (parse_res == -1)
++ /* The parser ran out of space. */
++ goto erange_reset;
++
++ /* This is a real entry. */
++ if (result->pw_name[0] != '+' && result->pw_name[0] != '-')
++ {
++ if (result->pw_uid == uid)
++ return result;
++ else
++ continue;
++ }
++
++ /* XXX Ignoring
++ *
++ * -@netgroup
++ * +@netgroup
++ * -user
++ * +user
++ * +:...
++ *
++ * as we don't suppose to use them */
++
++ }
++ internal_endpwent ();
++ return result;
++}
+Index: bash-3.2/libcnisint.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ bash-3.2/libcnisint.h 2008-08-01 17:18:20.000000000 -0300
+@@ -0,0 +1,7 @@
++#include <pwd.h>
++
++void internal_setpwent (void);
++void internal_endpwent (void);
++struct passwd *internal_getpwent (void);
++struct passwd *internal_getpwuid (uid_t uid);
++
+Index: bash-3.2/examples/loadables/finfo.c
+===================================================================
+--- bash-3.2.orig/examples/loadables/finfo.c 2008-08-01 14:29:55.000000000 -0300
++++ bash-3.2/examples/loadables/finfo.c 2008-08-01 15:32:37.000000000 -0300
+@@ -9,7 +9,6 @@
+ #include <sys/types.h>
+ #include "posixstat.h"
+ #include <stdio.h>
+-#include <pwd.h>
+ #include <grp.h>
+ #include <errno.h>
+
+@@ -18,6 +17,8 @@
+ #include "builtins.h"
+ #include "common.h"
+
++#include "libcnisint.h"
++
+ #ifndef errno
+ extern int errno;
+ #endif
+@@ -262,7 +263,7 @@
+ printf("Mode: (%o) ", (int) st->st_mode);
+ printmode((int) st->st_mode);
+ printf("Link count: %d\n", (int) st->st_nlink);
+- pw = getpwuid(st->st_uid);
++ pw = internal_getpwuid(st->st_uid);
+ owner = pw ? pw->pw_name : "unknown";
+ printf("Uid of owner: %d (%s)\n", (int) st->st_uid, owner);
+ gr = getgrgid(st->st_gid);
+@@ -341,7 +342,7 @@
+ else if (flags & OPT_PMASK)
+ printf("%o\n", getperm(st->st_mode) & pmask);
+ else if (flags & OPT_UID) {
+- pw = getpwuid(st->st_uid);
++ pw = internal_getpwuid(st->st_uid);
+ if (flags & OPT_ASCII)
+ printf("%s\n", pw ? pw->pw_name : "unknown");
+ else
+Index: bash-3.2/examples/loadables/id.c
+===================================================================
+--- bash-3.2.orig/examples/loadables/id.c 2008-08-01 14:17:24.000000000 -0300
++++ bash-3.2/examples/loadables/id.c 2008-08-01 14:51:23.000000000 -0300
+@@ -12,7 +12,6 @@
+ #include <config.h>
+ #include <stdio.h>
+ #include "bashtypes.h"
+-#include <pwd.h>
+ #include <grp.h>
+ #include "bashansi.h"
+
+@@ -22,9 +21,8 @@
+ # include <sys/param.h>
+ #endif
+
+-#if !defined (HAVE_GETPW_DECLS)
+-extern struct passwd *getpwuid ();
+-#endif
++#include "libcnisint.h"
++
+ extern struct group *getgrgid ();
+
+ #include "shell.h"
+@@ -152,7 +150,7 @@
+ r = 0;
+ if (id_flags & ID_USENAME)
+ {
+- pwd = getpwuid (uid);
++ pwd = internal_getpwuid (uid);
+ if (pwd == NULL)
+ r = 1;
+ }
+@@ -233,7 +231,7 @@
+
+ r = 0;
+ printf ("uid=%u", (unsigned) ruid);
+- pwd = getpwuid (ruid);
++ pwd = internal_getpwuid (ruid);
+ if (pwd == NULL)
+ r = 1;
+ else
+@@ -249,7 +247,7 @@
+ if (euid != ruid)
+ {
+ printf (" euid=%u", (unsigned) euid);
+- pwd = getpwuid (euid);
++ pwd = internal_getpwuid (euid);
+ if (pwd == NULL)
+ r = 1;
+ else
+Index: bash-3.2/lib/readline/complete.c
+===================================================================
+--- bash-3.2.orig/lib/readline/complete.c 2008-07-31 19:06:06.000000000 -0300
++++ bash-3.2/lib/readline/complete.c 2008-08-01 15:52:25.000000000 -0300
+@@ -48,9 +48,7 @@
+ extern int errno;
+ #endif /* !errno */
+
+-#if defined (HAVE_PWD_H)
+-#include <pwd.h>
+-#endif
++#include "libcnisint.h"
+
+ #include "posixdir.h"
+ #include "posixstat.h"
+@@ -79,12 +77,6 @@
+ /* Unix version of a hidden file. Could be different on other systems. */
+ #define HIDDEN_FILE(fname) ((fname)[0] == '.')
+
+-/* Most systems don't declare getpwent in <pwd.h> if _POSIX_SOURCE is
+- defined. */
+-#if defined (HAVE_GETPWENT) && (!defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE))
+-extern struct passwd *getpwent PARAMS((void));
+-#endif /* HAVE_GETPWENT && (!HAVE_GETPW_DECLS || _POSIX_SOURCE) */
+-
+ /* If non-zero, then this is the address of a function to call when
+ completing a word would normally display the list of possible matches.
+ This function is called instead of actually doing the display.
+@@ -1849,24 +1841,19 @@
+
+ username = savestring (&text[first_char_loc]);
+ namelen = strlen (username);
+- setpwent ();
++ internal_setpwent ();
+ }
+
+-#if defined (HAVE_GETPWENT)
+- while (entry = getpwent ())
++ while (entry = internal_getpwent ())
+ {
+ /* Null usernames should result in all users as possible completions. */
+ if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
+ break;
+ }
+-#endif
+
+ if (entry == 0)
+ {
+-#if defined (HAVE_GETPWENT)
+- endpwent ();
+-#endif
+- return ((char *)NULL);
++ internal_endpwent ();
+ }
+ else
+ {
+Index: bash-3.2/lib/readline/shell.c
+===================================================================
+--- bash-3.2.orig/lib/readline/shell.c 2008-08-01 14:44:38.000000000 -0300
++++ bash-3.2/lib/readline/shell.c 2008-08-01 15:36:03.000000000 -0300
+@@ -51,9 +51,8 @@
+ #if defined (HAVE_FCNTL_H)
+ #include <fcntl.h>
+ #endif
+-#if defined (HAVE_PWD_H)
+-#include <pwd.h>
+-#endif
++
++#include "libcnisint.h"
+
+ #include <stdio.h>
+
+@@ -61,10 +60,6 @@
+ #include "rlshell.h"
+ #include "xmalloc.h"
+
+-#if defined (HAVE_GETPWUID) && !defined (HAVE_GETPW_DECLS)
+-extern struct passwd *getpwuid PARAMS((uid_t));
+-#endif /* HAVE_GETPWUID && !HAVE_GETPW_DECLS */
+-
+ #ifndef NULL
+ # define NULL 0
+ #endif
+@@ -163,11 +158,9 @@
+ struct passwd *entry;
+
+ home_dir = (char *)NULL;
+-#if defined (HAVE_GETPWUID)
+- entry = getpwuid (getuid ());
++ entry = internal_getpwuid (getuid ());
+ if (entry)
+ home_dir = entry->pw_dir;
+-#endif
+ return (home_dir);
+ }
+
+Index: bash-3.2/lib/readline/tilde.c
+===================================================================
+--- bash-3.2.orig/lib/readline/tilde.c 2008-07-31 19:09:19.000000000 -0300
++++ bash-3.2/lib/readline/tilde.c 2008-08-01 15:51:52.000000000 -0300
+@@ -42,10 +42,7 @@
+ # include "ansi_stdlib.h"
+ #endif /* HAVE_STDLIB_H */
+
+-#include <sys/types.h>
+-#if defined (HAVE_PWD_H)
+-#include <pwd.h>
+-#endif
++#include "libcnisint.h"
+
+ #include "tilde.h"
+
+@@ -56,9 +53,6 @@
+ #endif /* TEST || STATIC_MALLOC */
+
+ #if !defined (HAVE_GETPW_DECLS)
+-# if defined (HAVE_GETPWUID)
+-extern struct passwd *getpwuid PARAMS((uid_t));
+-# endif
+ # if defined (HAVE_GETPWNAM)
+ extern struct passwd *getpwnam PARAMS((const char *));
+ # endif
+@@ -409,15 +403,11 @@
+ if (dirname == 0)
+ dirname = savestring (filename);
+ }
+-#if defined (HAVE_GETPWENT)
+ else
+ dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
+-#endif
+
+ free (username);
+-#if defined (HAVE_GETPWENT)
+- endpwent ();
+-#endif
++ internal_endpwent ();
+ return (dirname);
+ }
+
+Index: bash-3.2/lib/tilde/shell.c
+===================================================================
+--- bash-3.2.orig/lib/tilde/shell.c 2008-08-01 14:41:32.000000000 -0300
++++ bash-3.2/lib/tilde/shell.c 2008-08-01 15:32:49.000000000 -0300
+@@ -43,11 +43,7 @@
+ # include <strings.h>
+ #endif /* !HAVE_STRING_H */
+
+-#include <pwd.h>
+-
+-#if !defined (HAVE_GETPW_DECLS)
+-extern struct passwd *getpwuid ();
+-#endif /* !HAVE_GETPW_DECLS */
++#include "libcnisint.h"
+
+ char *
+ get_env_value (varname)
+@@ -63,7 +59,7 @@
+ struct passwd *entry;
+
+ home_dir = (char *)NULL;
+- entry = getpwuid (getuid ());
++ entry = internal_getpwuid (getuid ());
+ if (entry)
+ home_dir = entry->pw_dir;
+ return (home_dir);
+Index: bash-3.2/lib/tilde/tilde.c
+===================================================================
+--- bash-3.2.orig/lib/tilde/tilde.c 2008-08-01 15:41:27.000000000 -0300
++++ bash-3.2/lib/tilde/tilde.c 2008-08-01 15:51:13.000000000 -0300
+@@ -43,9 +43,8 @@
+ #endif /* HAVE_STDLIB_H */
+
+ #include <sys/types.h>
+-#if defined (HAVE_PWD_H)
+-#include <pwd.h>
+-#endif
++
++#include "libcnisint.h"
+
+ #include "tilde.h"
+
+@@ -56,9 +55,6 @@
+ #endif /* TEST || STATIC_MALLOC */
+
+ #if !defined (HAVE_GETPW_DECLS)
+-# if defined (HAVE_GETPWUID)
+-extern struct passwd *getpwuid PARAMS((uid_t));
+-# endif
+ # if defined (HAVE_GETPWNAM)
+ extern struct passwd *getpwnam PARAMS((const char *));
+ # endif
+@@ -409,15 +405,11 @@
+ if (dirname == 0)
+ dirname = savestring (filename);
+ }
+-#if defined (HAVE_GETPWENT)
+ else
+ dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
+-#endif
+
+ free (username);
+-#if defined (HAVE_GETPWENT)
+- endpwent ();
+-#endif
++ internal_endpwent ();
+ return (dirname);
+ }
+
+Index: bash-3.2/shell.c
+===================================================================
+--- bash-3.2.orig/shell.c 2008-07-31 19:10:00.000000000 -0300
++++ bash-3.2/shell.c 2008-08-01 15:46:10.000000000 -0300
+@@ -37,7 +37,8 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include "filecntl.h"
+-#include <pwd.h>
++
++#include "libcnisint.h"
+
+ #if defined (HAVE_UNISTD_H)
+ # include <unistd.h>
+@@ -78,10 +79,6 @@
+ # include <opennt/opennt.h>
+ #endif
+
+-#if !defined (HAVE_GETPW_DECLS)
+-extern struct passwd *getpwuid ();
+-#endif /* !HAVE_GETPW_DECLS */
+-
+ #if !defined (errno)
+ extern int errno;
+ #endif
+@@ -1586,7 +1583,7 @@
+ /* Don't fetch this more than once. */
+ if (current_user.user_name == 0)
+ {
+- entry = getpwuid (current_user.uid);
++ entry = internal_getpwuid (current_user.uid);
+ if (entry)
+ {
+ current_user.user_name = savestring (entry->pw_name);
+@@ -1602,7 +1599,7 @@
+ current_user.shell = savestring ("/bin/sh");
+ current_user.home_dir = savestring ("/");
+ }
+- endpwent ();
++ internal_endpwent ();
+ }
+ }
+
+Index: bash-3.2/config.h.in
+===================================================================
+--- bash-3.2.orig/config.h.in 2008-08-01 15:54:05.000000000 -0300
++++ bash-3.2/config.h.in 2008-08-01 15:54:34.000000000 -0300
+@@ -553,15 +553,9 @@
+ /* Define if you have the getpeername function. */
+ #undef HAVE_GETPEERNAME
+
+-/* Define if you have the getpwent function. */
+-#undef HAVE_GETPWENT
+-
+ /* Define if you have the getpwnam function. */
+ #undef HAVE_GETPWNAM
+
+-/* Define if you have the getpwuid function. */
+-#undef HAVE_GETPWUID
+-
+ /* Define if you have the getrlimit function. */
+ #undef HAVE_GETRLIMIT
+
+Index: bash-3.2/configure.in
+===================================================================
+--- bash-3.2.orig/configure.in 2008-08-01 15:55:19.000000000 -0300
++++ bash-3.2/configure.in 2008-08-01 15:56:12.000000000 -0300
+@@ -710,7 +710,7 @@
+
+ AC_CHECK_FUNCS(vsnprintf snprintf vasprintf asprintf)
+ AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)
+-AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
++AC_CHECK_FUNCS(getpwnam)
+ AC_REPLACE_FUNCS(getcwd memset strcasecmp strerror strftime strnlen strpbrk strstr)
+ AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax)
+
+@@ -790,12 +790,6 @@
+ BASH_FUNC_INET_ATON
+ fi
+
+-dnl libraries
+-dnl this is reportedly no longer necessary for irix[56].?
+-case "$host_os" in
+-irix4*) AC_CHECK_LIB(sun, getpwent) ;;
+-esac
+-
+ dnl check for getpeername in the socket library only if it's not in libc
+ if test "$ac_cv_func_getpeername" = no; then
+ BASH_CHECK_LIB_SOCKET
+Index: bash-3.2/patchlevel.h
+===================================================================
+--- bash-3.2.orig/patchlevel.h 2008-08-01 16:24:52.000000000 -0300
++++ bash-3.2/patchlevel.h 2008-08-01 16:25:03.000000000 -0300
+@@ -25,6 +25,6 @@
+ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
+ looks for to find the patch level (for the sccs version string). */
+
+-#define PATCHLEVEL 5
++#define PATCHLEVEL 6
+
+ #endif /* _PATCHLEVEL_H_ */
+Index: bash-3.2/Makefile.in
+===================================================================
+--- bash-3.2.orig/Makefile.in 2008-08-01 16:32:13.000000000 -0300
++++ bash-3.2/Makefile.in 2008-08-01 17:12:17.000000000 -0300
+@@ -405,7 +405,7 @@
+ input.c bashhist.c array.c arrayfunc.c sig.c pathexp.c \
+ unwind_prot.c siglist.c bashline.c bracecomp.c error.c \
+ list.c stringlib.c locale.c findcmd.c redir.c \
+- pcomplete.c pcomplib.c syntax.c xmalloc.c
++ pcomplete.c pcomplib.c syntax.c xmalloc.c libcnisint.c
+
+ HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \
+ general.h variables.h config.h $(ALLOC_HEADERS) alias.h \
+@@ -413,7 +413,7 @@
+ command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \
+ subst.h externs.h siglist.h bashhist.h bashline.h bashtypes.h \
+ array.h arrayfunc.h sig.h mailcheck.h bashintl.h bashjmp.h \
+- execute_cmd.h parser.h pathexp.h pathnames.h pcomplete.h \
++ execute_cmd.h parser.h pathexp.h pathnames.h pcomplete.h libcnisint.h \
+ $(BASHINCFILES)
+
+ SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
+@@ -433,7 +433,7 @@
+ trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \
+ alias.o array.o arrayfunc.o braces.o bracecomp.o bashhist.o \
+ bashline.o $(SIGLIST_O) list.o stringlib.o locale.o findcmd.o redir.o \
+- pcomplete.o pcomplib.o syntax.o xmalloc.o $(SIGNAMES_O)
++ pcomplete.o pcomplib.o syntax.o xmalloc.o libcnisint.o $(SIGNAMES_O)
+
+ # Where the source code of the shell builtins resides.
+ BUILTIN_SRCDIR=$(srcdir)/builtins
+@@ -978,7 +978,7 @@
+ shell.o: make_cmd.h subst.h sig.h pathnames.h externs.h
+ shell.o: flags.h trap.h mailcheck.h builtins.h $(DEFSRC)/common.h
+ shell.o: jobs.h siglist.h input.h execute_cmd.h findcmd.h bashhist.h
+-shell.o: ${GLOB_LIBSRC}/strmatch.h ${BASHINCDIR}/posixtime.h
++shell.o: ${GLOB_LIBSRC}/strmatch.h ${BASHINCDIR}/posixtime.h libcnisint.h
+ sig.o: config.h bashtypes.h
+ sig.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
+ sig.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h
diff --git a/packages/mamona/bash-noemu_3.2.bb b/packages/mamona/bash-noemu_3.2.bb
index c638b038fc..4d46d6fd79 100644
--- a/packages/mamona/bash-noemu_3.2.bb
+++ b/packages/mamona/bash-noemu_3.2.bb
@@ -1,8 +1,12 @@
require ../bash/bash.inc
PR = "r1"
+RCONFLICTS = "bash"
+RREPLACES = "bash"
+
SRC_URI = "${GNU_MIRROR}/bash/bash-${PV}.tar.gz \
- file://001-005.patch;patch=1"
+ file://001-005.patch;patch=1 \
+ file://006-add_internal_libcpwd_functions.patch;patch=1"
S = "${WORKDIR}/bash-${PV}"
diff --git a/packages/mamona/binutils-noemu-2.18/110-arm-eabi-conf.patch b/packages/mamona/binutils-noemu-2.18/110-arm-eabi-conf.patch
new file mode 100644
index 0000000000..050969bf64
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/110-arm-eabi-conf.patch
@@ -0,0 +1,24 @@
+diff -urN binutils-2.16.91.0.7.orig/configure binutils-2.16.91.0.7/configure
+--- binutils-2.16.91.0.7.orig/configure 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure 2006-05-31 14:55:53.000000000 +0300
+@@ -1299,7 +1299,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
+diff -urN binutils-2.16.91.0.7.orig/configure.in binutils-2.16.91.0.7/configure.in
+--- binutils-2.16.91.0.7.orig/configure.ac 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure.ac 2006-05-31 14:55:53.000000000 +0300
+@@ -497,7 +497,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-2.16.1-e300c2c3.patch b/packages/mamona/binutils-noemu-2.18/binutils-2.16.1-e300c2c3.patch
new file mode 100644
index 0000000000..c5e4234f22
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-2.16.1-e300c2c3.patch
@@ -0,0 +1,19 @@
+Adds support for Freescale Power architecture e300c2 and e300c3 cores.
+http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm
+
+Leon Woestenberg <leonw@mailcan.com>
+
+diff -uNr binutils-2.16.1.orig/gas/config/tc-ppc.c binutils-2.16.1/gas/config/tc-ppc.c
+--- binutils-2.16.1.orig/gas/config/tc-ppc.c 2005-03-02 13:24:01.000000000 +0000
++++ binutils-2.16.1/gas/config/tc-ppc.c 2006-07-04 11:45:24.000000000 +0100
+@@ -879,6 +879,10 @@
+ else
+ ppc_cpu |= PPC_OPCODE_SPE;
+ }
++ else if (strcmp (arg, "pmr") == 0)
++ {
++ ppc_cpu |= PPC_OPCODE_PMR;
++ }
+ /* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC
+ 620. */
+ else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0)
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch b/packages/mamona/binutils-noemu-2.18/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch
new file mode 100644
index 0000000000..8df5b1fea0
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch
@@ -0,0 +1,39 @@
+# strip (and objcopy) fail to set the error code if there is no
+# output file name and the rename of the stripped (or copied) file
+# fails, yet the command fails to do anything. This fixes both
+# objcopy and strip.
+#
+# modification by bero: Ported to 2.16.91.0.6
+#
+#Signed-off-by: John Bowler <jbowler@acm.org>
+#Signed-off-by: Bernhard Rosenkraenzer <bero@arklinux.org>
+---
+# binutils/objcopy.c | 8 +++++---
+# 1 file changed, 5 insertions(+), 3 deletions(-)
+#
+Index: src/binutils/objcopy.c
+===================================================================
+--- src.orig/binutils/objcopy.c 2007-08-09 13:26:03.000000000 +0100
++++ src/binutils/objcopy.c 2007-08-09 16:36:12.000000000 +0100
+@@ -2787,8 +2787,9 @@ strip_main (int argc, char *argv[])
+ if (preserve_dates)
+ set_times (tmpname, &statbuf);
+ if (output_file != tmpname)
+- smart_rename (tmpname, output_file ? output_file : argv[i],
+- preserve_dates);
++ if (smart_rename (tmpname, output_file ? output_file : argv[i],
++ preserve_dates))
++ hold_status = 1;
+ status = hold_status;
+ }
+ else
+@@ -3411,7 +3412,8 @@ copy_main (int argc, char *argv[])
+ if (preserve_dates)
+ set_times (tmpname, &statbuf);
+ if (tmpname != output_filename)
+- smart_rename (tmpname, input_filename, preserve_dates);
++ if (smart_rename (tmpname, input_filename, preserve_dates))
++ status = 1;
+ }
+ else
+ unlink_if_ordinary (tmpname);
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-configure-texinfo-version.patch b/packages/mamona/binutils-noemu-2.18/binutils-configure-texinfo-version.patch
new file mode 100644
index 0000000000..dd21aed862
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-configure-texinfo-version.patch
@@ -0,0 +1,22 @@
+--- binutils-2.18/configure.orig 2007-10-11 21:09:27.000000000 -0700
++++ binutils-2.18/configure 2007-10-11 21:10:20.000000000 -0700
+@@ -6128,7 +6128,7 @@ case " $build_configdirs " in
+ # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # higher, else we use the "missing" dummy.
+ if ${MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
++ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
+ :
+ else
+ MAKEINFO="$MISSING makeinfo"
+--- binutils-2.18/configure.ac.orig 2007-10-11 21:10:54.000000000 -0700
++++ binutils-2.18/configure.ac 2007-10-11 21:11:13.000000000 -0700
+@@ -2403,7 +2403,7 @@ changequote(,)
+ # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # higher, else we use the "missing" dummy.
+ if ${MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
++ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
+ :
+ else
+ MAKEINFO="$MISSING makeinfo"
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-uclibc-100-uclibc-conf.patch b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-100-uclibc-conf.patch
new file mode 100644
index 0000000000..8de04e0fe0
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-100-uclibc-conf.patch
@@ -0,0 +1,34 @@
+--- binutils-2.18.orig/configure
++++ binutils-2.18/configure
+@@ -2206,7 +2206,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -2504,7 +2504,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[3456789]86-*-vsta) ;; # don't add gprof back in
+ i[3456789]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.18.orig/gprof/configure
++++ binutils-2.18/gprof/configure
+@@ -4124,6 +4124,11 @@
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-001_ld_makefile_patch.patch b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000000..04a7e61e25
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+## 001_ld_makefile_patch.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: correct where ld scripts are installed
+## DP: Author: Chris Chimelis <chris@debian.org>
+## DP: Upstream status: N/A
+## DP: Date: ??
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- binutils-2.16.91.0.1/ld/Makefile.am
++++ binutils-2.16.91.0.1/ld/Makefile.am
+@@ -20,7 +20,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- binutils-2.16.91.0.1/ld/Makefile.in
++++ binutils-2.16.91.0.1/ld/Makefile.in
+@@ -268,7 +268,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-006_better_file_error.patch b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-006_better_file_error.patch
new file mode 100644
index 0000000000..f337611edf
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-006_better_file_error.patch
@@ -0,0 +1,43 @@
+#!/bin/sh -e
+## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Specify which filename is causing an error if the filename is a
+## DP: directory. (#45832)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
+--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100
++++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100
+@@ -150,6 +150,13 @@
+ {
+ bfd *nbfd;
+ const bfd_target *target_vec;
++ struct stat s;
++
++ if (stat (filename, &s) == 0)
++ if (S_ISDIR(s.st_mode)) {
++ bfd_set_error (bfd_error_file_not_recognized);
++ return NULL;
++ }
+
+ nbfd = _bfd_new_bfd ();
+ if (nbfd == NULL)
diff --git a/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-012_check_ldrunpath_length.patch b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000000..498651a90c
--- /dev/null
+++ b/packages/mamona/binutils-noemu-2.18/binutils-uclibc-300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
+## DP: cases where -rpath isn't specified. (#151024)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
+--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
++++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
+@@ -692,6 +692,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -871,6 +873,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
diff --git a/packages/mamona/binutils-noemu_2.17.50.0.5.bb b/packages/mamona/binutils-noemu_2.17.50.0.5.bb
index cefc2af1c4..679768bfb5 100644
--- a/packages/mamona/binutils-noemu_2.17.50.0.5.bb
+++ b/packages/mamona/binutils-noemu_2.17.50.0.5.bb
@@ -2,6 +2,9 @@ require ../binutils/binutils.inc
PR = "r1"
+RCONFLICTS = "binutils"
+RREPLACES = "binutils"
+
SRC_URI = \
"${KERNELORG_MIRROR}/pub/linux/devel/binutils/binutils-${PV}.tar.bz2 \
file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch;patch=1 \
diff --git a/packages/mamona/binutils-noemu_2.18.bb b/packages/mamona/binutils-noemu_2.18.bb
new file mode 100644
index 0000000000..c9bfd8d1b2
--- /dev/null
+++ b/packages/mamona/binutils-noemu_2.18.bb
@@ -0,0 +1,38 @@
+PR = "r0"
+
+require ../binutils/binutils.inc
+
+RCONFLICTS = "binutils"
+RREPLACES = "binutils"
+RCONFLICTS_binutils-noemu-symlinks = "binutils-symlinks"
+RREPLACES_binutils-noemu-symlinks = "binutils-symlinks"
+
+SRC_URI = "\
+ ${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
+ file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch;patch=1 \
+ file://binutils-configure-texinfo-version.patch;patch=1 \
+ file://binutils-uclibc-100-uclibc-conf.patch;patch=1 \
+ file://110-arm-eabi-conf.patch;patch=1 \
+ file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
+ file://binutils-uclibc-300-006_better_file_error.patch;patch=1 \
+ file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
+ "
+
+# powerpc patches
+SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
+
+EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} --disable-shared"
+
+
+do_configure () {
+ CC=gcc AS=as LD=ld CXX=g++ AR=ar OBJCOPY=objcopy OBJDUMP=objdump RANLIB=ranlib NM=nm STRIP=strip oe_runconf
+}
+
+do_compile() {
+ make configure-host LDFLAGS=\"\"
+ make LDFLAGS=\"-all-static\"
+}
+
+do_stage() {
+ :
+}
diff --git a/packages/mamona/cx3110x-770he-0.8.1/770_performance_improvements.patch b/packages/mamona/cx3110x-770he-0.8.1/770_performance_improvements.patch
new file mode 100644
index 0000000000..be9be86b82
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/770_performance_improvements.patch
@@ -0,0 +1,307 @@
+Index: cx3110x-0.8.1/src/sm_drv_spi.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_spi.c 2008-04-28 18:30:22.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi.c 2008-04-28 18:30:25.000000000 -0300
+@@ -99,10 +99,10 @@
+ struct net_local *lp = dev->priv;
+ uint32_t host_ints, host_ints_ack, target_ints;
+ unsigned long timeout;
+- int result;
++ int result, pass = 1;
+
+ DEBUG(DBG_BH, "w\n");
+-
++again:
+ /* Here we wake the target up */
+ target_ints = SPI_TARGET_INT_WAKEUP;
+ sm_spi_write(dev, SPI_ADRS_ARM_INTERRUPTS,
+@@ -117,6 +117,11 @@
+ if (time_after(jiffies, timeout)) {
+ printk(KERN_WARNING "We haven't got a READY interrupt"
+ " from WAKEUP. (firmware crashed?)\n");
++ if (pass == 1) {
++ printk(KERN_WARNING "Try again...\n");
++ pass = 2;
++ goto again;
++ }
+ lp->device_state = DEVSTATE_DEAD;
+ result = -1;
+ goto exit;
+@@ -131,7 +136,10 @@
+ (unsigned char *)&host_ints_ack, sizeof(host_ints_ack));
+
+ result = 0;
+-
++
++ if (pass == 2) {
++ printk(KERN_WARNING "succeeded!!!\n");
++ }
+ exit:
+ DEBUG(DBG_BH, "W\n");
+ return result;
+@@ -150,49 +158,84 @@
+ return 0;
+ }
+
+-static int sm_drv_spi_rx(struct net_device *dev)
++static int sm_drv_spi_is_rx_frame_available(struct net_device *dev)
++{
++ uint32_t host_ints, host_ints_ack;
++ sm_spi_read(dev, SPI_ADRS_HOST_INTERRUPTS, (unsigned char *)&host_ints, sizeof(host_ints));
++ if ((host_ints & SPI_HOST_INT_UPDATE) || (host_ints & SPI_HOST_INT_SW_UPDATE)) {
++ host_ints_ack = SPI_HOST_INT_UPDATE | SPI_HOST_INT_SW_UPDATE;
++ sm_spi_write(dev, SPI_ADRS_HOST_INT_ACK, (unsigned char *)&host_ints_ack, sizeof(host_ints_ack));
++ return 1;
++ }
++ return 0;
++}
++
++static struct s_ic_msg * sm_drv_spi_alloc_frame_and_start_rx_transfer(struct net_device *dev)
+ {
+ struct net_local *lp = dev->priv;
+- struct spi_hif_local_data *hif_lp = HIF_LP(lp);
+ struct s_sm_frame *frame;
++ unsigned short length;
+ struct s_ic_msg *ic_msg;
++
++ frame = frame_skb_alloc(dev, lp->sm_descr.mtu + lp->sm_descr.rxoffset, 0);
++ if (frame == NULL) return NULL;
++
++ /* dummy read to flush SPI DMA controller bug */
++ sm_spi_read(dev, SPI_ADRS_GEN_PURP_1, (unsigned char *)&length, sizeof(length));
++
++ sm_spi_read(dev, SPI_ADRS_DMA_DATA, (unsigned char *)&length, sizeof(length));
++ DEBUG(DBG_BH, "%s: received frame len=%d\n", DRIVER_NAME, length);
++
++ if (length > SPI_MAX_PACKET_SIZE)
++ length = SPI_MAX_PACKET_SIZE;
++
++ sm_spi_dma_read_start(dev, SPI_ADRS_DMA_DATA, (unsigned char *) frame->data, length);
++
++ ic_msg = FRAME_ICMSG(frame);
++ ic_msg->frame = frame;
++ ic_msg->channel = 0;
++ ic_msg->flags = 0;
++ ic_msg->length = length;
++ ic_msg->address = 0;
++ ic_msg->data = frame->data;
++
++ return ic_msg;
++}
++
++static int sm_drv_spi_rx(struct net_device *dev)
++{
++ struct net_local *lp = dev->priv;
++ struct spi_hif_local_data *hif_lp = HIF_LP(lp);
++ struct s_ic_msg *ic_msg, *ic_msg_next;
+ int result, err;
+- unsigned short length;
+ int32_t callb_mask = 0;
+-
++
+ err = sm_drv_spi_wakeup(dev);
+ if (err < 0) {
+ result = -1;
+ goto exit;
+ }
+
+- frame = frame_skb_alloc(dev, lp->sm_descr.mtu + lp->sm_descr.rxoffset,
+- 0);
+- if (frame != NULL) {
+- ic_msg = FRAME_ICMSG(frame);
+- ic_msg->frame = frame;
+-
+- /* dummy read to flush SPI DMA controller bug */
+- sm_spi_read(dev, SPI_ADRS_GEN_PURP_1, (unsigned char *)&length,
+- sizeof(length));
+-
+- sm_spi_read(dev, SPI_ADRS_DMA_DATA, (unsigned char *)&length,
+- sizeof(length));
+-
+- DEBUG(DBG_BH, "%s: received frame len=%d\n", DRIVER_NAME,
+- length);
+-
+- if (length > SPI_MAX_PACKET_SIZE)
+- length = SPI_MAX_PACKET_SIZE;
++ ic_msg_next = sm_drv_spi_alloc_frame_and_start_rx_transfer(dev);
++ if (ic_msg_next == NULL) {
++ printk("Couldn't allocate RX frame\n");
++ result = -1;
++ goto exit;
++ }
+
+- sm_spi_dma_read(dev, SPI_ADRS_DMA_DATA,
+- (unsigned char *) frame->data, length);
+-
+- ic_msg->channel = 0;
+- ic_msg->flags = 0;
+- ic_msg->length = length;
+- ic_msg->address = 0;
+- ic_msg->data = frame->data;
++ while (ic_msg_next) {
++ sm_spi_dma_read_wait_for_completion();
++ ic_msg = ic_msg_next;
++ ic_msg_next = NULL;
++
++ if (sm_drv_spi_is_rx_frame_available(dev)) {
++ ic_msg_next = sm_drv_spi_alloc_frame_and_start_rx_transfer(dev);
++ if (ic_msg_next == NULL) {
++ printk("Couldn't allocate RX frame\n");
++ result = -1;
++ goto exit;
++ }
++ }
+
+ hif_lp->spi_packets++;
+ spin_lock_bh(&lp->sm_lock);
+@@ -207,13 +250,14 @@
+
+ DEBUG(DBG_IC,"Callback mask: %d\n", callb_mask);
+
+- if(callb_mask < 0)
++ if (callb_mask < 0) {
+ printk(KERN_WARNING "prism_interconnect_message_handle"
+ "returned error %d\n", callb_mask);
+- } else
+- printk("Couldn't allocate RX frame\n");
+-
+- handle_sm_callback(dev, callb_mask);
++ result = -1;
++ goto exit;
++ }
++ handle_sm_callback(dev, callb_mask);
++ }
+
+ result = 0;
+
+Index: cx3110x-0.8.1/src/sm_drv_spi_io.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_spi_io.c 2008-04-28 18:30:25.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi_io.c 2008-04-28 18:35:59.000000000 -0300
+@@ -120,7 +120,7 @@
+ }
+
+
+-int cx3110x_spi_dma_read(struct net_device *dev, unsigned long address, void * buffer, unsigned int length)
++int cx3110x_spi_dma_read_start(struct net_device *dev, unsigned long address, void * buffer, unsigned int length)
+ {
+ SPI_CS_ON();
+
+@@ -170,13 +170,22 @@
+ omap_start_dma(spi_dma.dma_rx_ch);
+ omap_start_dma(spi_dma.dma_tx_ch);
+
+- /* Wait for reading to complete */
+- while(!spi_dma.dma_rx_done) {
+- udelay(5);
++ return 0;
++}
++
++int cx3110x_spi_dma_read_wait_for_completion()
++{
++ int wait_limit = 15000 * 5;
++ int wait_cycles = 0;
++
++ /* Wait for DMA reading to complete */
++ while ((!spi_dma.dma_rx_done || !spi_dma.dma_tx_done) && wait_cycles < wait_limit) {
++ wait_cycles++;
++ udelay(1);
+ }
+
+- while(!spi_dma.dma_tx_done) {
+- udelay(5);
++ if (wait_cycles >= wait_limit) {
++ printk("McBSP read DMA timeout, spi_dma.dma_rx_done=%d, spi_dma.dma_tx_done=%d\n", spi_dma.dma_rx_done, spi_dma.dma_tx_done);
+ }
+
+ spi_dma.dma_rx_done = 0;
+@@ -184,11 +193,14 @@
+
+ SPI_CS_OFF();
+
+- return 0;
++ return wait_cycles;
+ }
+
+ int cx3110x_spi_dma_write(struct net_device *dev, unsigned long address, void * buffer, unsigned int length)
+ {
++ int wait_limit = 15000 * 5;
++ int wait_cycles = 0;
++
+ SPI_CS_ON();
+
+ omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2, address << 8);
+@@ -239,16 +251,20 @@
+ omap_start_dma(spi_dma.dma_rx_ch);
+ omap_start_dma(spi_dma.dma_tx_ch);
+
+- /* We don't want to turn CS off before transfer is done */
+-
+- while(!spi_dma.dma_rx_done) {
+- udelay(5);
++ /* Wait for DMA writing to complete */
++ while ((!spi_dma.dma_rx_done || !spi_dma.dma_tx_done) && wait_cycles < wait_limit) {
++ wait_cycles++;
++ udelay(1);
+ }
+
+ while(!spi_dma.dma_tx_done) {
+ udelay(5);
+ }
+
++ if (wait_cycles >= wait_limit) {
++ printk("McBSP write DMA timeout, spi_dma.dma_rx_done=%d, spi_dma.dma_tx_done=%d\n", spi_dma.dma_rx_done, spi_dma.dma_tx_done);
++ }
++
+ spi_dma.dma_rx_done = 0;
+ spi_dma.dma_tx_done = 0;
+
+@@ -320,7 +336,7 @@
+ int cx3110x_spi_start(struct net_device *dev)
+ {
+ struct omap_mcbsp_spi_cfg spi_cfg;
+- int r, div = 1, rate_mhz, max_mhz = 14;
++ int r, div = 1, rate_mhz, max_mhz = 16;
+ struct net_local * lp;
+ struct spi_hif_local_data * spi_lp;
+
+@@ -368,11 +384,11 @@
+
+ cx3110x_hw_reset();
+
+- while(rate_mhz/div >= max_mhz)
++ while(rate_mhz/(div+1) >= max_mhz)
+ div++;
+
+- printk("McBSP2: freq_limit=%dMHz, base_freq=%dMHz, divisor=%d (%d.%dMHz)\n",
+- max_mhz, rate_mhz, div, rate_mhz / div, (rate_mhz * 10 / div) % 10);
++ printk("McBSP2: freq_limit=%dMHz, base_freq=%dMHz, div=%d (%d.%dMHz)\n",
++ max_mhz, rate_mhz, div, rate_mhz / (div+1), (rate_mhz * 10 / (div+1)) % 10);
+
+ spi_dma.dma_tx_done = 0;
+ spi_dma.dma_rx_done = 0;
+Index: cx3110x-0.8.1/src/sm_drv_spi_io.h
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_spi_io.h 2008-04-28 18:30:22.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi_io.h 2008-04-28 18:30:25.000000000 -0300
+@@ -27,15 +27,17 @@
+
+ int cx3110x_spi_read(struct net_device * dev, unsigned long address, unsigned char * buffer, unsigned int length);
+ int cx3110x_spi_write(struct net_device * dev, unsigned long address, unsigned char * buffer, unsigned int length);
+-int cx3110x_spi_dma_read(struct net_device *dev, unsigned long address, void * buffer, unsigned int length);
++int cx3110x_spi_dma_read_start(struct net_device *dev, unsigned long address, void * buffer, unsigned int length);
++int cx3110x_spi_dma_read_wait_for_completion(void);
+ int cx3110x_spi_dma_write(struct net_device *dev, unsigned long address, void * buffer, unsigned int length);
+
+ void cx3110x_dump_register(struct net_device * dev);
+
+-#define sm_spi_read(dev, addr, data, len) cx3110x_spi_read(dev, (addr), (data), (len))
++#define sm_spi_read(dev, addr, data, len) cx3110x_spi_read(dev, (addr), (data), (len))
+ #define sm_spi_write(dev, addr, data, len) cx3110x_spi_write(dev, (addr), (data), (len))
+
+-#define sm_spi_dma_read(dev, addr, data, len) cx3110x_spi_dma_read(dev, (addr), (data), (len))
++#define sm_spi_dma_read_start(dev, addr, data, len) cx3110x_spi_dma_read_start(dev, (addr), (data), (len))
++#define sm_spi_dma_read_wait_for_completion() cx3110x_spi_dma_read_wait_for_completion()
+ #define sm_spi_dma_write(dev, addr, data, len) cx3110x_spi_dma_write(dev, (addr), (data), (len))
+
+ #endif
diff --git a/packages/mamona/cx3110x-770he-0.8.1/create_sysfs_link_for_wlan0.patch b/packages/mamona/cx3110x-770he-0.8.1/create_sysfs_link_for_wlan0.patch
new file mode 100644
index 0000000000..cf4fa1e96a
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/create_sysfs_link_for_wlan0.patch
@@ -0,0 +1,11 @@
+--- cx3110x-0.8.1.new/src/sm_drv_spi.c 2008-05-13 10:27:19.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi.c 2008-05-12 19:02:16.000000000 -0300
+@@ -1067,6 +1067,8 @@
+ goto err_out_4;
+ }
+
++ SET_NETDEV_DEV(dev, &wlan_omap_device.dev);
++
+ register_netdev(dev);
+
+ /* Let's fetch the firmware from userspace */
diff --git a/packages/mamona/cx3110x-770he-0.8.1/cx3110x b/packages/mamona/cx3110x-770he-0.8.1/cx3110x
new file mode 100755
index 0000000000..ce2ecdfbe8
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/cx3110x
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+MODULE="/lib/modules/`uname -r`/cx3110x.ko"
+
+swap_module () {
+ if [ -e $MODULE ]; then
+ # Removing builtin driver
+ rmmod cx3110x
+ # Inserting the new one
+ insmod $MODULE
+ # Setting device options (MAC, default country, etc)
+ if [ -x /mnt/initfs/usr/bin/wlan-cal ]; then
+ chroot /mnt/initfs /usr/bin/wlan-cal
+ fi
+ else
+ echo "OOPS: $MODULE not found, the switch is not possible" 1>&2
+ fi
+}
+
+case "$1" in
+ start)
+ swap_module
+ ;;
+ stop)
+ rmmod cx3110x
+ ;;
+ force-reload | restart)
+ swap_module
+ ;;
+ *)
+ echo "Usage: /etc/init.d/cx3110x {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/packages/mamona/cx3110x-770he-0.8.1/cx3110x.patch b/packages/mamona/cx3110x-770he-0.8.1/cx3110x.patch
new file mode 100644
index 0000000000..06340581d1
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/cx3110x.patch
@@ -0,0 +1,492 @@
+Index: cx3110x-0.8.1/src/sm_drv_ioctl_umac.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_ioctl_umac.c 2007-10-15 08:56:20.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_ioctl_umac.c 2008-04-22 15:50:45.000000000 -0300
+@@ -76,7 +76,7 @@
+ kfree(wrqu.data.pointer);
+ }
+
+-void send_wpa_ie_event(struct net_device *dev, char * bss_addr, char * wpa_ie, size_t wpa_ie_len, uint32_t event)
++void send_wpa_ie_event(struct net_device *dev, char * wpa_ie, size_t wpa_ie_len, uint32_t event)
+ {
+ union iwreq_data wrqu;
+ uint32_t we_event;
+@@ -97,15 +97,12 @@
+ return;
+ }
+
+- wrqu.data.pointer = kzalloc(ETH_ALEN + 1 + wpa_ie_len, GFP_ATOMIC);
++ wrqu.data.pointer = kzalloc(wpa_ie_len, GFP_ATOMIC);
+ if (!wrqu.data.pointer)
+ return;
+
+- memcpy(wrqu.data.pointer, bss_addr, ETH_ALEN);
+- *((char *)(wrqu.data.pointer + ETH_ALEN)) = ':';
+- memcpy(wrqu.data.pointer + ETH_ALEN + 1, wpa_ie, wpa_ie_len);
+-
+- wrqu.data.length = ETH_ALEN + 1 + wpa_ie_len;
++ memcpy(wrqu.data.pointer, wpa_ie, wpa_ie_len);
++ wrqu.data.length = wpa_ie_len;
+
+ wireless_send_event(dev, we_event, &wrqu, wrqu.data.pointer);
+ kfree(wrqu.data.pointer);
+@@ -495,7 +492,7 @@
+ /* We send the event after parsing the association frame */
+ if ((lp->link_state == DOT11_STATE_ASSOCING || lp->link_state == DOT11_STATE_ASSOC)
+ && event)
+- send_wpa_ie_event(dev, bssid, wpa_ie, wpa_ie_len, event);
++ send_wpa_ie_event(dev, wpa_ie, wpa_ie_len, event);
+
+ /* try to use existing entry */
+ list_for_each_entry_safe(bss, safe, &lp->bss_wpa_list, list) {
+@@ -1782,6 +1779,435 @@
+ return sm_drv_oid_set(dev, DOT11_OID_STAKEY, (void *)&key, sizeof(struct obj_stakey));
+ }
+
++static int sm_drv_set_auth(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_param *param = &wrqu->param;
++ u32 authen = 0, dot1x = 0;
++ u32 exunencrypt = 0, privinvoked = 0, wpa = 0;
++ u32 old_wpa;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "SET AUTH\n");
++
++ /* first get the flags */
++ down(&priv->wpa_sem);
++ wpa = old_wpa = priv->wpa;
++ up(&priv->wpa_sem);
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++
++ if (ret < 0)
++ goto out;
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_CIPHER_PAIRWISE:
++ case IW_AUTH_CIPHER_GROUP:
++ case IW_AUTH_KEY_MGMT:
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ /* Do the same thing as IW_AUTH_WPA_VERSION */
++ if (param->value) {
++ wpa = DOT11_PRIV_INV_TKIP;
++ privinvoked = 1; /* For privacy invoked */
++ exunencrypt = 1; /* Filter out all unencrypted frames */
++ dot1x = 0x01; /* To enable eap filter */
++ authen = DOT11_AUTH_OS; /* Only WEP uses _SK and _BOTH */
++ } else {
++ wpa = DOT11_PRIV_INV_NONE;
++ privinvoked = 0;
++ exunencrypt = 0; /* Do not filter un-encrypted data */
++ dot1x = 0;
++ }
++ break;
++
++ case IW_AUTH_WPA_VERSION:
++ if (param->value & IW_AUTH_WPA_VERSION_DISABLED) {
++ wpa = DOT11_PRIV_INV_NONE;
++ privinvoked = 0;
++ exunencrypt = 0; /* Do not filter un-encrypted data */
++ dot1x = 0;
++ } else {
++ if (param->value & IW_AUTH_WPA_VERSION_WPA)
++ wpa = DOT11_PRIV_INV_TKIP;
++ else if (param->value & IW_AUTH_WPA_VERSION_WPA2)
++ wpa = DOT11_PRIV_INV_AES_CCMP;
++ privinvoked = 1; /* For privacy invoked */
++ exunencrypt = 1; /* Filter out all unencrypted frames */
++ dot1x = 0x01; /* To enable eap filter */
++ authen = DOT11_AUTH_OS; /* Only WEP uses _SK and _BOTH */
++ }
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ /* dot1x should be the opposite of RX_UNENCRYPTED_EAPOL;
++ * turn off dot1x when allowing receipt of unencrypted EAPOL
++ * frames, turn on dot1x when receipt should be disallowed
++ */
++ dot1x = param->value ? 0 : 0x01;
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ privinvoked = param->value ? 1 : 0;
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ exunencrypt = param->value ? 1 : 0;
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ if (param->value & IW_AUTH_ALG_SHARED_KEY) {
++ /* Only WEP uses _SK and _BOTH */
++ if (wpa > 0) {
++ ret = -EINVAL;
++ goto out;
++ }
++ authen = DOT11_AUTH_SK;
++ } else if (param->value & IW_AUTH_ALG_OPEN_SYSTEM) {
++ authen = DOT11_AUTH_OS;
++ } else {
++ ret = -EINVAL;
++ goto out;
++ }
++ break;
++
++ default:
++ return -EOPNOTSUPP;
++ }
++
++ /* Set all the values */
++ down(&priv->wpa_sem);
++ priv->wpa = wpa;
++ up(&priv->wpa_sem);
++
++ sm_drv_oid_set(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++
++ out:
++ return ret;
++}
++
++static int sm_drv_get_auth(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_param *param = &wrqu->param;
++ u32 authen = 0, dot1x = 0;
++ u32 exunencrypt = 0, privinvoked = 0, wpa = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "GET AUTH\n");
++
++ /* first get the flags */
++ down(&priv->wpa_sem);
++ wpa = priv->wpa;
++ up(&priv->wpa_sem);
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_CIPHER_PAIRWISE:
++ case IW_AUTH_CIPHER_GROUP:
++ case IW_AUTH_KEY_MGMT:
++ /*
++ * wpa_supplicant will control these internally
++ */
++ ret = -EOPNOTSUPP;
++ break;
++
++ case IW_AUTH_WPA_VERSION:
++ switch (wpa) {
++ case DOT11_PRIV_INV_TKIP:
++ param->value = IW_AUTH_WPA_VERSION_WPA;
++ break;
++ case DOT11_PRIV_INV_AES_CCMP:
++ param->value = IW_AUTH_WPA_VERSION_WPA2;
++ break;
++ default:
++ param->value = IW_AUTH_WPA_VERSION_DISABLED;
++ break;
++ }
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ ret = sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = exunencrypt > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ if (ret >= 0) {
++ switch (authen) {
++ case DOT11_AUTH_OS:
++ param->value = IW_AUTH_ALG_OPEN_SYSTEM;
++ break;
++ case DOT11_AUTH_BOTH:
++ case DOT11_AUTH_SK:
++ param->value = IW_AUTH_ALG_SHARED_KEY;
++ case DOT11_AUTH_NONE:
++ default:
++ param->value = 0;
++ break;
++ }
++ }
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ param->value = wpa > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ ret = sm_drv_oid_get(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = dot1x > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ ret = sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = privinvoked > 0 ? 1 : 0;
++ break;
++
++ default:
++ return -EOPNOTSUPP;
++ }
++ return ret;
++}
++
++#define KEY_SIZE_WEP104 13 /* 104/128-bit WEP keys */
++#define KEY_SIZE_WEP40 5 /* 40/64-bit WEP keys */
++#define KEY_SIZE_TKIP 32 /* TKIP keys */
++
++static int sm_drv_set_encodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int idx, alg = ext->alg, set_key = 1;
++ int authen = DOT11_AUTH_OS, invoke = 0, exunencrypt = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "SET ENCODEEXT\n");
++
++ /* Determine and validate the key index */
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ } else {
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++ }
++
++ if (encoding->flags & IW_ENCODE_DISABLED)
++ alg = IW_ENCODE_ALG_NONE;
++
++ if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
++ /* Only set transmit key index here, actual
++ * key is set below if needed.
++ */
++ ret = sm_drv_oid_set(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ set_key = ext->key_len > 0 ? 1 : 0;
++ }
++
++ if (set_key) {
++ switch (alg) {
++ case IW_ENCODE_ALG_NONE:
++ break;
++ case IW_ENCODE_ALG_WEP: {
++ struct obj_key key = { DOT11_PRIV_WEP, 0, "" };
++ memset(key.key, 0, sizeof(key.key));
++ if (ext->key_len > KEY_SIZE_WEP104) {
++ ret = -EINVAL;
++ goto out;
++ }
++ if (ext->key_len > KEY_SIZE_WEP40)
++ key.length = KEY_SIZE_WEP104;
++ else
++ key.length = KEY_SIZE_WEP40;
++ memcpy(key.key, ext->key, ext->key_len);
++ ret = sm_drv_oid_set(dev, DOT11_OID_DEFKEYID + idx + 1,
++ (void *)&key,
++ sizeof(struct obj_key));
++ break;
++ }
++ case IW_ENCODE_ALG_TKIP:
++ case IW_ENCODE_ALG_CCMP: {
++ struct obj_stakey key;
++ memset(key.key, 0, sizeof(key.key));
++ if (alg == IW_ENCODE_ALG_TKIP)
++ key.type = DOT11_PRIV_TKIP;
++ else
++ key.type = DOT11_PRIV_AES_CCMP;
++ memcpy(key.address, ext->addr.sa_data, ETH_ALEN);
++ key.length = ext->key_len;
++ key.keyid = idx;
++ key.ext = 0;
++ memcpy(key.key, ext->key, ext->key_len);
++ ret = sm_drv_oid_set(dev, DOT11_OID_STAKEY,
++ (void *)&key,
++ sizeof(struct obj_stakey));
++ break;
++ }
++ default:
++ return -EINVAL;
++ }
++
++ if (ret < 0)
++ goto out;
++
++ }
++
++ /* Read the flags */
++ if (encoding->flags & IW_ENCODE_DISABLED) {
++ /* Encoding disabled,
++ * authen = DOT11_AUTH_OS;
++ * invoke = 0;
++ * exunencrypt = 0; */
++ }
++ if (encoding->flags & IW_ENCODE_OPEN) {
++ /* Encode but accept non-encoded packets. No auth */
++ invoke = 1;
++ }
++ if (encoding->flags & IW_ENCODE_RESTRICTED) {
++ /* Refuse non-encoded packets. Auth */
++ authen = DOT11_AUTH_BOTH;
++ invoke = 1;
++ exunencrypt = 1;
++ }
++
++ /* do the change if requested */
++ if (encoding->flags & IW_ENCODE_MODE) {
++ sm_drv_oid_set(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&invoke, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ }
++
++ out:
++ return ret;
++}
++
++
++static int sm_drv_get_encodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int idx, max_key_len;
++ int authen = DOT11_AUTH_OS, invoke = 0, exunencrypt = 0, wpa = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "GET ENCODEEXT\n");
++
++ /* first get the flags */
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&invoke, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++
++ max_key_len = encoding->length - sizeof(*ext);
++ if (max_key_len < 0)
++ return -EINVAL;
++
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ } else {
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++ }
++
++ encoding->flags = idx + 1;
++ memset(ext, 0, sizeof(*ext));
++
++ switch (authen) {
++ case DOT11_AUTH_BOTH:
++ case DOT11_AUTH_SK:
++ wrqu->encoding.flags |= IW_ENCODE_RESTRICTED;
++ case DOT11_AUTH_OS:
++ default:
++ wrqu->encoding.flags |= IW_ENCODE_OPEN;
++ break;
++ }
++
++ down(&priv->wpa_sem);
++ wpa = priv->wpa;
++ up(&priv->wpa_sem);
++
++ if (authen == DOT11_AUTH_OS && !exunencrypt && !invoke && !wpa) {
++ /* No encryption */
++ ext->alg = IW_ENCODE_ALG_NONE;
++ ext->key_len = 0;
++ wrqu->encoding.flags |= IW_ENCODE_DISABLED;
++ } else {
++ struct obj_key *key;
++
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID + idx + 1,
++ (void *)&key, sizeof(struct obj_key));
++ if (ret < 0)
++ goto out;
++ if (max_key_len < key->length) {
++ ret = -E2BIG;
++ goto out;
++ }
++ memcpy(ext->key, key->key, key->length);
++ ext->key_len = key->length;
++
++ switch (key->type) {
++ case DOT11_PRIV_TKIP:
++ ext->alg = IW_ENCODE_ALG_TKIP;
++ break;
++ case DOT11_PRIV_AES_CCMP:
++ ext->alg = IW_ENCODE_ALG_CCMP;
++ break;
++ default:
++ case DOT11_PRIV_WEP:
++ ext->alg = IW_ENCODE_ALG_WEP;
++ break;
++ }
++ wrqu->encoding.flags |= IW_ENCODE_ENABLED;
++ }
++
++ out:
++ return ret;
++}
+
+ /* Private handlers */
+
+@@ -2155,10 +2581,10 @@
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) sm_drv_set_genie, /* SIOCSIWGENIE*/
+ (iw_handler) NULL, /* SIOCGIWGENIE */
+- (iw_handler) NULL, /* SIOCSIWAUTH */
+- (iw_handler) NULL, /* SIOCGIWAUTH */
+- (iw_handler) NULL, /* SIOCSIWENCODEEXT */
+- (iw_handler) NULL, /* SIOCGIWENCODEEXT */
++ (iw_handler) sm_drv_set_auth, /* SIOCSIWAUTH */
++ (iw_handler) sm_drv_get_auth, /* SIOCGIWAUTH */
++ (iw_handler) sm_drv_set_encodeext, /* SIOCSIWENCODEEXT */
++ (iw_handler) sm_drv_get_encodeext, /* SIOCGIWENCODEEXT */
+ (iw_handler) sm_drv_set_pmk, /* SIOCSIWPMKSA */
+ };
+
diff --git a/packages/mamona/cx3110x-770he-0.8.1/defconfig b/packages/mamona/cx3110x-770he-0.8.1/defconfig
new file mode 100644
index 0000000000..7119b50f34
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/defconfig
@@ -0,0 +1,1380 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.16.27-omap1
+# Fri Apr 18 16:19:13 2008
+#
+CONFIG_ARM=y
+CONFIG_MMU=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+
+#
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# System Type
+#
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_AT91RM9200 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+CONFIG_ARCH_OMAP1=y
+# CONFIG_ARCH_OMAP2 is not set
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+CONFIG_OMAP_COMPONENT_VERSION=y
+CONFIG_OMAP_GPIO_SWITCH=y
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_STI=y
+CONFIG_OMAP_STI_CONSOLE=y
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+
+#
+# OMAP Core Type
+#
+# CONFIG_ARCH_OMAP730 is not set
+# CONFIG_ARCH_OMAP15XX is not set
+CONFIG_ARCH_OMAP16XX=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_OMAP_INNOVATOR is not set
+# CONFIG_MACH_OMAP_H2 is not set
+# CONFIG_MACH_OMAP_H3 is not set
+# CONFIG_MACH_OMAP_OSK is not set
+CONFIG_MACH_NOKIA770=y
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP CPU Speed
+#
+CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
+CONFIG_OMAP_ARM_216MHZ=y
+# CONFIG_OMAP_ARM_192MHZ is not set
+# CONFIG_OMAP_ARM_168MHZ is not set
+# CONFIG_OMAP_ARM_120MHZ is not set
+# CONFIG_OMAP_ARM_60MHZ is not set
+# CONFIG_OMAP_ARM_30MHZ is not set
+CONFIG_OMAP_DSP=y
+# CONFIG_OMAP_DSP_MBCMD_VERBOSE is not set
+CONFIG_OMAP_DSP_TASK_MULTIOPEN=y
+CONFIG_OMAP_DSP_FBEXPORT=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+
+#
+# Bus support
+#
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_PREEMPT=y
+CONFIG_NO_IDLE_HZ=y
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="root=1f03 rootfstype=jffs2 time"
+# CONFIG_XIP_KERNEL is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_LEGACY is not set
+# CONFIG_PM_DEBUG is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+# CONFIG_IPV6 is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=y
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK is not set
+CONFIG_NETFILTER_XTABLES=y
+# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
+# CONFIG_NETFILTER_XT_TARGET_MARK is not set
+# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
+# CONFIG_NETFILTER_XT_MATCH_MAC is not set
+# CONFIG_NETFILTER_XT_MATCH_MARK is not set
+# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
+# CONFIG_NETFILTER_XT_MATCH_REALM is not set
+# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
+# CONFIG_NETFILTER_XT_MATCH_STRING is not set
+# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_IP_NF_CONNTRACK is not set
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=y
+# CONFIG_IP_NF_MATCH_IPRANGE is not set
+# CONFIG_IP_NF_MATCH_MULTIPORT is not set
+# CONFIG_IP_NF_MATCH_TOS is not set
+# CONFIG_IP_NF_MATCH_RECENT is not set
+# CONFIG_IP_NF_MATCH_ECN is not set
+# CONFIG_IP_NF_MATCH_DSCP is not set
+# CONFIG_IP_NF_MATCH_AH_ESP is not set
+# CONFIG_IP_NF_MATCH_TTL is not set
+# CONFIG_IP_NF_MATCH_OWNER is not set
+# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
+# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
+CONFIG_IP_NF_FILTER=y
+# CONFIG_IP_NF_TARGET_REJECT is not set
+# CONFIG_IP_NF_TARGET_LOG is not set
+# CONFIG_IP_NF_TARGET_ULOG is not set
+# CONFIG_IP_NF_TARGET_TCPMSS is not set
+CONFIG_IP_NF_TARGET_IDLETIMER=y
+# CONFIG_IP_NF_MANGLE is not set
+# CONFIG_IP_NF_RAW is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+# CONFIG_BT_BNEP_MC_FILTER is not set
+# CONFIG_BT_BNEP_PROTO_FILTER is not set
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIUSB is not set
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+CONFIG_BT_HCIBRF6150=y
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=y
+# CONFIG_PROC_EVENTS is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_TOTO is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_OMAP_HW=y
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+# CONFIG_MTD_ONENAND_SYNC_READ is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM_COUNT=16
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=m
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=y
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ATMEL is not set
+# CONFIG_HOSTAP is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_PPP=y
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_BSDCOMP=y
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_OMAP=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_OMAP is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+CONFIG_OMAP_RNG=y
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_OMAP_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA_ISA is not set
+CONFIG_I2C_OMAP=y
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
+# CONFIG_ISP1301_OMAP is not set
+# CONFIG_TPS65010 is not set
+CONFIG_SENSORS_TLV320AIC23=y
+CONFIG_SENSORS_TLV320AIC23_ESD_WORKAROUND=y
+# CONFIG_GPIOEXPANDER_OMAP is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_RTC_X1205_I2C is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_OMAP_UWIRE=y
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+CONFIG_NOKIA_OMAP_USBTEST=m
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_OMAP=y
+CONFIG_FB_OMAP_LCDC_EXTERNAL=y
+CONFIG_FB_OMAP_LCDC_HWA742=y
+CONFIG_FB_OMAP_MANUAL_UPDATE=y
+CONFIG_FB_OMAP_LCD_MIPID=y
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+# CONFIG_FB_OMAP_DMA_TUNE is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_SND_SUPPORT_OLD_API is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA ARM devices
+#
+CONFIG_SND_OMAP_AIC23=y
+# CONFIG_SND_OMAP_TSC2101 is not set
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_BANDWIDTH=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_ITMTOUCH is not set
+# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=m
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_RNDIS_HOST is not set
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_AIRPRIME is not set
+# CONFIG_USB_SERIAL_ANYDATA is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_CP2101 is not set
+# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_GARMIN is not set
+# CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+CONFIG_USB_SERIAL_PL2303=m
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+CONFIG_USB_GADGET_OMAP=y
+CONFIG_USB_OMAP=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_FILE_STORAGE_TEST=y
+# CONFIG_USB_G_SERIAL is not set
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BROKEN_RFD=y
+CONFIG_MMC_BULKTRANSFER=y
+CONFIG_MMC_OMAP=y
+
+#
+# Synchronous Serial Interfaces (SSI)
+#
+CONFIG_OMAP_UWIRE=y
+# CONFIG_OMAP_TSC2101 is not set
+
+#
+# CBUS support
+#
+CONFIG_CBUS=y
+CONFIG_CBUS_TAHVO=y
+CONFIG_CBUS_TAHVO_USER=y
+CONFIG_CBUS_TAHVO_USB=y
+# CONFIG_CBUS_TAHVO_USB_HOST_BY_DEFAULT is not set
+CONFIG_CBUS_RETU=y
+CONFIG_CBUS_RETU_USER=y
+CONFIG_CBUS_RETU_POWERBUTTON=y
+CONFIG_CBUS_RETU_RTC=y
+CONFIG_CBUS_RETU_WDT=y
+CONFIG_CBUS_RETU_HEADSET=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=m
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=m
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+CONFIG_NLS_CODEPAGE_852=y
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+CONFIG_NLS_ISO8859_15=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_WAITQ is not set
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_NETWORK is not set
+# CONFIG_SECURITY_CAPABILITIES is not set
+# CONFIG_SECURITY_ROOTPLUG is not set
+# CONFIG_SECURITY_SECLVL is not set
+CONFIG_SECURITY_LOWMEM=y
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
diff --git a/packages/mamona/cx3110x-770he-0.8.1/fix_cross_makefile.patch b/packages/mamona/cx3110x-770he-0.8.1/fix_cross_makefile.patch
new file mode 100644
index 0000000000..1f75f094b8
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/fix_cross_makefile.patch
@@ -0,0 +1,11 @@
+Index: cx3110x-0.8.1/src/Makefile
+===================================================================
+--- cx3110x-0.8.1.orig/src/Makefile 2008-04-28 15:58:24.000000000 -0300
++++ cx3110x-0.8.1/src/Makefile 2008-04-28 15:58:28.000000000 -0300
+@@ -1,5 +1,5 @@
+ ifeq ($(KERNELRELEASE),)
+-STRIP = arm-linux-strip
++STRIP = $(CROSS_COMPILE)strip
+ PWD := $(shell pwd)
+
+ .PHONY: modules clean
diff --git a/packages/mamona/cx3110x-770he-0.8.1/fix_mem_allign.patch b/packages/mamona/cx3110x-770he-0.8.1/fix_mem_allign.patch
new file mode 100644
index 0000000000..6c452196aa
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/fix_mem_allign.patch
@@ -0,0 +1,94 @@
+Index: cx3110x-0.8.1/src/sm_drv_spi_io.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_spi_io.c 2008-04-22 14:54:42.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi_io.c 2008-04-22 15:00:07.000000000 -0300
+@@ -240,18 +240,21 @@
+ omap_start_dma(spi_dma.dma_tx_ch);
+
+ /* We don't want to turn CS off before transfer is done */
+-
++
++ while(!spi_dma.dma_rx_done) {
++ udelay(5);
++ }
++
+ while(!spi_dma.dma_tx_done) {
+ udelay(5);
+ }
+
++ spi_dma.dma_rx_done = 0;
+ spi_dma.dma_tx_done = 0;
+
+ /* UMAC may send us odd number of bytes long frames */
+ if (length % 2) {
+- u16 last_word;
+-
+- last_word = *(uint16_t *)(buffer + length - 1);
++ u16 last_word = *((uint8_t *)buffer + length - 1);
+ omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2, last_word);
+ }
+
+@@ -264,7 +267,6 @@
+ int cx3110x_spi_read(struct net_device *dev, unsigned long address, unsigned char * buffer, unsigned int length)
+ {
+ int i;
+- u16 * short_buffer = (u16 *) buffer;
+ unsigned int r_length = length >> 1;
+
+ DEBUG(DBG_SPI_IO, "omap_wlan_spi_read\n");
+@@ -274,8 +276,13 @@
+ omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2,
+ (address << 8) | ADDR_READ_BIT_15);
+
+- for (i = 0 ; i < r_length ; i++)
+- omap_mcbsp_spi_master_recv_word_poll(OMAP_MCBSP2, (u32*)(short_buffer + i));
++ for (i = 0 ; i < r_length ; i++) {
++ u32 tmp;
++ omap_mcbsp_spi_master_recv_word_poll(OMAP_MCBSP2, &tmp);
++ /* Assume little endian byte order */
++ buffer[i * 2 + 0] = tmp & 0xFF;
++ buffer[i * 2 + 1] = (tmp >> 8) & 0xFF;
++ }
+
+ SPI_CS_OFF();
+ return 0;
+@@ -285,24 +292,22 @@
+ int cx3110x_spi_write(struct net_device *dev, unsigned long address, unsigned char * buffer, unsigned int length)
+ {
+ int i;
+- u16 * short_buffer = (u16 *) buffer;
+ unsigned int w_length = length >> 1;
+
+-
+ DEBUG(DBG_SPI_IO, "omap_wlan_spi_write (%d bytes @ 0x%lx)\n", length, address << 8);
+
+ SPI_CS_ON();
+
+ omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2, address << 8);
+
+- for (i = 0 ; i < w_length ; i++)
+- omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2, short_buffer[i]);
++ for (i = 0 ; i < w_length ; i++) {
++ /* Assume little endian byte order */
++ omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2, (u32)buffer[i * 2] | ((u32)buffer[i * 2 + 1] << 8));
++ }
+
+ /* UMAC may send us odd number of bytes long frames */
+ if (length % 2) {
+- u16 last_word;
+-
+- last_word = buffer[length - 1];
++ u16 last_word = buffer[length - 1];
+ omap_mcbsp_spi_master_xmit_word_poll(OMAP_MCBSP2, last_word);
+ }
+
+@@ -366,6 +371,9 @@
+ while(rate_mhz/div >= max_mhz)
+ div++;
+
++ printk("McBSP2: freq_limit=%dMHz, base_freq=%dMHz, divisor=%d (%d.%dMHz)\n",
++ max_mhz, rate_mhz, div, rate_mhz / div, (rate_mhz * 10 / div) % 10);
++
+ spi_dma.dma_tx_done = 0;
+ spi_dma.dma_rx_done = 0;
+
diff --git a/packages/mamona/cx3110x-770he-0.8.1/fix_mem_corruption.patch b/packages/mamona/cx3110x-770he-0.8.1/fix_mem_corruption.patch
new file mode 100644
index 0000000000..ae3e87f427
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/fix_mem_corruption.patch
@@ -0,0 +1,53 @@
+Index: cx3110x-0.8.1/src/sm_drv_spi_io.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_spi_io.c 2007-10-15 08:56:20.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi_io.c 2008-04-22 14:53:49.000000000 -0300
+@@ -91,7 +91,7 @@
+ int dma_tx_done;
+ int dma_rx_done;
+
+- uint16_t recv_buffer;
++ uint16_t *recv_buffer;
+ };
+
+ static struct omap_wlan_spi_dma spi_dma;
+@@ -142,7 +142,7 @@
+ omap_set_dma_src_params(spi_dma.dma_tx_ch,
+ OMAP_DMA_PORT_EMIFF,
+ OMAP_DMA_AMODE_CONSTANT,
+- virt_to_phys(&spi_dma.recv_buffer),
++ virt_to_phys(spi_dma.recv_buffer),
+ 0, 0);
+
+ /* Prepare for reading */
+@@ -208,7 +208,7 @@
+ omap_set_dma_dest_params(spi_dma.dma_rx_ch,
+ OMAP_DMA_PORT_EMIFF,
+ OMAP_DMA_AMODE_CONSTANT,
+- virt_to_phys(&spi_dma.recv_buffer),
++ virt_to_phys(spi_dma.recv_buffer),
+ 0, 0);
+
+
+@@ -319,6 +319,12 @@
+ struct net_local * lp;
+ struct spi_hif_local_data * spi_lp;
+
++ spi_dma.recv_buffer = kmalloc(sizeof(*spi_dma.recv_buffer), GFP_ATOMIC);
++ if (!spi_dma.recv_buffer) {
++ printk("spi_dma.recv_buffer allocation failed\n");
++ return -1;
++ }
++
+ lp = dev->priv;
+ spi_lp = HIF_LP(lp);
+
+@@ -411,6 +417,8 @@
+ omap_free_gpio(wlan_config->irq_gpio);
+ omap_free_dma(spi_dma.dma_tx_ch);
+ omap_free_dma(spi_dma.dma_rx_ch);
++
++ kfree(spi_dma.recv_buffer);
+ }
+
+
diff --git a/packages/mamona/cx3110x-770he-0.8.1/fix_opps_while_connecting_with_nm.patch b/packages/mamona/cx3110x-770he-0.8.1/fix_opps_while_connecting_with_nm.patch
new file mode 100644
index 0000000000..c73564535f
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/fix_opps_while_connecting_with_nm.patch
@@ -0,0 +1,128 @@
+Index: cx3110x-0.8.1/src/sm_drv_ioctl_umac.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_ioctl_umac.c
++++ cx3110x-0.8.1/src/sm_drv_ioctl_umac.c
+@@ -1085,28 +1085,31 @@ static int sm_drv_get_wap(struct net_dev
+ static int sm_drv_set_scan(struct net_device *dev, struct iw_request_info *info,
+ struct iw_point *vwrq, char *extra)
+ {
+- int ret = 0;
++ int ret = 0, l, msecs;
+ struct obj_ssid essid;
+ int16_t scan = -1;
+ uint32_t scan_mode, flush_bss_list = 1;
+ struct net_local *lp = dev->priv;
+ uint32_t bgr_scan_disable = 1;
+
++ memset(essid.octets, 0, sizeof(essid.octets));
++
+ if (vwrq == NULL)
+ return -EINVAL;
+
+ /* First we flush the UMAC's AP list*/
+- ret = sm_drv_oid_set(dev, DOT11_OID_BSSLISTFLUSH, (void*)&flush_bss_list, sizeof(uint32_t));
++ ret = sm_drv_oid_set(dev, DOT11_OID_BSSLISTFLUSH,
++ (void*)&flush_bss_list, sizeof(uint32_t));
+ if (ret < 0)
+ return ret;
+
+ if (vwrq->flags & IW_SCAN_THIS_ESSID) {
+ if (vwrq->length > 0) {
+- essid.length = vwrq->length - 1;
+- memcpy(essid.octets, vwrq->pointer, essid.length + 1);
++ l = vwrq->length;
++ essid.length = min(l, IW_ESSID_MAX_SIZE);
++ memcpy(essid.octets, vwrq->pointer, essid.length);
+ } else {
+ essid.length = 0;
+- memset(essid.octets, 0, sizeof(essid.octets));
+ }
+ scan_mode = SCAN_MODE_ACTIVE;
+ } else {
+@@ -1114,48 +1117,76 @@ static int sm_drv_set_scan(struct net_de
+ scan_mode = SCAN_MODE_PASSIVE;
+ }
+
+- ret = sm_drv_oid_set(dev, DOT11_OID_SCANMODE, (void*)&scan_mode, sizeof(uint32_t));
++ ret = sm_drv_oid_set(dev, DOT11_OID_SCANMODE, (void*)&scan_mode,
++ sizeof(uint32_t));
+ if (ret < 0)
+ return ret;
+
+- ret = sm_drv_oid_set(dev, DOT11_OID_SCANSSID, (void*)&essid, sizeof(struct obj_ssid));
++ ret = sm_drv_oid_set(dev, DOT11_OID_SCANSSID, (void*)&essid,
++ sizeof(struct obj_ssid));
+ if (ret < 0)
+ return ret;
++
++ spin_lock_bh(&lp->sm_lock);
+
+ /* We let the background scanning work a bit...*/
+- if (scan_mode == SCAN_MODE_PASSIVE && lp->link_state != DOT11_STATE_ASSOC)
+- msleep(2000);
++ if (scan_mode == SCAN_MODE_PASSIVE
++ && lp->link_state != DOT11_STATE_ASSOC)
++ msecs = 2000;
++ else
++ /* for active scan, the delay can be smaller */
++ msecs = 30;
++
++ spin_unlock_bh(&lp->sm_lock);
++
++ msleep(msecs);
++
++ spin_lock_bh(&lp->sm_lock);
+
+- /* Let's start the scan timer in case UMAC doesn't trap the scan event */
++ /*
++ * Let's start the scan timer in case UMAC doesn't trap the scan
++ * event
++ */
+ mod_timer(&lp->scan_timer, jiffies + 4 * HZ);
+
+ if (lp->link_state != DOT11_STATE_ASSOC &&
+ lp->bss_type != DOT11_BSSTYPE_IBSS) {
++ spin_unlock_bh(&lp->sm_lock);
+ ret = sm_drv_oid_set(dev, DOT11_OID_AUTOSCANDISABLE,
+ (void*)&bgr_scan_disable,
+ sizeof(uint32_t));
++ spin_lock_bh(&lp->sm_lock);
+ if (ret < 0)
+ return ret;
+ }
++ spin_unlock_bh(&lp->sm_lock);
+
+ /* And finally we send the scan request */
+- ret = sm_drv_oid_set(dev, DOT11_OID_SCAN, (void*)&scan, sizeof(int16_t));
++ ret = sm_drv_oid_set(dev, DOT11_OID_SCAN, (void*)&scan,
++ sizeof(int16_t));
++
+ if (ret < 0) {
+ /*
+ * If we're associated, we haven't disable bgr scan,
+ * so we don't need to go there.
+ */
++ spin_lock_bh(&lp->sm_lock);
+ if (lp->link_state != DOT11_STATE_ASSOC &&
+- lp->bss_type != DOT11_BSSTYPE_IBSS)
++ lp->bss_type != DOT11_BSSTYPE_IBSS) {
++ spin_unlock_bh(&lp->sm_lock);
+ goto scan_err_out;
++ }
++ spin_unlock_bh(&lp->sm_lock);
+ }
+-
++
+ return 0;
+
+ scan_err_out:
+- DEBUG(DBG_ALL, "Scanning failed (err: %d), turning background scanning on\n", ret);
++ DEBUG(DBG_ALL, "scanning failed (%d), enabling background scan.",
++ ret);
+ bgr_scan_disable = 0;
+- sm_drv_oid_set(dev, DOT11_OID_AUTOSCANDISABLE, (void*)&bgr_scan_disable, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_AUTOSCANDISABLE,
++ (void*)&bgr_scan_disable, sizeof(uint32_t));
+
+ return ret;
+ }
diff --git a/packages/mamona/cx3110x-770he-0.8.1/fix_ssid_data_length.patch b/packages/mamona/cx3110x-770he-0.8.1/fix_ssid_data_length.patch
new file mode 100644
index 0000000000..a9e36ce6dd
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/fix_ssid_data_length.patch
@@ -0,0 +1,13 @@
+Index: cx3110x-0.8.1/src/sm_drv_ioctl_umac.c
+===================================================================
+--- cx3110x-0.8.1.orig/src/sm_drv_ioctl_umac.c 2008-04-28 15:59:37.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_ioctl_umac.c 2008-04-28 15:59:57.000000000 -0300
+@@ -171,7 +171,7 @@
+ /* The following entries will be displayed in the same order we give them */
+
+ /* The ESSID. */
+- iwe.u.data.length = strlen(bss->ssid);
++ iwe.u.data.length = strlen(bss->ssid + 1);
+ iwe.u.data.flags = 1;
+ iwe.cmd = SIOCGIWESSID;
+ current_ev = iwe_stream_add_point(current_ev, end_buf,
diff --git a/packages/mamona/cx3110x-770he-0.8.1/series b/packages/mamona/cx3110x-770he-0.8.1/series
new file mode 100644
index 0000000000..fa690cb729
--- /dev/null
+++ b/packages/mamona/cx3110x-770he-0.8.1/series
@@ -0,0 +1,7 @@
+fix_mem_corruption.patch
+fix_mem_allign.patch
+cx3110x.patch
+fix_cross_makefile.patch
+fix_ssid_data_length.patch
+770_performance_improvements.patch
+create_sysfs_link_for_wlan0.patch
diff --git a/packages/mamona/cx3110x-770he_0.8.1.bb b/packages/mamona/cx3110x-770he_0.8.1.bb
new file mode 100644
index 0000000000..8e78ccf208
--- /dev/null
+++ b/packages/mamona/cx3110x-770he_0.8.1.bb
@@ -0,0 +1,30 @@
+PR = "r2"
+
+KERVER = "2.6.16"
+
+COMPATIBLE_MACHINE = "(nokia770)"
+
+S = "${WORKDIR}/cx3110x-0.8.1"
+SKERNEL = "${WORKDIR}/kernel-source-${KERVER}"
+
+# The following require must be after S{S}, ${SKERNEL}, ${KERVER}
+require cx3110x.inc
+
+SRC_URI += "https://garage.maemo.org/frs/download.php/2443/cx3110x-0.8.1.tar.gz \
+ http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \
+ http://dev.openbossa.org/mamona/sources/kernel-source-${KERVER}.tar.gz \
+ file://defconfig \
+ file://fix_mem_corruption.patch;patch=1 \
+ file://fix_mem_allign.patch;patch=1 \
+ file://cx3110x.patch;patch=1 \
+ file://fix_cross_makefile.patch;patch=1 \
+ file://fix_ssid_data_length.patch;patch=1 \
+ file://770_performance_improvements.patch;patch=1 \
+ file://create_sysfs_link_for_wlan0.patch;patch=1 \
+ file://fix_opps_while_connecting_with_nm.patch;patch=1 \
+"
+
+do_compile() {
+ cp ${WORKDIR}/defconfig ${SKERNEL}/.config
+ KERNEL_SRC_DIR=${SKERNEL} PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules
+}
diff --git a/packages/mamona/cx3110x-chinooke-2.0.15/create_sysfs_link_for_wlan0.patch b/packages/mamona/cx3110x-chinooke-2.0.15/create_sysfs_link_for_wlan0.patch
new file mode 100644
index 0000000000..cf4fa1e96a
--- /dev/null
+++ b/packages/mamona/cx3110x-chinooke-2.0.15/create_sysfs_link_for_wlan0.patch
@@ -0,0 +1,11 @@
+--- cx3110x-0.8.1.new/src/sm_drv_spi.c 2008-05-13 10:27:19.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi.c 2008-05-12 19:02:16.000000000 -0300
+@@ -1067,6 +1067,8 @@
+ goto err_out_4;
+ }
+
++ SET_NETDEV_DEV(dev, &wlan_omap_device.dev);
++
+ register_netdev(dev);
+
+ /* Let's fetch the firmware from userspace */
diff --git a/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x b/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x
new file mode 100755
index 0000000000..ce2ecdfbe8
--- /dev/null
+++ b/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+MODULE="/lib/modules/`uname -r`/cx3110x.ko"
+
+swap_module () {
+ if [ -e $MODULE ]; then
+ # Removing builtin driver
+ rmmod cx3110x
+ # Inserting the new one
+ insmod $MODULE
+ # Setting device options (MAC, default country, etc)
+ if [ -x /mnt/initfs/usr/bin/wlan-cal ]; then
+ chroot /mnt/initfs /usr/bin/wlan-cal
+ fi
+ else
+ echo "OOPS: $MODULE not found, the switch is not possible" 1>&2
+ fi
+}
+
+case "$1" in
+ start)
+ swap_module
+ ;;
+ stop)
+ rmmod cx3110x
+ ;;
+ force-reload | restart)
+ swap_module
+ ;;
+ *)
+ echo "Usage: /etc/init.d/cx3110x {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x.patch b/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x.patch
new file mode 100644
index 0000000000..b280815efc
--- /dev/null
+++ b/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x.patch
@@ -0,0 +1,492 @@
+diff -ru cx3110x-module-src-2.0.14.orig/src/sm_drv_ioctl_umac.c cx3110x-module-src-2.0.14/src/sm_drv_ioctl_umac.c
+--- cx3110x-module-src-2.0.14.orig/src/sm_drv_ioctl_umac.c 2007-09-25 13:02:17.000000000 -0300
++++ cx3110x-module-src-2.0.14/src/sm_drv_ioctl_umac.c 2007-10-09 15:32:30.000000000 -0300
+@@ -88,8 +88,8 @@
+ kfree(wrqu.data.pointer);
+ }
+
+-void send_wpa_ie_event(struct net_device *dev, char * bss_addr,
+- char * wpa_ie, size_t wpa_ie_len, uint32_t event)
++void send_wpa_ie_event(struct net_device *dev, char * wpa_ie,
++ size_t wpa_ie_len, uint32_t event)
+ {
+ union iwreq_data wrqu;
+ uint32_t we_event;
+@@ -111,15 +111,12 @@
+ return;
+ }
+
+- wrqu.data.pointer = kzalloc(ETH_ALEN + 1 + wpa_ie_len, GFP_ATOMIC);
++ wrqu.data.pointer = kzalloc(wpa_ie_len, GFP_ATOMIC);
+ if (!wrqu.data.pointer)
+ return;
+
+- memcpy(wrqu.data.pointer, bss_addr, ETH_ALEN);
+- *((char *)(wrqu.data.pointer + ETH_ALEN)) = ':';
+- memcpy(wrqu.data.pointer + ETH_ALEN + 1, wpa_ie, wpa_ie_len);
+-
+- wrqu.data.length = ETH_ALEN + 1 + wpa_ie_len;
++ memcpy(wrqu.data.pointer, wpa_ie, wpa_ie_len);
++ wrqu.data.length = wpa_ie_len;
+
+ wireless_send_event(dev, we_event, &wrqu, wrqu.data.pointer);
+ kfree(wrqu.data.pointer);
+@@ -478,7 +475,7 @@
+ if ((lp->link_state == DOT11_STATE_ASSOCING
+ || lp->link_state == DOT11_STATE_ASSOC)
+ && event)
+- send_wpa_ie_event(dev, bssid, wpa_ie, wpa_ie_len, event);
++ send_wpa_ie_event(dev, wpa_ie, wpa_ie_len, event);
+
+ /* try to use existing entry */
+ list_for_each_entry_safe(bss, safe, &lp->bss_wpa_list, list) {
+@@ -1928,6 +1925,435 @@
+ (void *)&key, sizeof(struct obj_stakey));
+ }
+
++static int sm_drv_set_auth(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_param *param = &wrqu->param;
++ u32 authen = 0, dot1x = 0;
++ u32 exunencrypt = 0, privinvoked = 0, wpa = 0;
++ u32 old_wpa;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "SET AUTH\n");
++
++ /* first get the flags */
++ down(&priv->wpa_sem);
++ wpa = old_wpa = priv->wpa;
++ up(&priv->wpa_sem);
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++
++ if (ret < 0)
++ goto out;
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_CIPHER_PAIRWISE:
++ case IW_AUTH_CIPHER_GROUP:
++ case IW_AUTH_KEY_MGMT:
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ /* Do the same thing as IW_AUTH_WPA_VERSION */
++ if (param->value) {
++ wpa = DOT11_PRIV_INV_TKIP;
++ privinvoked = 1; /* For privacy invoked */
++ exunencrypt = 1; /* Filter out all unencrypted frames */
++ dot1x = 0x01; /* To enable eap filter */
++ authen = DOT11_AUTH_OS; /* Only WEP uses _SK and _BOTH */
++ } else {
++ wpa = DOT11_PRIV_INV_NONE;
++ privinvoked = 0;
++ exunencrypt = 0; /* Do not filter un-encrypted data */
++ dot1x = 0;
++ }
++ break;
++
++ case IW_AUTH_WPA_VERSION:
++ if (param->value & IW_AUTH_WPA_VERSION_DISABLED) {
++ wpa = DOT11_PRIV_INV_NONE;
++ privinvoked = 0;
++ exunencrypt = 0; /* Do not filter un-encrypted data */
++ dot1x = 0;
++ } else {
++ if (param->value & IW_AUTH_WPA_VERSION_WPA)
++ wpa = DOT11_PRIV_INV_TKIP;
++ else if (param->value & IW_AUTH_WPA_VERSION_WPA2)
++ wpa = DOT11_PRIV_INV_AES_CCMP;
++ privinvoked = 1; /* For privacy invoked */
++ exunencrypt = 1; /* Filter out all unencrypted frames */
++ dot1x = 0x01; /* To enable eap filter */
++ authen = DOT11_AUTH_OS; /* Only WEP uses _SK and _BOTH */
++ }
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ /* dot1x should be the opposite of RX_UNENCRYPTED_EAPOL;
++ * turn off dot1x when allowing receipt of unencrypted EAPOL
++ * frames, turn on dot1x when receipt should be disallowed
++ */
++ dot1x = param->value ? 0 : 0x01;
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ privinvoked = param->value ? 1 : 0;
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ exunencrypt = param->value ? 1 : 0;
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ if (param->value & IW_AUTH_ALG_SHARED_KEY) {
++ /* Only WEP uses _SK and _BOTH */
++ if (wpa > 0) {
++ ret = -EINVAL;
++ goto out;
++ }
++ authen = DOT11_AUTH_SK;
++ } else if (param->value & IW_AUTH_ALG_OPEN_SYSTEM) {
++ authen = DOT11_AUTH_OS;
++ } else {
++ ret = -EINVAL;
++ goto out;
++ }
++ break;
++
++ default:
++ return -EOPNOTSUPP;
++ }
++
++ /* Set all the values */
++ down(&priv->wpa_sem);
++ priv->wpa = wpa;
++ up(&priv->wpa_sem);
++
++ sm_drv_oid_set(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++
++ out:
++ return ret;
++}
++
++static int sm_drv_get_auth(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_param *param = &wrqu->param;
++ u32 authen = 0, dot1x = 0;
++ u32 exunencrypt = 0, privinvoked = 0, wpa = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "GET AUTH\n");
++
++ /* first get the flags */
++ down(&priv->wpa_sem);
++ wpa = priv->wpa;
++ up(&priv->wpa_sem);
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_CIPHER_PAIRWISE:
++ case IW_AUTH_CIPHER_GROUP:
++ case IW_AUTH_KEY_MGMT:
++ /*
++ * wpa_supplicant will control these internally
++ */
++ ret = -EOPNOTSUPP;
++ break;
++
++ case IW_AUTH_WPA_VERSION:
++ switch (wpa) {
++ case DOT11_PRIV_INV_TKIP:
++ param->value = IW_AUTH_WPA_VERSION_WPA;
++ break;
++ case DOT11_PRIV_INV_AES_CCMP:
++ param->value = IW_AUTH_WPA_VERSION_WPA2;
++ break;
++ default:
++ param->value = IW_AUTH_WPA_VERSION_DISABLED;
++ break;
++ }
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ ret = sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = exunencrypt > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ if (ret >= 0) {
++ switch (authen) {
++ case DOT11_AUTH_OS:
++ param->value = IW_AUTH_ALG_OPEN_SYSTEM;
++ break;
++ case DOT11_AUTH_BOTH:
++ case DOT11_AUTH_SK:
++ param->value = IW_AUTH_ALG_SHARED_KEY;
++ case DOT11_AUTH_NONE:
++ default:
++ param->value = 0;
++ break;
++ }
++ }
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ param->value = wpa > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ ret = sm_drv_oid_get(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = dot1x > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ ret = sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = privinvoked > 0 ? 1 : 0;
++ break;
++
++ default:
++ return -EOPNOTSUPP;
++ }
++ return ret;
++}
++
++#define KEY_SIZE_WEP104 13 /* 104/128-bit WEP keys */
++#define KEY_SIZE_WEP40 5 /* 40/64-bit WEP keys */
++#define KEY_SIZE_TKIP 32 /* TKIP keys */
++
++static int sm_drv_set_encodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int idx, alg = ext->alg, set_key = 1;
++ int authen = DOT11_AUTH_OS, invoke = 0, exunencrypt = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "SET ENCODEEXT\n");
++
++ /* Determine and validate the key index */
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ } else {
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++ }
++
++ if (encoding->flags & IW_ENCODE_DISABLED)
++ alg = IW_ENCODE_ALG_NONE;
++
++ if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
++ /* Only set transmit key index here, actual
++ * key is set below if needed.
++ */
++ ret = sm_drv_oid_set(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ set_key = ext->key_len > 0 ? 1 : 0;
++ }
++
++ if (set_key) {
++ switch (alg) {
++ case IW_ENCODE_ALG_NONE:
++ break;
++ case IW_ENCODE_ALG_WEP: {
++ struct obj_key key = { DOT11_PRIV_WEP, 0, "" };
++ memset(key.key, 0, sizeof(key.key));
++ if (ext->key_len > KEY_SIZE_WEP104) {
++ ret = -EINVAL;
++ goto out;
++ }
++ if (ext->key_len > KEY_SIZE_WEP40)
++ key.length = KEY_SIZE_WEP104;
++ else
++ key.length = KEY_SIZE_WEP40;
++ memcpy(key.key, ext->key, ext->key_len);
++ ret = sm_drv_oid_set(dev, DOT11_OID_DEFKEYID + idx + 1,
++ (void *)&key,
++ sizeof(struct obj_key));
++ break;
++ }
++ case IW_ENCODE_ALG_TKIP:
++ case IW_ENCODE_ALG_CCMP: {
++ struct obj_stakey key;
++ memset(key.key, 0, sizeof(key.key));
++ if (alg == IW_ENCODE_ALG_TKIP)
++ key.type = DOT11_PRIV_TKIP;
++ else
++ key.type = DOT11_PRIV_AES_CCMP;
++ memcpy(key.address, ext->addr.sa_data, ETH_ALEN);
++ key.length = ext->key_len;
++ key.keyid = idx;
++ key.ext = 0;
++ memcpy(key.key, ext->key, ext->key_len);
++ ret = sm_drv_oid_set(dev, DOT11_OID_STAKEY,
++ (void *)&key,
++ sizeof(struct obj_stakey));
++ break;
++ }
++ default:
++ return -EINVAL;
++ }
++
++ if (ret < 0)
++ goto out;
++
++ }
++
++ /* Read the flags */
++ if (encoding->flags & IW_ENCODE_DISABLED) {
++ /* Encoding disabled,
++ * authen = DOT11_AUTH_OS;
++ * invoke = 0;
++ * exunencrypt = 0; */
++ }
++ if (encoding->flags & IW_ENCODE_OPEN) {
++ /* Encode but accept non-encoded packets. No auth */
++ invoke = 1;
++ }
++ if (encoding->flags & IW_ENCODE_RESTRICTED) {
++ /* Refuse non-encoded packets. Auth */
++ authen = DOT11_AUTH_BOTH;
++ invoke = 1;
++ exunencrypt = 1;
++ }
++
++ /* do the change if requested */
++ if (encoding->flags & IW_ENCODE_MODE) {
++ sm_drv_oid_set(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&invoke, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ }
++
++ out:
++ return ret;
++}
++
++
++static int sm_drv_get_encodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int idx, max_key_len;
++ int authen = DOT11_AUTH_OS, invoke = 0, exunencrypt = 0, wpa = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "GET ENCODEEXT\n");
++
++ /* first get the flags */
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&invoke, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++
++ max_key_len = encoding->length - sizeof(*ext);
++ if (max_key_len < 0)
++ return -EINVAL;
++
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ } else {
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++ }
++
++ encoding->flags = idx + 1;
++ memset(ext, 0, sizeof(*ext));
++
++ switch (authen) {
++ case DOT11_AUTH_BOTH:
++ case DOT11_AUTH_SK:
++ wrqu->encoding.flags |= IW_ENCODE_RESTRICTED;
++ case DOT11_AUTH_OS:
++ default:
++ wrqu->encoding.flags |= IW_ENCODE_OPEN;
++ break;
++ }
++
++ down(&priv->wpa_sem);
++ wpa = priv->wpa;
++ up(&priv->wpa_sem);
++
++ if (authen == DOT11_AUTH_OS && !exunencrypt && !invoke && !wpa) {
++ /* No encryption */
++ ext->alg = IW_ENCODE_ALG_NONE;
++ ext->key_len = 0;
++ wrqu->encoding.flags |= IW_ENCODE_DISABLED;
++ } else {
++ struct obj_key *key;
++
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID + idx + 1,
++ (void *)&key, sizeof(struct obj_key));
++ if (ret < 0)
++ goto out;
++ if (max_key_len < key->length) {
++ ret = -E2BIG;
++ goto out;
++ }
++ memcpy(ext->key, key->key, key->length);
++ ext->key_len = key->length;
++
++ switch (key->type) {
++ case DOT11_PRIV_TKIP:
++ ext->alg = IW_ENCODE_ALG_TKIP;
++ break;
++ case DOT11_PRIV_AES_CCMP:
++ ext->alg = IW_ENCODE_ALG_CCMP;
++ break;
++ default:
++ case DOT11_PRIV_WEP:
++ ext->alg = IW_ENCODE_ALG_WEP;
++ break;
++ }
++ wrqu->encoding.flags |= IW_ENCODE_ENABLED;
++ }
++
++ out:
++ return ret;
++}
+
+ /* Private handlers */
+
+@@ -2473,10 +2899,10 @@
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) sm_drv_set_genie, /* SIOCSIWGENIE*/
+ (iw_handler) NULL, /* SIOCGIWGENIE */
+- (iw_handler) NULL, /* SIOCSIWAUTH */
+- (iw_handler) NULL, /* SIOCGIWAUTH */
+- (iw_handler) NULL, /* SIOCSIWENCODEEXT */
+- (iw_handler) NULL, /* SIOCGIWENCODEEXT */
++ (iw_handler) sm_drv_set_auth, /* SIOCSIWAUTH */
++ (iw_handler) sm_drv_get_auth, /* SIOCGIWAUTH */
++ (iw_handler) sm_drv_set_encodeext, /* SIOCSIWENCODEEXT */
++ (iw_handler) sm_drv_get_encodeext, /* SIOCGIWENCODEEXT */
+ (iw_handler) sm_drv_set_pmk, /* SIOCSIWPMKSA */
+ };
diff --git a/packages/mamona/cx3110x-chinooke-2.0.15/fix_old_include.patch b/packages/mamona/cx3110x-chinooke-2.0.15/fix_old_include.patch
new file mode 100644
index 0000000000..61549fdaff
--- /dev/null
+++ b/packages/mamona/cx3110x-chinooke-2.0.15/fix_old_include.patch
@@ -0,0 +1,13 @@
+Index: cx3110x-module-src-2.0.15/src/sm_drv_spi.c
+===================================================================
+--- cx3110x-module-src-2.0.15.orig/src/sm_drv_spi.c 2008-08-06 19:55:37.000000000 -0300
++++ cx3110x-module-src-2.0.15/src/sm_drv_spi.c 2008-08-06 19:56:05.000000000 -0300
+@@ -36,7 +36,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/string.h>
+ #include <linux/firmware.h>
+-#include <linux/config.h>
++#include <linux/autoconf.h>
+ #if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
+ #error No Firmware Loading configured in the kernel !
+ #endif
diff --git a/packages/mamona/cx3110x-chinooke_2.0.15.bb b/packages/mamona/cx3110x-chinooke_2.0.15.bb
new file mode 100644
index 0000000000..50de7460fe
--- /dev/null
+++ b/packages/mamona/cx3110x-chinooke_2.0.15.bb
@@ -0,0 +1,31 @@
+PR = "r1"
+
+KERVER = "2.6.21"
+
+COMPATIBLE_MACHINE = "(nokia800|nokia810)"
+
+S = "${WORKDIR}/cx3110x-module-src-2.0.15"
+SKERNEL = "${WORKDIR}/kernel-source-rx-34-2.6.21.0"
+
+# The following require must be after S{S}, ${SKERNEL}, ${KERVER}
+require cx3110x.inc
+
+SRC_URI += "\
+ http://repository.maemo.org/pool/maemo4.1/free/c/cx3110x-module-src/cx3110x-module-src_2.0.15-1.tar.gz \
+ http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \
+ http://repository.maemo.org/pool/chinook/free/k/kernel-source-rx-34/kernel-source-rx-34_2.6.21.0.orig.tar.gz \
+ http://repository.maemo.org/pool/chinook/free/k/kernel-source-rx-34/kernel-source-rx-34_2.6.21.0-osso71.diff.gz \
+ file://cx3110x.patch;patch=1 \
+ file://create_sysfs_link_for_wlan0.patch;patch=1 \
+ file://fix_old_include.patch;patch=1 \
+"
+
+do_compile() {
+ cd ${SKERNEL}
+ patch -p1 < ${WORKDIR}/kernel-source-rx-34_2.6.21.0-osso71.diff
+ cd ${S}
+ PATH=${WORKDIR}/bin/:$PATH make -C ${SKERNEL} CROSS_COMPILE=arm-none-eabi- nokia_2420_defconfig prepare scripts
+ KERNEL_SRC_DIR=${SKERNEL} PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules
+}
+
+
diff --git a/packages/mamona/cx3110x-diablo-2.0.15/create_sysfs_link_for_wlan0.patch b/packages/mamona/cx3110x-diablo-2.0.15/create_sysfs_link_for_wlan0.patch
new file mode 100644
index 0000000000..cf4fa1e96a
--- /dev/null
+++ b/packages/mamona/cx3110x-diablo-2.0.15/create_sysfs_link_for_wlan0.patch
@@ -0,0 +1,11 @@
+--- cx3110x-0.8.1.new/src/sm_drv_spi.c 2008-05-13 10:27:19.000000000 -0300
++++ cx3110x-0.8.1/src/sm_drv_spi.c 2008-05-12 19:02:16.000000000 -0300
+@@ -1067,6 +1067,8 @@
+ goto err_out_4;
+ }
+
++ SET_NETDEV_DEV(dev, &wlan_omap_device.dev);
++
+ register_netdev(dev);
+
+ /* Let's fetch the firmware from userspace */
diff --git a/packages/mamona/cx3110x-diablo-2.0.15/cx3110x b/packages/mamona/cx3110x-diablo-2.0.15/cx3110x
new file mode 100755
index 0000000000..592c7032ca
--- /dev/null
+++ b/packages/mamona/cx3110x-diablo-2.0.15/cx3110x
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+MODULE="/lib/modules/`uname -r`/cx3110x.ko"
+
+swap_module () {
+ if [ -e $MODULE ]; then
+ # Removing builtin driver
+ rmmod cx3110x
+ # Inserting the new one
+ insmod $MODULE
+ # Setting device options (MAC, default country, etc)
+ if [ -x /mnt/initfs/usr/bin/wlan-cal ]; then
+ chroot /mnt/initfs /usr/bin/wlan-cal
+ fi
+ # Getting up the interface to make the firmware being loaded (stupid, i know)
+ ifconfig wlan0 up
+ else
+ echo "OOPS: $MODULE not found, the switch is not possible" 1>&2
+ fi
+}
+
+case "$1" in
+ start)
+ swap_module
+ ;;
+ stop)
+ ifconfig $IFACE down
+ rmmod cx3110x
+ ;;
+ force-reload | restart)
+ swap_module
+ ;;
+ *)
+ echo "Usage: /etc/init.d/cx3110x {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/packages/mamona/cx3110x-diablo-2.0.15/cx3110x.patch b/packages/mamona/cx3110x-diablo-2.0.15/cx3110x.patch
new file mode 100644
index 0000000000..b280815efc
--- /dev/null
+++ b/packages/mamona/cx3110x-diablo-2.0.15/cx3110x.patch
@@ -0,0 +1,492 @@
+diff -ru cx3110x-module-src-2.0.14.orig/src/sm_drv_ioctl_umac.c cx3110x-module-src-2.0.14/src/sm_drv_ioctl_umac.c
+--- cx3110x-module-src-2.0.14.orig/src/sm_drv_ioctl_umac.c 2007-09-25 13:02:17.000000000 -0300
++++ cx3110x-module-src-2.0.14/src/sm_drv_ioctl_umac.c 2007-10-09 15:32:30.000000000 -0300
+@@ -88,8 +88,8 @@
+ kfree(wrqu.data.pointer);
+ }
+
+-void send_wpa_ie_event(struct net_device *dev, char * bss_addr,
+- char * wpa_ie, size_t wpa_ie_len, uint32_t event)
++void send_wpa_ie_event(struct net_device *dev, char * wpa_ie,
++ size_t wpa_ie_len, uint32_t event)
+ {
+ union iwreq_data wrqu;
+ uint32_t we_event;
+@@ -111,15 +111,12 @@
+ return;
+ }
+
+- wrqu.data.pointer = kzalloc(ETH_ALEN + 1 + wpa_ie_len, GFP_ATOMIC);
++ wrqu.data.pointer = kzalloc(wpa_ie_len, GFP_ATOMIC);
+ if (!wrqu.data.pointer)
+ return;
+
+- memcpy(wrqu.data.pointer, bss_addr, ETH_ALEN);
+- *((char *)(wrqu.data.pointer + ETH_ALEN)) = ':';
+- memcpy(wrqu.data.pointer + ETH_ALEN + 1, wpa_ie, wpa_ie_len);
+-
+- wrqu.data.length = ETH_ALEN + 1 + wpa_ie_len;
++ memcpy(wrqu.data.pointer, wpa_ie, wpa_ie_len);
++ wrqu.data.length = wpa_ie_len;
+
+ wireless_send_event(dev, we_event, &wrqu, wrqu.data.pointer);
+ kfree(wrqu.data.pointer);
+@@ -478,7 +475,7 @@
+ if ((lp->link_state == DOT11_STATE_ASSOCING
+ || lp->link_state == DOT11_STATE_ASSOC)
+ && event)
+- send_wpa_ie_event(dev, bssid, wpa_ie, wpa_ie_len, event);
++ send_wpa_ie_event(dev, wpa_ie, wpa_ie_len, event);
+
+ /* try to use existing entry */
+ list_for_each_entry_safe(bss, safe, &lp->bss_wpa_list, list) {
+@@ -1928,6 +1925,435 @@
+ (void *)&key, sizeof(struct obj_stakey));
+ }
+
++static int sm_drv_set_auth(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_param *param = &wrqu->param;
++ u32 authen = 0, dot1x = 0;
++ u32 exunencrypt = 0, privinvoked = 0, wpa = 0;
++ u32 old_wpa;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "SET AUTH\n");
++
++ /* first get the flags */
++ down(&priv->wpa_sem);
++ wpa = old_wpa = priv->wpa;
++ up(&priv->wpa_sem);
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++
++ if (ret < 0)
++ goto out;
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_CIPHER_PAIRWISE:
++ case IW_AUTH_CIPHER_GROUP:
++ case IW_AUTH_KEY_MGMT:
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ /* Do the same thing as IW_AUTH_WPA_VERSION */
++ if (param->value) {
++ wpa = DOT11_PRIV_INV_TKIP;
++ privinvoked = 1; /* For privacy invoked */
++ exunencrypt = 1; /* Filter out all unencrypted frames */
++ dot1x = 0x01; /* To enable eap filter */
++ authen = DOT11_AUTH_OS; /* Only WEP uses _SK and _BOTH */
++ } else {
++ wpa = DOT11_PRIV_INV_NONE;
++ privinvoked = 0;
++ exunencrypt = 0; /* Do not filter un-encrypted data */
++ dot1x = 0;
++ }
++ break;
++
++ case IW_AUTH_WPA_VERSION:
++ if (param->value & IW_AUTH_WPA_VERSION_DISABLED) {
++ wpa = DOT11_PRIV_INV_NONE;
++ privinvoked = 0;
++ exunencrypt = 0; /* Do not filter un-encrypted data */
++ dot1x = 0;
++ } else {
++ if (param->value & IW_AUTH_WPA_VERSION_WPA)
++ wpa = DOT11_PRIV_INV_TKIP;
++ else if (param->value & IW_AUTH_WPA_VERSION_WPA2)
++ wpa = DOT11_PRIV_INV_AES_CCMP;
++ privinvoked = 1; /* For privacy invoked */
++ exunencrypt = 1; /* Filter out all unencrypted frames */
++ dot1x = 0x01; /* To enable eap filter */
++ authen = DOT11_AUTH_OS; /* Only WEP uses _SK and _BOTH */
++ }
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ /* dot1x should be the opposite of RX_UNENCRYPTED_EAPOL;
++ * turn off dot1x when allowing receipt of unencrypted EAPOL
++ * frames, turn on dot1x when receipt should be disallowed
++ */
++ dot1x = param->value ? 0 : 0x01;
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ privinvoked = param->value ? 1 : 0;
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ exunencrypt = param->value ? 1 : 0;
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ if (param->value & IW_AUTH_ALG_SHARED_KEY) {
++ /* Only WEP uses _SK and _BOTH */
++ if (wpa > 0) {
++ ret = -EINVAL;
++ goto out;
++ }
++ authen = DOT11_AUTH_SK;
++ } else if (param->value & IW_AUTH_ALG_OPEN_SYSTEM) {
++ authen = DOT11_AUTH_OS;
++ } else {
++ ret = -EINVAL;
++ goto out;
++ }
++ break;
++
++ default:
++ return -EOPNOTSUPP;
++ }
++
++ /* Set all the values */
++ down(&priv->wpa_sem);
++ priv->wpa = wpa;
++ up(&priv->wpa_sem);
++
++ sm_drv_oid_set(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++
++ out:
++ return ret;
++}
++
++static int sm_drv_get_auth(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_param *param = &wrqu->param;
++ u32 authen = 0, dot1x = 0;
++ u32 exunencrypt = 0, privinvoked = 0, wpa = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "GET AUTH\n");
++
++ /* first get the flags */
++ down(&priv->wpa_sem);
++ wpa = priv->wpa;
++ up(&priv->wpa_sem);
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_CIPHER_PAIRWISE:
++ case IW_AUTH_CIPHER_GROUP:
++ case IW_AUTH_KEY_MGMT:
++ /*
++ * wpa_supplicant will control these internally
++ */
++ ret = -EOPNOTSUPP;
++ break;
++
++ case IW_AUTH_WPA_VERSION:
++ switch (wpa) {
++ case DOT11_PRIV_INV_TKIP:
++ param->value = IW_AUTH_WPA_VERSION_WPA;
++ break;
++ case DOT11_PRIV_INV_AES_CCMP:
++ param->value = IW_AUTH_WPA_VERSION_WPA2;
++ break;
++ default:
++ param->value = IW_AUTH_WPA_VERSION_DISABLED;
++ break;
++ }
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ ret = sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = exunencrypt > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ if (ret >= 0) {
++ switch (authen) {
++ case DOT11_AUTH_OS:
++ param->value = IW_AUTH_ALG_OPEN_SYSTEM;
++ break;
++ case DOT11_AUTH_BOTH:
++ case DOT11_AUTH_SK:
++ param->value = IW_AUTH_ALG_SHARED_KEY;
++ case DOT11_AUTH_NONE:
++ default:
++ param->value = 0;
++ break;
++ }
++ }
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ param->value = wpa > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ ret = sm_drv_oid_get(dev, DOT11_OID_DOT1XENABLE,
++ (void *)&dot1x, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = dot1x > 0 ? 1 : 0;
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ ret = sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&privinvoked, sizeof(uint32_t));
++ if (ret >= 0)
++ param->value = privinvoked > 0 ? 1 : 0;
++ break;
++
++ default:
++ return -EOPNOTSUPP;
++ }
++ return ret;
++}
++
++#define KEY_SIZE_WEP104 13 /* 104/128-bit WEP keys */
++#define KEY_SIZE_WEP40 5 /* 40/64-bit WEP keys */
++#define KEY_SIZE_TKIP 32 /* TKIP keys */
++
++static int sm_drv_set_encodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int idx, alg = ext->alg, set_key = 1;
++ int authen = DOT11_AUTH_OS, invoke = 0, exunencrypt = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "SET ENCODEEXT\n");
++
++ /* Determine and validate the key index */
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ } else {
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++ }
++
++ if (encoding->flags & IW_ENCODE_DISABLED)
++ alg = IW_ENCODE_ALG_NONE;
++
++ if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
++ /* Only set transmit key index here, actual
++ * key is set below if needed.
++ */
++ ret = sm_drv_oid_set(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ set_key = ext->key_len > 0 ? 1 : 0;
++ }
++
++ if (set_key) {
++ switch (alg) {
++ case IW_ENCODE_ALG_NONE:
++ break;
++ case IW_ENCODE_ALG_WEP: {
++ struct obj_key key = { DOT11_PRIV_WEP, 0, "" };
++ memset(key.key, 0, sizeof(key.key));
++ if (ext->key_len > KEY_SIZE_WEP104) {
++ ret = -EINVAL;
++ goto out;
++ }
++ if (ext->key_len > KEY_SIZE_WEP40)
++ key.length = KEY_SIZE_WEP104;
++ else
++ key.length = KEY_SIZE_WEP40;
++ memcpy(key.key, ext->key, ext->key_len);
++ ret = sm_drv_oid_set(dev, DOT11_OID_DEFKEYID + idx + 1,
++ (void *)&key,
++ sizeof(struct obj_key));
++ break;
++ }
++ case IW_ENCODE_ALG_TKIP:
++ case IW_ENCODE_ALG_CCMP: {
++ struct obj_stakey key;
++ memset(key.key, 0, sizeof(key.key));
++ if (alg == IW_ENCODE_ALG_TKIP)
++ key.type = DOT11_PRIV_TKIP;
++ else
++ key.type = DOT11_PRIV_AES_CCMP;
++ memcpy(key.address, ext->addr.sa_data, ETH_ALEN);
++ key.length = ext->key_len;
++ key.keyid = idx;
++ key.ext = 0;
++ memcpy(key.key, ext->key, ext->key_len);
++ ret = sm_drv_oid_set(dev, DOT11_OID_STAKEY,
++ (void *)&key,
++ sizeof(struct obj_stakey));
++ break;
++ }
++ default:
++ return -EINVAL;
++ }
++
++ if (ret < 0)
++ goto out;
++
++ }
++
++ /* Read the flags */
++ if (encoding->flags & IW_ENCODE_DISABLED) {
++ /* Encoding disabled,
++ * authen = DOT11_AUTH_OS;
++ * invoke = 0;
++ * exunencrypt = 0; */
++ }
++ if (encoding->flags & IW_ENCODE_OPEN) {
++ /* Encode but accept non-encoded packets. No auth */
++ invoke = 1;
++ }
++ if (encoding->flags & IW_ENCODE_RESTRICTED) {
++ /* Refuse non-encoded packets. Auth */
++ authen = DOT11_AUTH_BOTH;
++ invoke = 1;
++ exunencrypt = 1;
++ }
++
++ /* do the change if requested */
++ if (encoding->flags & IW_ENCODE_MODE) {
++ sm_drv_oid_set(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&invoke, sizeof(uint32_t));
++ sm_drv_oid_set(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ }
++
++ out:
++ return ret;
++}
++
++
++static int sm_drv_get_encodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ struct net_local *priv = netdev_priv(dev);
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int idx, max_key_len;
++ int authen = DOT11_AUTH_OS, invoke = 0, exunencrypt = 0, wpa = 0;
++ int ret = 0;
++
++ DEBUG(DBG_IOCTL, "GET ENCODEEXT\n");
++
++ /* first get the flags */
++ ret = sm_drv_oid_get(dev, DOT11_OID_AUTHENABLE,
++ (void *)&authen, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_PRIVACYINVOKED,
++ (void *)&invoke, sizeof(uint32_t));
++ ret |= sm_drv_oid_get(dev, DOT11_OID_EXUNENCRYPTED,
++ (void *)&exunencrypt, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++
++ max_key_len = encoding->length - sizeof(*ext);
++ if (max_key_len < 0)
++ return -EINVAL;
++
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ } else {
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID,
++ (void *)&idx, sizeof(uint32_t));
++ if (ret < 0)
++ goto out;
++ }
++
++ encoding->flags = idx + 1;
++ memset(ext, 0, sizeof(*ext));
++
++ switch (authen) {
++ case DOT11_AUTH_BOTH:
++ case DOT11_AUTH_SK:
++ wrqu->encoding.flags |= IW_ENCODE_RESTRICTED;
++ case DOT11_AUTH_OS:
++ default:
++ wrqu->encoding.flags |= IW_ENCODE_OPEN;
++ break;
++ }
++
++ down(&priv->wpa_sem);
++ wpa = priv->wpa;
++ up(&priv->wpa_sem);
++
++ if (authen == DOT11_AUTH_OS && !exunencrypt && !invoke && !wpa) {
++ /* No encryption */
++ ext->alg = IW_ENCODE_ALG_NONE;
++ ext->key_len = 0;
++ wrqu->encoding.flags |= IW_ENCODE_DISABLED;
++ } else {
++ struct obj_key *key;
++
++ ret = sm_drv_oid_get(dev, DOT11_OID_DEFKEYID + idx + 1,
++ (void *)&key, sizeof(struct obj_key));
++ if (ret < 0)
++ goto out;
++ if (max_key_len < key->length) {
++ ret = -E2BIG;
++ goto out;
++ }
++ memcpy(ext->key, key->key, key->length);
++ ext->key_len = key->length;
++
++ switch (key->type) {
++ case DOT11_PRIV_TKIP:
++ ext->alg = IW_ENCODE_ALG_TKIP;
++ break;
++ case DOT11_PRIV_AES_CCMP:
++ ext->alg = IW_ENCODE_ALG_CCMP;
++ break;
++ default:
++ case DOT11_PRIV_WEP:
++ ext->alg = IW_ENCODE_ALG_WEP;
++ break;
++ }
++ wrqu->encoding.flags |= IW_ENCODE_ENABLED;
++ }
++
++ out:
++ return ret;
++}
+
+ /* Private handlers */
+
+@@ -2473,10 +2899,10 @@
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) sm_drv_set_genie, /* SIOCSIWGENIE*/
+ (iw_handler) NULL, /* SIOCGIWGENIE */
+- (iw_handler) NULL, /* SIOCSIWAUTH */
+- (iw_handler) NULL, /* SIOCGIWAUTH */
+- (iw_handler) NULL, /* SIOCSIWENCODEEXT */
+- (iw_handler) NULL, /* SIOCGIWENCODEEXT */
++ (iw_handler) sm_drv_set_auth, /* SIOCSIWAUTH */
++ (iw_handler) sm_drv_get_auth, /* SIOCGIWAUTH */
++ (iw_handler) sm_drv_set_encodeext, /* SIOCSIWENCODEEXT */
++ (iw_handler) sm_drv_get_encodeext, /* SIOCGIWENCODEEXT */
+ (iw_handler) sm_drv_set_pmk, /* SIOCSIWPMKSA */
+ };
diff --git a/packages/mamona/cx3110x-diablo-2.0.15/fix_old_include.patch b/packages/mamona/cx3110x-diablo-2.0.15/fix_old_include.patch
new file mode 100644
index 0000000000..61549fdaff
--- /dev/null
+++ b/packages/mamona/cx3110x-diablo-2.0.15/fix_old_include.patch
@@ -0,0 +1,13 @@
+Index: cx3110x-module-src-2.0.15/src/sm_drv_spi.c
+===================================================================
+--- cx3110x-module-src-2.0.15.orig/src/sm_drv_spi.c 2008-08-06 19:55:37.000000000 -0300
++++ cx3110x-module-src-2.0.15/src/sm_drv_spi.c 2008-08-06 19:56:05.000000000 -0300
+@@ -36,7 +36,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/string.h>
+ #include <linux/firmware.h>
+-#include <linux/config.h>
++#include <linux/autoconf.h>
+ #if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
+ #error No Firmware Loading configured in the kernel !
+ #endif
diff --git a/packages/mamona/cx3110x-diablo_2.0.15.bb b/packages/mamona/cx3110x-diablo_2.0.15.bb
new file mode 100644
index 0000000000..17bb1f4412
--- /dev/null
+++ b/packages/mamona/cx3110x-diablo_2.0.15.bb
@@ -0,0 +1,25 @@
+PR = "r0"
+
+KERVER = "2.6.21"
+
+COMPATIBLE_MACHINE = "(nokia800|nokia810)"
+
+S = "${WORKDIR}/cx3110x-module-src-2.0.15"
+SKERNEL = "${WORKDIR}/kernel-source-diablo-${KERVER}/kernel-source"
+
+# The following require must be after S{S}, ${SKERNEL}, ${KERVER}
+require cx3110x.inc
+
+SRC_URI += "\
+ http://repository.maemo.org/pool/maemo4.1/free/c/cx3110x-module-src/cx3110x-module-src_2.0.15-1.tar.gz \
+ http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \
+ http://repository.maemo.org/pool/maemo4.1/free/k/kernel-source-diablo/kernel-source-diablo_2.6.21-200823maemo6.tar.gz \
+ file://cx3110x.patch;patch=1 \
+ file://create_sysfs_link_for_wlan0.patch;patch=1 \
+ file://fix_old_include.patch;patch=1 \
+"
+
+do_compile() {
+ PATH=${WORKDIR}/bin/:$PATH make -C ${SKERNEL} CROSS_COMPILE=arm-none-eabi- nokia_2420_defconfig prepare scripts
+ KERNEL_SRC_DIR=${SKERNEL} PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules
+}
diff --git a/packages/mamona/cx3110x.inc b/packages/mamona/cx3110x.inc
new file mode 100644
index 0000000000..0dea679d29
--- /dev/null
+++ b/packages/mamona/cx3110x.inc
@@ -0,0 +1,29 @@
+DESCRIPTION = "cx3110x wifi support to Nokia IT"
+SECTION = "kernel/modules"
+LICENSE = "GPL"
+
+INITSCRIPT_NAME = "cx3110x"
+INITSCRIPT_PARAMS = "defaults 10"
+SRC_URI += "file://cx3110x"
+inherit update-rc.d
+
+PACKAGES = "${PN}"
+
+FILES_${PN} += "/lib/modules"
+
+LDFLAGS=""
+BUILD_LDFLAGS=""
+CFLAGS=""
+BUILD_CFLAGS=""
+TARGET_LDFLAGS=""
+
+do_configure() {
+}
+
+do_install() {
+ UNAME_R=`grep "Linux kernel version:" ${SKERNEL}/.config | sed 's/.*: //'`
+ install -d ${D}/lib/modules/${UNAME_R}
+ install -m 0644 ${S}/src/cx3110x.ko ${D}/lib/modules/${UNAME_R}
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/${INITSCRIPT_NAME} ${D}/${sysconfdir}/init.d
+}
diff --git a/packages/mamona/gcc-noemu-4.1.2/.mtn2git_empty b/packages/mamona/gcc-noemu-4.1.2/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/.mtn2git_empty
diff --git a/packages/mamona/gcc-noemu-4.1.2/100-uclibc-conf.patch b/packages/mamona/gcc-noemu-4.1.2/100-uclibc-conf.patch
new file mode 100644
index 0000000000..49d576c7dd
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/100-uclibc-conf.patch
@@ -0,0 +1,544 @@
+--- gcc-4.1.0/gcc/config/t-linux-uclibc
++++ gcc-4.1.0/gcc/config/t-linux-uclibc
+@@ -0,0 +1,5 @@
++# Remove glibc specific files added in t-linux
++SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
++
++# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
++LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
+--- gcc-4.1.0/gcc/config.gcc
++++ gcc-4.1.0/gcc/config.gcc
+@@ -1887,7 +1887,7 @@ s390x-ibm-tpf*)
+ ;;
+ sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
+ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
+- sh-*-linux* | sh[346lbe]*-*-linux* | \
++ sh*-*-linux* | sh[346lbe]*-*-linux* | \
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ tmake_file="${tmake_file} sh/t-sh sh/t-elf"
+@@ -2341,6 +2341,12 @@ m32c-*-elf*)
+ ;;
+ esac
+
++# Rather than hook into each target, just do it after all the linux
++# targets have been processed
++case ${target} in
++*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
++esac
++
+ case ${target} in
+ i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
+ tmake_file="${tmake_file} i386/t-gmm_malloc"
+--- gcc-4.1.0/boehm-gc/configure
++++ gcc-4.1.0/boehm-gc/configure
+@@ -4320,6 +4320,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/configure
++++ gcc-4.1.0/configure
+@@ -1133,7 +1133,7 @@ no)
+ ;;
+ "")
+ case "${target}" in
+- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
++ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
+ # Enable libmudflap by default in GNU and friends.
+ ;;
+ *-*-freebsd*)
+--- gcc-4.1.0/configure.in
++++ gcc-4.1.0/configure.in
+@@ -341,7 +341,7 @@ no)
+ ;;
+ "")
+ case "${target}" in
+- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
++ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
+ # Enable libmudflap by default in GNU and friends.
+ ;;
+ *-*-freebsd*)
+--- gcc-4.1.0/contrib/regression/objs-gcc.sh
++++ gcc-4.1.0/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc-4.1.0/gcc/config/alpha/linux-elf.h
++++ gcc-4.1.0/gcc/config/alpha/linux-elf.h
+@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA. */
+ #define SUBTARGET_EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
++#if defined USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
+ #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#endif
+
+ #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+ %{O*:-O3} %{!O*:-O1} \
+--- gcc-4.1.0/gcc/config/arm/linux-elf.h
++++ gcc-4.1.0/gcc/config/arm/linux-elf.h
+@@ -51,7 +51,11 @@
+
+ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+
++#ifdef USE_UCLIBC
++#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
++#else
+ #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
++#endif
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
+ %{b} \
+--- gcc-4.1.0/gcc/config/cris/linux.h
++++ gcc-4.1.0/gcc/config/cris/linux.h
+@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA. */
+ #undef CRIS_DEFAULT_CPU_VERSION
+ #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
+
++#ifdef USE_UCLIBC
++
++#undef CRIS_SUBTARGET_VERSION
++#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
++
++#undef CRIS_LINK_SUBTARGET_SPEC
++#define CRIS_LINK_SUBTARGET_SPEC \
++ "-mcrislinux\
++ -rpath-link include/asm/../..%s\
++ %{shared} %{static}\
++ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
++ %{!r:%{O2|O3: --gc-sections}}"
++
++#else /* USE_UCLIBC */
++
+ #undef CRIS_SUBTARGET_VERSION
+ #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
+
+@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA. */
+ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
+ %{!r:%{O2|O3: --gc-sections}}"
+
++#endif /* USE_UCLIBC */
++
+
+ /* Node: Run-time Target */
+
+--- gcc-4.1.0/gcc/config/i386/linux.h
++++ gcc-4.1.0/gcc/config/i386/linux.h
+@@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA. */
+ #define LINK_EMULATION "elf_i386"
+ #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
++#if defined USE_UCLIBC
++#undef DYNAMIC_LINKER
++#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#endif
++
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+ { "link_emulation", LINK_EMULATION },\
+--- gcc-4.1.0/gcc/config/i386/linux64.h
++++ gcc-4.1.0/gcc/config/i386/linux64.h
+@@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA. */
+ When the -shared link option is used a final link is not being
+ done. */
+
++#ifdef USE_UCLIBC
++#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
++#else
++#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++ %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
++ %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
+ %{static:-static}}"
+
+ /* Similar to standard Linux, but adding -ffast-math support. */
+--- gcc-4.1.0/gcc/config/ia64/linux.h
++++ gcc-4.1.0/gcc/config/ia64/linux.h
+@@ -37,13 +37,18 @@ do { \
+ /* Define this for shared library support because it isn't in the main
+ linux.h file. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}"
+
+
+--- gcc-4.1.0/gcc/config/m68k/linux.h
++++ gcc-4.1.0/gcc/config/m68k/linux.h
+@@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA. */
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m m68kelf %{shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
++ %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static}}"
+
+ /* For compatibility with linux/a.out */
+--- gcc-4.1.0/gcc/config/mips/linux.h
++++ gcc-4.1.0/gcc/config/mips/linux.h
+@@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA. */
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
++#endif
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA. */
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}}"
+
+ #undef SUBTARGET_ASM_SPEC
+--- gcc-4.1.0/gcc/config/pa/pa-linux.h
++++ gcc-4.1.0/gcc/config/pa/pa-linux.h
+@@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA. */
+ /* Define this for shared library support because it isn't in the main
+ linux.h file. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}"
+
+ /* glibc's profiling functions don't need gcc to allocate counters. */
+--- gcc-4.1.0/gcc/config/rs6000/linux.h
++++ gcc-4.1.0/gcc/config/rs6000/linux.h
+@@ -72,7 +72,11 @@
+ #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
+
+ #undef LINK_OS_DEFAULT_SPEC
++#ifdef USE_UCLIBC
++#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
++#else
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
++#endif
+
+ #define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+--- gcc-4.1.0/gcc/config/rs6000/sysv4.h
++++ gcc-4.1.0/gcc/config/rs6000/sysv4.h
+@@ -866,6 +866,7 @@ extern int fixuplabelno;
+ mcall-linux : %(link_os_linux) ; \
+ mcall-gnu : %(link_os_gnu) ; \
+ mcall-netbsd : %(link_os_netbsd) ; \
++ mcall-linux-uclibc : %(link_os_linux_uclibc); \
+ mcall-openbsd: %(link_os_openbsd) ; \
+ : %(link_os_default) }"
+
+@@ -1043,6 +1044,10 @@ extern int fixuplabelno;
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+
++#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
++
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+ # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
+@@ -1209,6 +1214,7 @@ ncrtn.o%s"
+ { "link_os_sim", LINK_OS_SIM_SPEC }, \
+ { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \
+ { "link_os_linux", LINK_OS_LINUX_SPEC }, \
++ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
+ { "link_os_gnu", LINK_OS_GNU_SPEC }, \
+ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+--- gcc-4.1.0/gcc/config/s390/linux.h
++++ gcc-4.1.0/gcc/config/s390/linux.h
+@@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street,
+ #define MULTILIB_DEFAULTS { "m31" }
+ #endif
+
++#ifdef USE_UCLIBC
++#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
++#else
++#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
++#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+@@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street,
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker: \
+- %{m31:-dynamic-linker /lib/ld.so.1} \
+- %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
++ %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
++ %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
+
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+--- gcc-4.1.0/gcc/config/sh/linux.h
++++ gcc-4.1.0/gcc/config/sh/linux.h
+@@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA. */
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+ #undef SUBTARGET_LINK_SPEC
++#ifdef USE_UCLIBC
++#define SUBTARGET_LINK_SPEC \
++ "%{shared:-shared} \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}"
++#else
+ #define SUBTARGET_LINK_SPEC \
+ "%{shared:-shared} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}"
++#endif
+
+ /* Output assembler code to STREAM to call the profiler. */
+
+--- gcc-4.1.0/gcc/config/sparc/linux.h
++++ gcc-4.1.0/gcc/config/sparc/linux.h
+@@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA. */
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+ %{!mno-relax:%{!r:-relax}} \
+@@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA. */
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}}"
+
+ /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
+--- gcc-4.1.0/gcc/config/sparc/linux64.h
++++ gcc-4.1.0/gcc/config/sparc/linux64.h
+@@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA. */
+ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
+ { "link_arch", LINK_ARCH_SPEC },
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#endif
+ #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}} \
+ "
+
+--- gcc-4.1.0/libffi/configure
++++ gcc-4.1.0/libffi/configure
+@@ -3457,6 +3457,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libgfortran/configure
++++ gcc-4.1.0/libgfortran/configure
+@@ -3699,6 +3699,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libjava/configure
++++ gcc-4.1.0/libjava/configure
+@@ -5137,6 +5137,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libmudflap/configure
++++ gcc-4.1.0/libmudflap/configure
+@@ -5382,6 +5382,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libobjc/configure
++++ gcc-4.1.0/libobjc/configure
+@@ -3312,6 +3312,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libtool.m4
++++ gcc-4.1.0/libtool.m4
+@@ -743,6 +743,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+--- gcc-4.1.0/ltconfig
++++ gcc-4.1.0/ltconfig
+@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1274,6 +1275,23 @@ linux-gnu*)
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+--- gcc-4.1.0/zlib/configure
++++ gcc-4.1.0/zlib/configure
+@@ -3426,6 +3426,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/packages/mamona/gcc-noemu-4.1.2/110-arm-eabi.patch b/packages/mamona/gcc-noemu-4.1.2/110-arm-eabi.patch
new file mode 100644
index 0000000000..acebe5308f
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/110-arm-eabi.patch
@@ -0,0 +1,27 @@
+--- gcc-2005q3-1.orig/gcc/config.gcc 2005-10-31 19:02:54.000000000 +0300
++++ gcc-2005q3-1/gcc/config.gcc 2006-01-27 01:09:09.000000000 +0300
+@@ -674,7 +674,7 @@
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm"
+ case ${target} in
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
+ # The BPABI long long divmod functions return a 128-bit value in
+
+diff -urN gcc-2005q3-2/gcc/config/arm/linux-eabi.h gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h
+--- gcc-2005q3-2/gcc/config/arm/linux-eabi.h 2005-12-07 23:14:16.000000000 +0300
++++ gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h 2006-03-29 19:02:34.000000000 +0400
+@@ -53,7 +53,11 @@
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+ #undef LINUX_TARGET_INTERPRETER
++#ifdef USE_UCLIBC
++#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
++#else
+ #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
++#endif
+
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
diff --git a/packages/mamona/gcc-noemu-4.1.2/200-uclibc-locale.patch b/packages/mamona/gcc-noemu-4.1.2/200-uclibc-locale.patch
new file mode 100644
index 0000000000..e5d712e723
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/200-uclibc-locale.patch
@@ -0,0 +1,3239 @@
+--- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4
++++ gcc-4.1.0/libstdc++-v3/acinclude.m4
+@@ -1071,7 +1071,7 @@
+ AC_MSG_CHECKING([for C locale to use])
+ GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
+ [use MODEL for target locale package],
+- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
+
+ # If they didn't use this option switch, or if they specified --enable
+ # with no specific model, we'll have to look for one. If they
+@@ -1087,6 +1087,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1230,6 +1233,40 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,152 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
++#define __strtof_l(S, E, L) strtof((S), (E))
++#define __strtod_l(S, E, L) strtod((S), (E))
++#define __strtold_l(S, E, L) strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c) NULL
++#define __freelocale(a) ((void)0)
++#define __duplocale(a) __c_locale()
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (__cloc && _S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++ extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++ typedef __locale_t __c_locale;
++#else
++ typedef int* __c_locale;
++#endif
++
++ // Convert numeric value of type _Tv to string and return length of
++ // string. If snprintf is available use it, otherwise fall back to
++ // the unsafe sprintf which, in general, can be dangerous and should
++ // be avoided.
++ template<typename _Tv>
++ int
++ __convert_from_v(char* __out,
++ const int __size __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,306 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_out(state_type& __state, const intern_type* __from,
++ const intern_type* __from_end, const intern_type*& __from_next,
++ extern_type* __to, extern_type* __to_end,
++ extern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++ // in case we fall back to wcrtomb and then continue, in a loop.
++ // NB: wcsnrtombs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++ __from_end - __from_next);
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // wcrtomb.
++ for (; __from < __from_next; ++__from)
++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ extern_type __buf[MB_LEN_MAX];
++ __tmp_state = __state;
++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++ if (__conv > static_cast<size_t>(__to_end - __to_next))
++ __ret = partial;
++ else
++ {
++ memcpy(__to_next, __buf, __conv);
++ __state = __tmp_state;
++ __to_next += __conv;
++ ++__from_next;
++ }
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_in(state_type& __state, const extern_type* __from,
++ const extern_type* __from_end, const extern_type*& __from_next,
++ intern_type* __to, intern_type* __to_end,
++ intern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we store a L'\0' and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++ __from_end
++ - __from_next));
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (;; ++__to_next, __from += __conv)
++ {
++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __from_next = __from;
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ // It is unclear what to return in this case (see DR 382).
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ if (__to_next < __to_end)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from_next;
++ *__to_next++ = L'\0';
++ }
++ else
++ __ret = partial;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_encoding() const throw()
++ {
++ // XXX This implementation assumes that the encoding is
++ // stateless and is either single-byte or variable-width.
++ int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ if (MB_CUR_MAX == 1)
++ __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_max_length() const throw()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ // XXX Probably wrong for stateful encodings.
++ int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_length(state_type& __state, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ {
++ int __ret = 0;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we advance past it and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++
++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
++ // its fourth parameter (it wouldn't with NULL as first parameter).
++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++ __end
++ - __from));
++ if (!__from_chunk_end)
++ __from_chunk_end = __end;
++
++ const extern_type* __tmp_from = __from;
++ size_t __conv = mbsnrtowcs(__to, &__from,
++ __from_chunk_end - __from,
++ __max, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (__from = __tmp_from;; __from += __conv)
++ {
++ __conv = mbrtowc(NULL, __from, __end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __state = __tmp_state;
++ __ret += __from - __tmp_from;
++ break;
++ }
++ if (!__from)
++ __from = __from_chunk_end;
++
++ __ret += __from - __tmp_from;
++ __max -= __conv;
++
++ if (__from < __end && __max)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from;
++ ++__ret;
++ --__max;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++#endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++ // These are basically extensions to char_traits, and perhaps should
++ // be put there instead of here.
++ template<>
++ int
++ collate<char>::_M_compare(const char* __one, const char* __two) const
++ {
++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_M_compare(const wchar_t* __one,
++ const wchar_t* __two) const
++ {
++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,314 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L) wctype((S))
++#define __towupper_l(C, L) towupper((C))
++#define __towlower_l(C, L) towlower((C))
++#define __iswctype_l(C, M, L) iswctype((C), (M))
++#endif
++
++namespace std
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++ {
++ __wmask_type __ret;
++ switch (__m)
++ {
++ case space:
++ __ret = __wctype_l("space", _M_c_locale_ctype);
++ break;
++ case print:
++ __ret = __wctype_l("print", _M_c_locale_ctype);
++ break;
++ case cntrl:
++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
++ break;
++ case upper:
++ __ret = __wctype_l("upper", _M_c_locale_ctype);
++ break;
++ case lower:
++ __ret = __wctype_l("lower", _M_c_locale_ctype);
++ break;
++ case alpha:
++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
++ break;
++ case digit:
++ __ret = __wctype_l("digit", _M_c_locale_ctype);
++ break;
++ case punct:
++ __ret = __wctype_l("punct", _M_c_locale_ctype);
++ break;
++ case xdigit:
++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
++ break;
++ case alnum:
++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
++ break;
++ case graph:
++ __ret = __wctype_l("graph", _M_c_locale_ctype);
++ break;
++ default:
++ __ret = __wmask_type();
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
++ bool __ret = false;
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ mask __m = 0;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++ __m |= _M_bit[__bitcur];
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !this->do_is(__m, *__lo))
++ ++__lo;
++ return __lo;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++ ++__lo;
++ return __lo;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __j = 0;
++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++ _M_widen[__j] = btowc(__j);
++
++ for (size_t __k = 0; __k <= 11; ++__k)
++ {
++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++ const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++ // Specializations.
++ template<>
++ string
++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++ __uselocale(__old);
++ return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ const char* __msg = gettext(__dfault.c_str());
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return string(__msg);
++#else
++ const char* __msg = gettext(__dfault.c_str());
++ return string(__msg);
++#endif
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++ {
++# ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ __uselocale(__old);
++ return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return _M_convert_from_char(__msg);
++# else
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ return _M_convert_from_char(__msg);
++# endif
++ }
++#endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,121 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++ const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D) ((void)0)
++#define __bindtextdomain(D,P) ((void)0)
++#endif
++
++ // Non-virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
++ {
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
++ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ if (_M_name_messages != _S_get_c_name())
++ delete [] _M_name_messages;
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
++ delete [] this->_M_name_messages;
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ this->_M_name_messages = __tmp;
++
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ // Construct and return valid pattern consisting of some combination of:
++ // space none symbol sign value
++ money_base::pattern
++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++ {
++ pattern __ret;
++
++ // This insanely complicated routine attempts to construct a valid
++ // pattern for use with monyepunct. A couple of invariants:
++
++ // if (__precedes) symbol -> value
++ // else value -> symbol
++
++ // if (__space) space
++ // else none
++
++ // none == never first
++ // space never first or last
++
++ // Any elegant implementations of this are welcome.
++ switch (__posn)
++ {
++ case 0:
++ case 1:
++ // 1 The sign precedes the value and symbol.
++ __ret.field[0] = sign;
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[2] = space;
++ }
++ else
++ {
++ // Pattern starts with sign and ends with none.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 2:
++ // 2 The sign follows the value and symbol.
++ if (__space)
++ {
++ // Pattern either ends with sign.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[1] = space;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ // Pattern ends with sign then none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ }
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ break;
++ case 3:
++ // 3 The sign immediately precedes the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ else
++ {
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ default:
++ __ret = pattern();
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == true
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == false
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++#endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,173 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++ __cloc));
++
++ // Check for NULL, which implies no grouping.
++ if (_M_data->_M_thousands_sep == '\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = "true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __timepunct<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = "%m/%d/%y";
++ _M_data->_M_date_era_format = "%m/%d/%y";
++ _M_data->_M_time_format = "%H:%M:%S";
++ _M_data->_M_time_era_format = "%H:%M:%S";
++ _M_data->_M_date_time_format = "";
++ _M_data->_M_date_time_era_format = "";
++ _M_data->_M_am = "AM";
++ _M_data->_M_pm = "PM";
++ _M_data->_M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = "Sunday";
++ _M_data->_M_day2 = "Monday";
++ _M_data->_M_day3 = "Tuesday";
++ _M_data->_M_day4 = "Wednesday";
++ _M_data->_M_day5 = "Thursday";
++ _M_data->_M_day6 = "Friday";
++ _M_data->_M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = "Sun";
++ _M_data->_M_aday2 = "Mon";
++ _M_data->_M_aday3 = "Tue";
++ _M_data->_M_aday4 = "Wed";
++ _M_data->_M_aday5 = "Thu";
++ _M_data->_M_aday6 = "Fri";
++ _M_data->_M_aday7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = "January";
++ _M_data->_M_month02 = "February";
++ _M_data->_M_month03 = "March";
++ _M_data->_M_month04 = "April";
++ _M_data->_M_month05 = "May";
++ _M_data->_M_month06 = "June";
++ _M_data->_M_month07 = "July";
++ _M_data->_M_month08 = "August";
++ _M_data->_M_month09 = "September";
++ _M_data->_M_month10 = "October";
++ _M_data->_M_month11 = "November";
++ _M_data->_M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = "Jan";
++ _M_data->_M_amonth02 = "Feb";
++ _M_data->_M_amonth03 = "Mar";
++ _M_data->_M_amonth04 = "Apr";
++ _M_data->_M_amonth05 = "May";
++ _M_data->_M_amonth06 = "Jun";
++ _M_data->_M_amonth07 = "Jul";
++ _M_data->_M_amonth08 = "Aug";
++ _M_data->_M_amonth09 = "Sep";
++ _M_data->_M_amonth10 = "Oct";
++ _M_data->_M_amonth11 = "Nov";
++ _M_data->_M_amonth12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++ __cloc);
++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = L"%m/%d/%y";
++ _M_data->_M_date_era_format = L"%m/%d/%y";
++ _M_data->_M_time_format = L"%H:%M:%S";
++ _M_data->_M_time_era_format = L"%H:%M:%S";
++ _M_data->_M_date_time_format = L"";
++ _M_data->_M_date_time_era_format = L"";
++ _M_data->_M_am = L"AM";
++ _M_data->_M_pm = L"PM";
++ _M_data->_M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = L"Sunday";
++ _M_data->_M_day2 = L"Monday";
++ _M_data->_M_day3 = L"Tuesday";
++ _M_data->_M_day4 = L"Wednesday";
++ _M_data->_M_day5 = L"Thursday";
++ _M_data->_M_day6 = L"Friday";
++ _M_data->_M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = L"Sun";
++ _M_data->_M_aday2 = L"Mon";
++ _M_data->_M_aday3 = L"Tue";
++ _M_data->_M_aday4 = L"Wed";
++ _M_data->_M_aday5 = L"Thu";
++ _M_data->_M_aday6 = L"Fri";
++ _M_data->_M_aday7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = L"January";
++ _M_data->_M_month02 = L"February";
++ _M_data->_M_month03 = L"March";
++ _M_data->_M_month04 = L"April";
++ _M_data->_M_month05 = L"May";
++ _M_data->_M_month06 = L"June";
++ _M_data->_M_month07 = L"July";
++ _M_data->_M_month08 = L"August";
++ _M_data->_M_month09 = L"September";
++ _M_data->_M_month10 = L"October";
++ _M_data->_M_month11 = L"November";
++ _M_data->_M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = L"Jan";
++ _M_data->_M_amonth02 = L"Feb";
++ _M_data->_M_amonth03 = L"Mar";
++ _M_data->_M_amonth04 = L"Apr";
++ _M_data->_M_amonth05 = L"May";
++ _M_data->_M_amonth06 = L"Jun";
++ _M_data->_M_amonth07 = L"Jul";
++ _M_data->_M_amonth08 = L"Aug";
++ _M_data->_M_amonth09 = L"Sep";
++ _M_data->_M_amonth10 = L"Oct";
++ _M_data->_M_amonth11 = L"Nov";
++ _M_data->_M_amonth12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,76 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(NULL)
++ {
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
++ _M_name_timepunct = __tmp;
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h
+@@ -0,0 +1,64 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++/** @file ctype_base.h
++ * This is an internal header file, included by other library headers.
++ * You should not attempt to use it directly.
++ */
++
++// Information as gleaned from /usr/include/ctype.h
++
++ /// @brief Base class for ctype.
++ struct ctype_base
++ {
++ // Note: In uClibc, the following two types depend on configuration.
++
++ // Non-standard typedefs.
++ typedef const __ctype_touplow_t* __to_type;
++
++ // NB: Offsets into ctype<char>::_M_table force a particular size
++ // on the mask type. Because of this, we don't use an enum.
++ typedef __ctype_mask_t mask;
++ static const mask upper = _ISupper;
++ static const mask lower = _ISlower;
++ static const mask alpha = _ISalpha;
++ static const mask digit = _ISdigit;
++ static const mask xdigit = _ISxdigit;
++ static const mask space = _ISspace;
++ static const mask print = _ISprint;
++ static const mask graph = _ISalpha | _ISdigit | _ISpunct;
++ static const mask cntrl = _IScntrl;
++ static const mask punct = _ISpunct;
++ static const mask alnum = _ISalpha | _ISdigit;
++ };
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
+@@ -0,0 +1,69 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
++// functions go in ctype.cc
++
++ bool
++ ctype<char>::
++ is(mask __m, char __c) const
++ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++ ++__low;
++ return __low;
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+@@ -0,0 +1,92 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ const ctype_base::mask*
++ ctype<char>::classic_table() throw()
++ { return __C_ctype_b; }
++
++ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
++ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
++ {
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ memset(_M_widen, 0, sizeof(_M_widen));
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ }
++
++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
++ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
++ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
++ {
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ memset(_M_widen, 0, sizeof(_M_widen));
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ }
++
++ char
++ ctype<char>::do_toupper(char __c) const
++ { return _M_toupper[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return _M_tolower[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h
+@@ -0,0 +1,44 @@
++// Specific definitions for GNU/Linux -*- C++ -*-
++
++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++#ifndef _GLIBCXX_OS_DEFINES
++#define _GLIBCXX_OS_DEFINES 1
++
++// System-specific #define, typedefs, corrections, etc, go here. This
++// file will come before all others.
++
++// This keeps isanum, et al from being propagated as macros.
++#define __NO_CTYPE 1
++
++#include <features.h>
++
++// We must not see the optimized string functions GNU libc defines.
++#define __NO_STRING_INLINES
++
++#endif
+--- gcc-4.1.0-dist/libstdc++-v3/configure
++++ gcc-4.1.0/libstdc++-v3/configure
+@@ -4005,6 +4005,11 @@
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5740,7 +5745,7 @@
+ enableval="$enable_clocale"
+
+ case "$enableval" in
+- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
+ echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
+ { (exit 1); exit 1; }; } ;;
+@@ -5765,6 +5770,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ linux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -5995,6 +6003,76 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ echo "$as_me:$LINENO: result: uclibc" >&5
++echo "${ECHO_T}uclibc" >&6
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_check_msgfmt="yes"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
++echo "${ECHO_T}$check_msgfmt" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+--- gcc-4.1.0-dist/libstdc++-v3/configure.host
++++ gcc-4.1.0/libstdc++-v3/configure.host
+@@ -261,6 +261,12 @@
+ ;;
+ esac
+
++# Override for uClibc since linux-uclibc gets mishandled above.
++case "${host_os}" in
++ *-uclibc*)
++ os_include_dir="os/uclibc"
++ ;;
++esac
+
+ # Set any OS-dependent and CPU-dependent bits.
+ # THIS TABLE IS SORTED. KEEP IT THAT WAY.
+--- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4
++++ gcc-4.1.0/libstdc++-v3/crossconfig.m4
+@@ -143,6 +143,99 @@
+ ;;
+ esac
+ ;;
++ *-uclibc*)
++# Temporary hack until we implement the float versions of the libm funcs
++ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
++ machine/endian.h machine/param.h sys/machine.h sys/types.h \
++ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
++ SECTION_FLAGS='-ffunction-sections -fdata-sections'
++ AC_SUBST(SECTION_FLAGS)
++ GLIBCXX_CHECK_LINKER_FEATURES
++ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
++ GLIBCXX_CHECK_WCHAR_T_SUPPORT
++
++ # For LFS.
++ AC_DEFINE(HAVE_INT64_T)
++ case "$target" in
++ *-uclinux*)
++ # Don't enable LFS with uClinux
++ ;;
++ *)
++ AC_DEFINE(_GLIBCXX_USE_LFS)
++ esac
++
++ # For showmanyc_helper().
++ AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
++ GLIBCXX_CHECK_POLL
++ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
++
++ # For xsputn_2().
++ AC_CHECK_HEADERS(sys/uio.h)
++ GLIBCXX_CHECK_WRITEV
++
++# AC_DEFINE(HAVE_ACOSF)
++# AC_DEFINE(HAVE_ASINF)
++# AC_DEFINE(HAVE_ATANF)
++# AC_DEFINE(HAVE_ATAN2F)
++ AC_DEFINE(HAVE_CEILF)
++ AC_DEFINE(HAVE_COPYSIGN)
++# AC_DEFINE(HAVE_COPYSIGNF)
++# AC_DEFINE(HAVE_COSF)
++# AC_DEFINE(HAVE_COSHF)
++# AC_DEFINE(HAVE_EXPF)
++# AC_DEFINE(HAVE_FABSF)
++ AC_DEFINE(HAVE_FINITE)
++ AC_DEFINE(HAVE_FINITEF)
++ AC_DEFINE(HAVE_FLOORF)
++# AC_DEFINE(HAVE_FMODF)
++# AC_DEFINE(HAVE_FREXPF)
++ AC_DEFINE(HAVE_HYPOT)
++# AC_DEFINE(HAVE_HYPOTF)
++ AC_DEFINE(HAVE_ISINF)
++ AC_DEFINE(HAVE_ISINFF)
++ AC_DEFINE(HAVE_ISNAN)
++ AC_DEFINE(HAVE_ISNANF)
++# AC_DEFINE(HAVE_LOGF)
++# AC_DEFINE(HAVE_LOG10F)
++# AC_DEFINE(HAVE_MODFF)
++# AC_DEFINE(HAVE_SINF)
++# AC_DEFINE(HAVE_SINHF)
++# AC_DEFINE(HAVE_SINCOS)
++# AC_DEFINE(HAVE_SINCOSF)
++ AC_DEFINE(HAVE_SQRTF)
++# AC_DEFINE(HAVE_TANF)
++# AC_DEFINE(HAVE_TANHF)
++ if test x"long_double_math_on_this_cpu" = x"yes"; then
++ AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
++# AC_DEFINE(HAVE_ACOSL)
++# AC_DEFINE(HAVE_ASINL)
++# AC_DEFINE(HAVE_ATANL)
++# AC_DEFINE(HAVE_ATAN2L)
++# AC_DEFINE(HAVE_CEILL)
++# AC_DEFINE(HAVE_COPYSIGNL)
++# AC_DEFINE(HAVE_COSL)
++# AC_DEFINE(HAVE_COSHL)
++# AC_DEFINE(HAVE_EXPL)
++# AC_DEFINE(HAVE_FABSL)
++# AC_DEFINE(HAVE_FINITEL)
++# AC_DEFINE(HAVE_FLOORL)
++# AC_DEFINE(HAVE_FMODL)
++# AC_DEFINE(HAVE_FREXPL)
++# AC_DEFINE(HAVE_HYPOTL)
++# AC_DEFINE(HAVE_ISINFL)
++# AC_DEFINE(HAVE_ISNANL)
++# AC_DEFINE(HAVE_LOGL)
++# AC_DEFINE(HAVE_LOG10L)
++# AC_DEFINE(HAVE_MODFL)
++# AC_DEFINE(HAVE_POWL)
++# AC_DEFINE(HAVE_SINL)
++# AC_DEFINE(HAVE_SINHL)
++# AC_DEFINE(HAVE_SINCOSL)
++# AC_DEFINE(HAVE_SQRTL)
++# AC_DEFINE(HAVE_TANL)
++# AC_DEFINE(HAVE_TANHL)
++ fi
++ ;;
+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
+ machine/endian.h machine/param.h sys/machine.h sys/types.h \
+@@ -157,7 +250,7 @@
+ AC_DEFINE(HAVE_INT64_T)
+ case "$target" in
+ *-uclinux*)
+- # Don't enable LFS with uClibc
++ # Don't enable LFS with uClinux
+ ;;
+ *)
+ AC_DEFINE(_GLIBCXX_USE_LFS)
+--- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h
++++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+--- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h
++++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h
+@@ -180,7 +180,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
diff --git a/packages/mamona/gcc-noemu-4.1.2/300-libstdc++-pic.patch b/packages/mamona/gcc-noemu-4.1.2/300-libstdc++-pic.patch
new file mode 100644
index 0000000000..89d03a85e5
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/300-libstdc++-pic.patch
@@ -0,0 +1,46 @@
+# DP: Build and install libstdc++_pic.a library.
+
+--- gcc-4.1.0/libstdc++-v3/src/Makefile.am 2004-11-15 17:33:05.000000000 -0600
++++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.am 2005-04-25 20:05:59.186930896 -0500
+@@ -214,6 +214,10 @@
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+
+
++install-exec-local:
++ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
++
+ # Added bits to build debug library.
+ if GLIBCXX_BUILD_DEBUG
+ all-local: build_debug
+--- gcc-4.1.0/libstdc++-v3/src/Makefile.in 2005-04-11 19:13:08.000000000 -0500
++++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.in 2005-04-25 20:12:33.284316275 -0500
+@@ -627,7 +627,7 @@
+
+ install-data-am: install-data-local
+
+-install-exec-am: install-toolexeclibLTLIBRARIES
++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
+
+ install-info: install-info-am
+
+@@ -660,6 +660,7 @@
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-data-local install-exec \
++ install-exec-local \
+ install-exec-am install-info install-info-am install-man \
+ install-strip install-toolexeclibLTLIBRARIES installcheck \
+ installcheck-am installdirs maintainer-clean \
+@@ -745,6 +746,11 @@
+ install_debug:
+ (cd ${debugdir} && $(MAKE) \
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
++
++install-exec-local:
++ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
++
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff --git a/packages/mamona/gcc-noemu-4.1.2/301-missing-execinfo_h.patch b/packages/mamona/gcc-noemu-4.1.2/301-missing-execinfo_h.patch
new file mode 100644
index 0000000000..0e2092f3fb
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/packages/mamona/gcc-noemu-4.1.2/302-c99-snprintf.patch b/packages/mamona/gcc-noemu-4.1.2/302-c99-snprintf.patch
new file mode 100644
index 0000000000..dfb22d681b
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/302-c99-snprintf.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig 2005-04-29 00:08:41.000000000 -0500
++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h 2005-04-29 00:08:45.000000000 -0500
+@@ -142,7 +142,7 @@
+ using ::vsprintf;
+ }
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/packages/mamona/gcc-noemu-4.1.2/303-c99-complex-ugly-hack.patch b/packages/mamona/gcc-noemu-4.1.2/303-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000000..2ccc80d9bb
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/303-c99-complex-ugly-hack.patch
@@ -0,0 +1,12 @@
+--- gcc-4.0.0/libstdc++-v3/configure-old 2005-04-30 22:04:48.061603912 -0500
++++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 22:06:13.678588152 -0500
+@@ -7194,6 +7194,9 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
diff --git a/packages/mamona/gcc-noemu-4.1.2/304-index_macro.patch b/packages/mamona/gcc-noemu-4.1.2/304-index_macro.patch
new file mode 100644
index 0000000000..1fac112fa9
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/304-index_macro.patch
@@ -0,0 +1,24 @@
+--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100
++++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100
+@@ -59,6 +59,9 @@
+ #include <bits/allocator.h>
+ #include <ext/hash_fun.h>
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ # define __GC_CONST const
+ # else
+--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100
++++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100
+@@ -53,6 +53,9 @@
+ #include <ext/memory> // For uninitialized_copy_n
+ #include <ext/numeric> // For power
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ namespace __gnu_cxx
+ {
+ using std::size_t;
diff --git a/packages/mamona/gcc-noemu-4.1.2/602-sdk-libstdc++-includes.patch b/packages/mamona/gcc-noemu-4.1.2/602-sdk-libstdc++-includes.patch
new file mode 100644
index 0000000000..23fce7544d
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/602-sdk-libstdc++-includes.patch
@@ -0,0 +1,20 @@
+--- gcc-4.1.0/libstdc++-v3/fragment.am 2005-03-21 11:40:14.000000000 -0600
++++ gcc-4.1.0-patched/libstdc++-v3/fragment.am 2005-04-25 20:14:39.856251785 -0500
+@@ -21,5 +21,5 @@
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+ # -I/-D flags to pass when compiling.
+-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
+
+--- gcc-4.1.0/libstdc++-v3/libmath/Makefile.am 2005-03-21 11:40:18.000000000 -0600
++++ gcc-4.1.0-patched/libstdc++-v3/libmath/Makefile.am 2005-04-25 20:14:39.682280735 -0500
+@@ -35,7 +35,7 @@
+
+ libmath_la_SOURCES = stubs.c
+
+-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
+
+ # Only compiling "C" sources in this directory.
+ LIBTOOL = @LIBTOOL@ --tag CC
diff --git a/packages/mamona/gcc-noemu-4.1.2/740-sh-pr24836.patch b/packages/mamona/gcc-noemu-4.1.2/740-sh-pr24836.patch
new file mode 100644
index 0000000000..7992282cff
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/740-sh-pr24836.patch
@@ -0,0 +1,25 @@
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+
+--- gcc/gcc/configure.ac (revision 106699)
++++ gcc/gcc/configure.ac (working copy)
+@@ -2446,7 +2446,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+--- gcc/gcc/configure
++++ gcc/gcc/configure
+@@ -14846,7 +14846,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
diff --git a/packages/mamona/gcc-noemu-4.1.2/800-arm-bigendian.patch b/packages/mamona/gcc-noemu-4.1.2/800-arm-bigendian.patch
new file mode 100644
index 0000000000..0a9417419e
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/800-arm-bigendian.patch
@@ -0,0 +1,127 @@
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+See http://gcc.gnu.org/PR16350
+
+Index: gcc-4.1.1/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.1.1/gcc/config/arm/linux-elf.h
+@@ -28,19 +28,33 @@
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ #undef TARGET_DEFAULT_FLOAT_ABI
+ #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (0)
++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
+
+ /* Now we define the strings used to build the spec file. */
+ #undef LIB_SPEC
+@@ -61,7 +75,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+ #undef LINK_SPEC
+Index: gcc-4.1.1/gcc/config.gcc
+===================================================================
+--- gcc-4.1.1.orig/gcc/config.gcc
++++ gcc-4.1.1/gcc/config.gcc
+@@ -672,6 +672,11 @@ arm*-*-netbsd*)
+ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
++ case $target in
++ arm*b-*)
++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
++ ;;
++ esac
+ tmake_file="${tmake_file} t-linux arm/t-arm"
+ case ${target} in
+ arm*-*-linux-gnueabi)
+Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.1.1/gcc/config/arm/linux-eabi.h
+@@ -20,6 +20,17 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#undef TARGET_LINKER_EMULATION
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
++#else
++#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
++#endif
++
+ /* On EABI GNU/Linux, we want both the BPABI builtins and the
+ GNU/Linux builtins. */
+ #undef TARGET_OS_CPP_BUILTINS
+@@ -48,7 +59,7 @@
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
+
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+Index: gcc-4.1.1/gcc/config/arm/bpabi.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/bpabi.h
++++ gcc-4.1.1/gcc/config/arm/bpabi.h
+@@ -33,9 +33,19 @@
+ #undef FPUTYPE_DEFAULT
+ #define FPUTYPE_DEFAULT FPUTYPE_VFP
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#endif
++
+ /* EABI targets should enable interworking by default. */
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT MASK_INTERWORK
++#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
+
+ /* The ARM BPABI functions return a boolean; they use no special
+ calling convention. */
diff --git a/packages/mamona/gcc-noemu-4.1.2/801-arm-bigendian-eabi.patch b/packages/mamona/gcc-noemu-4.1.2/801-arm-bigendian-eabi.patch
new file mode 100644
index 0000000000..54490fc24f
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/801-arm-bigendian-eabi.patch
@@ -0,0 +1,14 @@
+Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h 2007-02-20 14:51:33.416193250 +0100
++++ gcc-4.1.1/gcc/config/arm/linux-eabi.h 2007-02-20 14:52:11.622581000 +0100
+@@ -48,7 +48,8 @@
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
++#define SUBTARGET_EXTRA_LINK_SPEC \
++ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
+
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
diff --git a/packages/mamona/gcc-noemu-4.1.2/README b/packages/mamona/gcc-noemu-4.1.2/README
new file mode 100644
index 0000000000..b85840dc20
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/README
@@ -0,0 +1,4 @@
+The numbered patches come from
+http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/gcc/4.1.1/
+Other patches are locally added to fix things (mostly inherited and reapplied
+from gcc 3.4.4 where applicable)
diff --git a/packages/mamona/gcc-noemu-4.1.2/arm-nolibfloat.patch b/packages/mamona/gcc-noemu-4.1.2/arm-nolibfloat.patch
new file mode 100644
index 0000000000..c4897c0330
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/arm-nolibfloat.patch
@@ -0,0 +1,24 @@
+# Dimitry Andric <dimitry@andric.com>, 2004-05-01
+#
+# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
+# anymore. (The required functions are now in libgcc.)
+#
+# Fixes errors like
+# arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat
+# collect2: ld returned 1 exit status
+# make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1
+# when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat
+
+Index: gcc-4.0.2/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.0.2.orig/gcc/config/arm/linux-elf.h 2005-03-04 16:14:01.000000000 +0000
++++ gcc-4.0.2/gcc/config/arm/linux-elf.h 2005-11-11 18:02:54.000000000 +0000
+@@ -56,7 +56,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
diff --git a/packages/mamona/gcc-noemu-4.1.2/arm-softfloat.patch b/packages/mamona/gcc-noemu-4.1.2/arm-softfloat.patch
new file mode 100644
index 0000000000..c86c83ed15
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/arm-softfloat.patch
@@ -0,0 +1,16 @@
+Index: gcc-4.0.2/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.0.2.orig/gcc/config/arm/t-linux 2004-05-15 12:41:35.000000000 +0000
++++ gcc-4.0.2/gcc/config/arm/t-linux 2005-11-11 16:07:53.000000000 +0000
+@@ -4,7 +4,10 @@
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/packages/mamona/gcc-noemu-4.1.2/arm-thumb-cache.patch b/packages/mamona/gcc-noemu-4.1.2/arm-thumb-cache.patch
new file mode 100644
index 0000000000..fa63846c8c
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/arm-thumb-cache.patch
@@ -0,0 +1,29 @@
+--- gcc-4.1.1/gcc/config/arm/linux-gas.h- 2005-06-25 03:22:41.000000000 +0200
++++ gcc-4.1.1/gcc/config/arm/linux-gas.h 2006-06-18 10:23:46.000000000 +0200
+@@ -44,6 +44,7 @@
+
+ /* Clear the instruction cache from `beg' to `end'. This makes an
+ inline system call to SYS_cacheflush. */
++#if !defined(__thumb__)
+ #define CLEAR_INSN_CACHE(BEG, END) \
+ { \
+ register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
+@@ -53,3 +54,18 @@
+ : "=r" (_beg) \
+ : "0" (_beg), "r" (_end), "r" (_flg)); \
+ }
++#else
++#define CLEAR_INSN_CACHE(BEG, END) \
++{ \
++ register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
++ register unsigned long _end __asm ("a2") = (unsigned long) (END); \
++ register unsigned long _flg __asm ("a3") = 0; \
++ register unsigned long _swi __asm ("a4") = 0xf0002; \
++ __asm __volatile ("push {r7}\n" \
++ " mov r7,a4\n" \
++ " swi 0 @ sys_cacheflush\n" \
++ " pop {r7}\n" \
++ : "=r" (_beg) \
++ : "0" (_beg), "r" (_end), "r" (_flg), "r" (_swi)); \
++}
++#endif
diff --git a/packages/mamona/gcc-noemu-4.1.2/arm-thumb.patch b/packages/mamona/gcc-noemu-4.1.2/arm-thumb.patch
new file mode 100644
index 0000000000..69e2f68cf2
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/arm-thumb.patch
@@ -0,0 +1,64 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- gcc-4.1.1/gcc/config/arm/lib1funcs.asm~gcc
++++ gcc-4.1.1/gcc/config/arm/lib1funcs.asm
+@@ -995,10 +995,24 @@
+ .code 32
+ FUNC_START div0
+
++#if ! defined __thumb__
+ stmfd sp!, {r1, lr}
+ mov r0, #SIGFPE
+ bl SYM(raise) __PLT__
+ RETLDM r1
++#else
++ push {r1, lr}
++ mov r0, #SIGFPE
++ bl SYM(raise) __PLT__
++#if __ARM_ARCH__ > 4
++ pop {r1, pc}
++#else
++ @ on 4T that won't work
++ pop {r1}
++ pop {r3}
++ bx r3
++#endif
++#endif
+
+ FUNC_END div0
+
+@@ -1141,11 +1155,12 @@
+ code here switches to the correct mode before executing the function. */
+
+ .text
+- .align 0
++ .align 1
+ .force_thumb
+
+ .macro call_via register
+ THUMB_FUNC_START _call_via_\register
++ .hidden SYM (_call_via_\register)
+
+ bx \register
+ nop
+@@ -1242,6 +1257,7 @@
+ .code 16
+
+ THUMB_FUNC_START _interwork_call_via_\register
++ .hidden SYM (_interwork_call_via_\register)
+
+ bx pc
+ nop
+--- gcc-4.1.1/gcc/config/arm/t-linux~gcc
++++ gcc-4.1.1/gcc/config/arm/t-linux
+@@ -7,6 +7,7 @@
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _call_via_rX \
+ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
diff --git a/packages/mamona/gcc-noemu-4.1.2/cache-amnesia.patch b/packages/mamona/gcc-noemu-4.1.2/cache-amnesia.patch
new file mode 100644
index 0000000000..ef7cd111c5
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/cache-amnesia.patch
@@ -0,0 +1,13 @@
+diff --git a/gcc/configure b/gcc/configure
+index 44620ab..6e1830c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -12272,7 +12272,7 @@ else
+ esac
+ saved_CFLAGS="${CFLAGS}"
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+- ${realsrcdir}/configure \
++ CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+ CFLAGS="${saved_CFLAGS}"
diff --git a/packages/mamona/gcc-noemu-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff b/packages/mamona/gcc-noemu-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff
new file mode 100644
index 0000000000..568e15abff
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff
@@ -0,0 +1,18 @@
+--- trunk/gcc/config/arm/arm.c 2006/09/19 13:18:27 117055
++++ trunk/gcc/config/arm/arm.c 2006/09/19 13:19:24 117056
+@@ -15415,6 +15415,15 @@
+ /* Move from sp to reg. */
+ asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0));
+ }
++ else if (GET_CODE (e1) == PLUS
++ && GET_CODE (XEXP (e1, 0)) == REG
++ && REGNO (XEXP (e1, 0)) == SP_REGNUM
++ && GET_CODE (XEXP (e1, 1)) == CONST_INT)
++ {
++ /* Set reg to offset from sp. */
++ asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n",
++ REGNO (e0), (int)INTVAL(XEXP (e1, 1)));
++ }
+ else
+ abort ();
+ break;
diff --git a/packages/mamona/gcc-noemu-4.1.2/gcc-4.0.2-e300c2c3.patch b/packages/mamona/gcc-noemu-4.1.2/gcc-4.0.2-e300c2c3.patch
new file mode 100644
index 0000000000..736ac4b6b6
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/gcc-4.0.2-e300c2c3.patch
@@ -0,0 +1,311 @@
+Adds support for Freescale Power architecture e300c2 and e300c3 cores.
+http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm
+
+Leon Woestenberg <leonw@mailcan.com>
+
+Index: gcc-4.1.2/gcc/config/rs6000/e300c2c3.md
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.1.2/gcc/config/rs6000/e300c2c3.md 2007-10-18 15:32:51.000000000 +0200
+@@ -0,0 +1,189 @@
++;; Pipeline description for Motorola PowerPC e300c3 core.
++;; Copyright (C) 2003 Free Software Foundation, Inc.
++;;
++;; This file is part of GCC.
++
++;; GCC is free software; you can redistribute it and/or modify it
++;; under the terms of the GNU General Public License as published
++;; by the Free Software Foundation; either version 2, or (at your
++;; option) any later version.
++
++;; GCC 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 General Public
++;; License for more details.
++
++;; You should have received a copy of the GNU General Public License
++;; along with GCC; see the file COPYING. If not, write to the
++;; Free Software Foundation, 59 Temple Place - Suite 330, Boston,
++;; MA 02111-1307, USA.
++
++(define_automaton "ppce300c3_most,ppce300c3_long,ppce300c3_retire")
++(define_cpu_unit "ppce300c3_decode_0,ppce300c3_decode_1" "ppce300c3_most")
++
++;; We don't simulate general issue queue (GIC). If we have SU insn
++;; and then SU1 insn, they can not be issued on the same cycle
++;; (although SU1 insn and then SU insn can be issued) because the SU
++;; insn will go to SU1 from GIC0 entry. Fortunately, the first cycle
++;; multipass insn scheduling will find the situation and issue the SU1
++;; insn and then the SU insn.
++(define_cpu_unit "ppce300c3_issue_0,ppce300c3_issue_1" "ppce300c3_most")
++
++;; We could describe completion buffers slots in combination with the
++;; retirement units and the order of completion but the result
++;; automaton would behave in the same way because we can not describe
++;; real latency time with taking in order completion into account.
++;; Actually we could define the real latency time by querying reserved
++;; automaton units but the current scheduler uses latency time before
++;; issuing insns and making any reservations.
++;;
++;; So our description is aimed to achieve a insn schedule in which the
++;; insns would not wait in the completion buffer.
++(define_cpu_unit "ppce300c3_retire_0,ppce300c3_retire_1" "ppce300c3_retire")
++
++;; Branch unit:
++(define_cpu_unit "ppce300c3_bu" "ppce300c3_most")
++
++;; IU:
++(define_cpu_unit "ppce300c3_iu0_stage0,ppce300c3_iu1_stage0" "ppce300c3_most")
++
++;; IU: This used to describe non-pipelined division.
++(define_cpu_unit "ppce300c3_mu_div" "ppce300c3_long")
++
++;; SRU:
++(define_cpu_unit "ppce300c3_sru_stage0" "ppce300c3_most")
++
++;; Here we simplified LSU unit description not describing the stages.
++(define_cpu_unit "ppce300c3_lsu" "ppce300c3_most")
++
++;; FPU:
++(define_cpu_unit "ppce300c3_fpu" "ppce300c3_most")
++
++;; The following units are used to make automata deterministic
++(define_cpu_unit "present_ppce300c3_decode_0" "ppce300c3_most")
++(define_cpu_unit "present_ppce300c3_issue_0" "ppce300c3_most")
++(define_cpu_unit "present_ppce300c3_retire_0" "ppce300c3_retire")
++(define_cpu_unit "present_ppce300c3_iu0_stage0" "ppce300c3_most")
++
++;; The following sets to make automata deterministic when option ndfa is used.
++(presence_set "present_ppce300c3_decode_0" "ppce300c3_decode_0")
++(presence_set "present_ppce300c3_issue_0" "ppce300c3_issue_0")
++(presence_set "present_ppce300c3_retire_0" "ppce300c3_retire_0")
++(presence_set "present_ppce300c3_iu0_stage0" "ppce300c3_iu0_stage0")
++
++;; Some useful abbreviations.
++(define_reservation "ppce300c3_decode"
++ "ppce300c3_decode_0|ppce300c3_decode_1+present_ppce300c3_decode_0")
++(define_reservation "ppce300c3_issue"
++ "ppce300c3_issue_0|ppce300c3_issue_1+present_ppce300c3_issue_0")
++(define_reservation "ppce300c3_retire"
++ "ppce300c3_retire_0|ppce300c3_retire_1+present_ppce300c3_retire_0")
++(define_reservation "ppce300c3_iu_stage0"
++ "ppce300c3_iu0_stage0|ppce300c3_iu1_stage0+present_ppce300c3_iu0_stage0")
++
++;; Compares can be executed either one of the IU or SRU
++(define_insn_reservation "ppce300c3_cmp" 1
++ (and (eq_attr "type" "cmp,compare,delayed_compare,fast_compare")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+(ppce300c3_iu_stage0|ppce300c3_sru_stage0) \
++ +ppce300c3_retire")
++
++;; Other one cycle IU insns
++(define_insn_reservation "ppce300c3_iu" 1
++ (and (eq_attr "type" "integer,insert_word")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_retire")
++
++;; Branch. Actually this latency time is not used by the scheduler.
++(define_insn_reservation "ppce300c3_branch" 1
++ (and (eq_attr "type" "jmpreg,branch")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_bu,ppce300c3_retire")
++
++;; Multiply is non-pipelined but can be executed in any IU
++(define_insn_reservation "ppce300c3_multiply" 2
++ (and (eq_attr "type" "imul,imul2,imul3,imul_compare")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0, \
++ ppce300c3_iu_stage0+ppce300c3_retire")
++
++;; Divide. We use the average latency time here. We omit reserving a
++;; retire unit because of the result automata will be huge.
++(define_insn_reservation "ppce300c3_divide" 20
++ (and (eq_attr "type" "idiv")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_mu_div,\
++ ppce300c3_mu_div*19")
++
++;; CR logical
++(define_insn_reservation "ppce300c3_cr_logical" 1
++ (and (eq_attr "type" "cr_logical,delayed_cr")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
++
++;; Mfcr
++(define_insn_reservation "ppce300c3_mfcr" 1
++ (and (eq_attr "type" "mfcr")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
++
++;; Mtcrf
++(define_insn_reservation "ppce300c3_mtcrf" 1
++ (and (eq_attr "type" "mtcr")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
++
++;; Mtjmpr
++(define_insn_reservation "ppce300c3_mtjmpr" 1
++ (and (eq_attr "type" "mtjmpr,mfjmpr")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
++
++;; Float point instructions
++(define_insn_reservation "ppce300c3_fpcompare" 3
++ (and (eq_attr "type" "fpcompare")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire")
++
++(define_insn_reservation "ppce300c3_fp" 3
++ (and (eq_attr "type" "fp")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire")
++
++(define_insn_reservation "ppce300c3_dmul" 4
++ (and (eq_attr "type" "dmul")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu,nothing,ppce300c3_retire")
++
++; Divides are not pipelined
++(define_insn_reservation "ppce300c3_sdiv" 18
++ (and (eq_attr "type" "sdiv")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*17")
++
++(define_insn_reservation "ppce300c3_ddiv" 33
++ (and (eq_attr "type" "ddiv")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*32")
++
++;; Loads
++(define_insn_reservation "ppce300c3_load" 2
++ (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
++
++(define_insn_reservation "ppce300c3_fpload" 2
++ (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
++
++;; Stores.
++(define_insn_reservation "ppce300c3_store" 2
++ (and (eq_attr "type" "store,store_ux,store_u")
++ (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
++
++(define_insn_reservation "ppce300c3_fpstore" 2
++ (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u")
++ (eq_attr "cpu" "ppce300c3"))
++ "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
+Index: gcc-4.1.2/gcc/config/rs6000/rs6000.c
+===================================================================
+--- gcc-4.1.2.orig/gcc/config/rs6000/rs6000.c 2006-12-16 20:24:56.000000000 +0100
++++ gcc-4.1.2/gcc/config/rs6000/rs6000.c 2007-10-18 15:34:26.000000000 +0200
+@@ -557,6 +557,21 @@
+ COSTS_N_INSNS (29), /* ddiv */
+ };
+
++/* Instruction costs on E300C2 and E300C3 cores. */
++static const
++struct processor_costs ppce300c2c3_cost = {
++ COSTS_N_INSNS (4), /* mulsi */
++ COSTS_N_INSNS (4), /* mulsi_const */
++ COSTS_N_INSNS (4), /* mulsi_const9 */
++ COSTS_N_INSNS (4), /* muldi */
++ COSTS_N_INSNS (19), /* divsi */
++ COSTS_N_INSNS (19), /* divdi */
++ COSTS_N_INSNS (3), /* fp */
++ COSTS_N_INSNS (4), /* dmul */
++ COSTS_N_INSNS (18), /* sdiv */
++ COSTS_N_INSNS (33), /* ddiv */
++};
++
+ /* Instruction costs on POWER4 and POWER5 processors. */
+ static const
+ struct processor_costs power4_cost = {
+@@ -1140,6 +1155,8 @@
+ /* 8548 has a dummy entry for now. */
+ {"8548", PROCESSOR_PPC8540,
+ POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN},
++ {"e300c2", PROCESSOR_PPCE300C2, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
++ {"e300c3", PROCESSOR_PPCE300C3, POWERPC_BASE_MASK},
+ {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"970", PROCESSOR_POWER4,
+ POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64},
+@@ -1529,6 +1546,11 @@
+ rs6000_cost = &ppc8540_cost;
+ break;
+
++ case PROCESSOR_PPCE300C2:
++ case PROCESSOR_PPCE300C3:
++ rs6000_cost = &ppce300c2c3_cost;
++ break;
++
+ case PROCESSOR_POWER4:
+ case PROCESSOR_POWER5:
+ rs6000_cost = &power4_cost;
+@@ -16647,6 +16669,8 @@
+ case CPU_PPC750:
+ case CPU_PPC7400:
+ case CPU_PPC8540:
++ case CPU_PPCE300C2:
++ case CPU_PPCE300C3:
+ return 2;
+ case CPU_RIOS2:
+ case CPU_PPC604:
+Index: gcc-4.1.2/gcc/config/rs6000/rs6000.h
+===================================================================
+--- gcc-4.1.2.orig/gcc/config/rs6000/rs6000.h 2006-11-18 01:25:49.000000000 +0100
++++ gcc-4.1.2/gcc/config/rs6000/rs6000.h 2007-10-18 15:32:51.000000000 +0200
+@@ -111,6 +111,8 @@
+ %{mcpu=970: -mpower4 -maltivec} \
+ %{mcpu=G5: -mpower4 -maltivec} \
+ %{mcpu=8540: -me500} \
++%{mcpu=e300c2: -mppc} \
++%{mcpu=e300c3: -mppc -mpmr} \
+ %{maltivec: -maltivec} \
+ -many"
+
+@@ -211,6 +213,8 @@
+ PROCESSOR_PPC7400,
+ PROCESSOR_PPC7450,
+ PROCESSOR_PPC8540,
++ PROCESSOR_PPCE300C2,
++ PROCESSOR_PPCE300C3,
+ PROCESSOR_POWER4,
+ PROCESSOR_POWER5
+ };
+Index: gcc-4.1.2/gcc/config/rs6000/rs6000.md
+===================================================================
+--- gcc-4.1.2.orig/gcc/config/rs6000/rs6000.md 2006-12-16 20:24:56.000000000 +0100
++++ gcc-4.1.2/gcc/config/rs6000/rs6000.md 2007-10-18 15:32:51.000000000 +0200
+@@ -103,7 +103,7 @@
+ ;; Processor type -- this attribute must exactly match the processor_type
+ ;; enumeration in rs6000.h.
+
+-(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4,power5"
++(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,power4,power5"
+ (const (symbol_ref "rs6000_cpu_attr")))
+
+ (automata_option "ndfa")
+@@ -119,6 +119,7 @@
+ (include "7xx.md")
+ (include "7450.md")
+ (include "8540.md")
++(include "e300c2c3.md")
+ (include "power4.md")
+ (include "power5.md")
+
+Index: gcc-4.1.2/gcc/config.gcc
+===================================================================
+--- gcc-4.1.2.orig/gcc/config.gcc 2007-10-18 15:26:23.000000000 +0200
++++ gcc-4.1.2/gcc/config.gcc 2007-10-18 15:32:51.000000000 +0200
+@@ -2710,7 +2710,7 @@
+ | rios | rios1 | rios2 | rsc | rsc1 | rs64a \
+ | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \
+ | 601 | 602 | 603 | 603e | ec603e | 604 \
+- | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
++ | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 | e300c[23] \
+ | 854[08] | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5)
+ # OK
+ ;;
diff --git a/packages/mamona/gcc-noemu-4.1.2/gcc41-configure.in.patch b/packages/mamona/gcc-noemu-4.1.2/gcc41-configure.in.patch
new file mode 100644
index 0000000000..3d33bcb978
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/gcc41-configure.in.patch
@@ -0,0 +1,22 @@
+--- gcc-3.4.4/configure.in.orig 2005-08-09 19:57:51.504323183 -0700
++++ gcc-3.4.4/configure.in 2005-08-09 20:00:12.073168623 -0700
+@@ -1907,7 +1907,7 @@
+ *) gxx_include_dir=${with_gxx_include_dir} ;;
+ esac
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+--- gcc-3.4.4/configure.orig 2005-08-09 21:02:29.668360660 -0700
++++ gcc-3.4.4/configure 2005-08-09 21:02:50.157649970 -0700
+@@ -2669,7 +2669,7 @@
+ *) gxx_include_dir=${with_gxx_include_dir} ;;
+ esac
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
diff --git a/packages/mamona/gcc-noemu-4.1.2/gfortran.patch b/packages/mamona/gcc-noemu-4.1.2/gfortran.patch
new file mode 100644
index 0000000000..96905e5d7d
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/gfortran.patch
@@ -0,0 +1,40 @@
+The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
+
+This target doesn't really have a 128-bit integer type, however it does use
+TImode to represent the return value of certain special ABI defined library
+functions. This results in type_for_size(TImode) being called.
+
+Because TImode deosn't correspond to any gfortran integer kind
+gfc_type_for_size returns NULL and we segfault shortly after.
+
+The patch below fixes this by making gfc_type_for_size handle TImode in the
+same way as the C frontend.
+
+Tested on x86_64-linux and arm-linux-gnueabi.
+Applied to trunk.
+
+Paul
+
+2007-05-15 Paul Brook <paul@codesourcery.com>
+
+ gcc/fortran/
+ * trans-types.c (gfc_type_for_size): Handle signed TImode.
+
+Index: gcc-4.2.1/gcc/fortran/trans-types.c
+===================================================================
+--- gcc-4.2.1/gcc/fortran/trans-types.c (revision 170435)
++++ gcc-4.2.1/gcc/fortran/trans-types.c (working copy)
+@@ -1800,6 +1800,13 @@ gfc_type_for_size (unsigned bits, int un
+ if (type && bits == TYPE_PRECISION (type))
+ return type;
+ }
++
++ /* Handle TImode as a special case because it is used by some backends
++ (eg. ARM) even though it is not available for normal use. */
++#if HOST_BITS_PER_WIDE_INT >= 64
++ if (bits == TYPE_PRECISION (intTI_type_node))
++ return intTI_type_node;
++#endif
+ }
+ else
+ {
diff --git a/packages/mamona/gcc-noemu-4.1.2/ldflags.patch b/packages/mamona/gcc-noemu-4.1.2/ldflags.patch
new file mode 100644
index 0000000000..9576f60778
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/ldflags.patch
@@ -0,0 +1,22 @@
+--- /tmp/Makefile.in 2006-02-23 20:56:01.399758728 +0100
++++ gcc-4.1-20060217/Makefile.in 2006-02-23 20:56:16.874406224 +0100
+@@ -334,7 +334,7 @@
+ CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+-LDFLAGS_FOR_TARGET =
++LDFLAGS_FOR_TARGET = @LDFLAGS@
+ PICFLAG_FOR_TARGET =
+
+ # ------------------------------------
+--- /tmp/Makefile.tpl 2006-02-23 20:50:34.077519272 +0100
++++ gcc-4.1-20060217/Makefile.tpl 2006-02-23 21:04:31.092273688 +0100
+@@ -337,7 +337,7 @@
+ CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+-LDFLAGS_FOR_TARGET =
++LDFLAGS_FOR_TARGET = @LDFLAGS@
+ PICFLAG_FOR_TARGET =
+
+ # ------------------------------------
diff --git a/packages/mamona/gcc-noemu-4.1.2/pr34130.patch b/packages/mamona/gcc-noemu-4.1.2/pr34130.patch
new file mode 100644
index 0000000000..415335f4b4
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/pr34130.patch
@@ -0,0 +1,16 @@
+Index: gcc-4.1.2/gcc/fold-const.c
+===================================================================
+--- gcc-4.1.2.orig/gcc/fold-const.c 2007-11-21 18:53:42.000000000 +0100
++++ gcc-4.1.2/gcc/fold-const.c 2007-11-21 18:56:26.000000000 +0100
+@@ -5339,7 +5339,10 @@
+ }
+ break;
+ }
+- /* FALLTHROUGH */
++ /* If the constant is negative, we cannot simplify this. */
++ if (tree_int_cst_sgn (c) == -1)
++ break;
++ /* FALLTHROUGH */
+ case NEGATE_EXPR:
+ if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0)
+ return fold_build1 (tcode, ctype, fold_convert (ctype, t1));
diff --git a/packages/mamona/gcc-noemu-4.1.2/sdk-libstdc++-includes.patch b/packages/mamona/gcc-noemu-4.1.2/sdk-libstdc++-includes.patch
new file mode 100644
index 0000000000..4377c2143b
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/sdk-libstdc++-includes.patch
@@ -0,0 +1,22 @@
+--- gcc-3.4.1/libstdc++-v3/libmath/Makefile.am~ 2003-08-27 22:29:42.000000000 +0100
++++ gcc-3.4.1/libstdc++-v3/libmath/Makefile.am 2004-07-22 16:41:45.152130128 +0100
+@@ -32,7 +32,7 @@
+
+ libmath_la_SOURCES = stubs.c
+
+-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
+
+ # Only compiling "C" sources in this directory.
+ LIBTOOL = @LIBTOOL@ --tag CC
+--- gcc-3.4.1/libstdc++-v3/fragment.am.old 2004-07-22 18:24:58.024083656 +0100
++++ gcc-3.4.1/libstdc++-v3/fragment.am 2004-07-22 18:24:59.019932264 +0100
+@@ -18,7 +18,7 @@
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+ # -I/-D flags to pass when compiling.
+-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
+
+
+
diff --git a/packages/mamona/gcc-noemu-4.1.2/sh3-installfix-fixheaders.patch b/packages/mamona/gcc-noemu-4.1.2/sh3-installfix-fixheaders.patch
new file mode 100644
index 0000000000..a06cd2e075
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/sh3-installfix-fixheaders.patch
@@ -0,0 +1,11 @@
+--- gcc-4.1.1/gcc/Makefile.in_orig 2007-01-31 21:24:23.000000000 +0000
++++ gcc-4.1.1/gcc/Makefile.in 2007-01-31 21:24:43.000000000 +0000
+@@ -3772,8 +3772,6 @@
+ $(INSTALL_SCRIPT) $(mkinstalldirs) \
+ $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
+ $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
+- $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
+- $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
+ else :; fi
+ echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
+ > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
diff --git a/packages/mamona/gcc-noemu-4.1.2/unbreak-armv4t.patch b/packages/mamona/gcc-noemu-4.1.2/unbreak-armv4t.patch
new file mode 100644
index 0000000000..b3399abfdb
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/unbreak-armv4t.patch
@@ -0,0 +1,12 @@
+diff -urN gcc-4.1.1/gcc/config/arm/linux-eabi.h gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h
+--- gcc-4.1.1/gcc/config/arm/linux-eabi.h 2006-10-22 11:11:49.000000000 -0700
++++ gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h 2006-10-24 21:34:01.000000000 -0700
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+ #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
diff --git a/packages/mamona/gcc-noemu-4.1.2/zecke-no-host-includes.patch b/packages/mamona/gcc-noemu-4.1.2/zecke-no-host-includes.patch
new file mode 100644
index 0000000000..6afb10d6ef
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/zecke-no-host-includes.patch
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c 2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c 2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+ p->construct = 0;
+ p->user_supplied_p = user_supplied_p;
+
++#ifdef CROSS_COMPILE
++ /* A common error when cross compiling is including
++ host headers. This code below will try to fail fast
++ for cross compiling. Currently we consider /usr/include,
++ /opt/include and /sw/include as harmful. */
++ {
++ /* printf("Adding Path: %s\n", p->name ); */
++ if( strstr(p->name, "/usr/include" ) == p->name ) {
++ fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++ abort();
++ } else if( strstr(p->name, "/sw/include") == p->name ) {
++ fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++ abort();
++ } else if( strstr(p->name, "/opt/include") == p->name ) {
++ fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++ abort();
++ }
++ }
++#endif
++
+ add_cpp_dir_path (p, chain);
+ }
+
diff --git a/packages/mamona/gcc-noemu-4.1.2/zecke-xgcc-cpp.patch b/packages/mamona/gcc-noemu-4.1.2/zecke-xgcc-cpp.patch
new file mode 100644
index 0000000000..921cab6e18
--- /dev/null
+++ b/packages/mamona/gcc-noemu-4.1.2/zecke-xgcc-cpp.patch
@@ -0,0 +1,16 @@
+upstream: n/a
+comment: Use the preprocessor we have just compiled instead the one of
+the system. There might be incompabilities between us and them.
+
+Index: gcc-4.1.1/Makefile.in
+===================================================================
+--- gcc-4.1.1.orig/Makefile.in 2006-08-06 13:32:44.000000000 +0200
++++ gcc-4.1.1/Makefile.in 2006-08-06 13:32:46.000000000 +0200
+@@ -194,6 +194,7 @@
+ AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
++ CPP="$(CC_FOR_TARGET) -E"; export CCP; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
diff --git a/packages/mamona/gcc-noemu_4.1.1.bb b/packages/mamona/gcc-noemu_4.1.1.bb
index fbf1b0dd46..15825980ef 100644
--- a/packages/mamona/gcc-noemu_4.1.1.bb
+++ b/packages/mamona/gcc-noemu_4.1.1.bb
@@ -4,6 +4,9 @@ HOMEPAGE = "http://www.gnu.org/software/gcc/"
SECTION = "devel"
LICENSE = "GPL"
+RCONFLICTS = "gcc"
+RREPLACES = "gcc"
+
inherit autotools gettext
require gcc-package-noemu.inc
diff --git a/packages/mamona/gcc-noemu_4.1.2.bb b/packages/mamona/gcc-noemu_4.1.2.bb
new file mode 100644
index 0000000000..9015e10227
--- /dev/null
+++ b/packages/mamona/gcc-noemu_4.1.2.bb
@@ -0,0 +1,104 @@
+DESCRIPTION = "The GNU cc and gcc C compilers."
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+# NOTE: split PR. If the main .bb changes something that affects its *build*
+# remember to increment the -cross .bb PR too.
+PR = "r0"
+
+RCONFLICTS = "gcc"
+RREPLACES = "gcc"
+RCONFLICTS_g++-noemu = "g++"
+RREPLACES_g++-noemu = "g++"
+RCONFLICTS_cpp-noemu = "cpp"
+RREPLACES_cpp-noemu = "cpp"
+
+inherit autotools gettext
+
+require gcc-package-noemu.inc
+
+SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2 \
+ file://100-uclibc-conf.patch;patch=1 \
+ file://110-arm-eabi.patch;patch=1 \
+ file://200-uclibc-locale.patch;patch=1 \
+ file://300-libstdc++-pic.patch;patch=1 \
+ file://301-missing-execinfo_h.patch;patch=1 \
+ file://302-c99-snprintf.patch;patch=1 \
+ file://303-c99-complex-ugly-hack.patch;patch=1 \
+ file://304-index_macro.patch;patch=1 \
+ file://602-sdk-libstdc++-includes.patch;patch=1 \
+ file://740-sh-pr24836.patch;patch=1 \
+ file://800-arm-bigendian.patch;patch=1 \
+ file://arm-nolibfloat.patch;patch=1 \
+ file://arm-softfloat.patch;patch=1 \
+ file://gcc41-configure.in.patch;patch=1 \
+ file://arm-thumb.patch;patch=1 \
+ file://arm-thumb-cache.patch;patch=1 \
+ file://ldflags.patch;patch=1 \
+ file://zecke-xgcc-cpp.patch;patch=1 \
+ file://unbreak-armv4t.patch;patch=1 \
+ file://fix-ICE-in-arm_unwind_emit_set.diff;patch=1 \
+ file://cache-amnesia.patch;patch=1 \
+ file://gfortran.patch;patch=1 \
+ file://gcc-4.0.2-e300c2c3.patch;patch=1 \
+ file://pr34130.patch;patch=1 \
+ "
+
+SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 "
+
+SRC_URI_avr32 = "http://www.angstrom-distribution.org/unstable/sources/gcc-4.1.2-atmel.1.1.0.tar.gz \
+# file://100-uclibc-conf.patch;patch=1 \
+# file://200-uclibc-locale.patch;patch=1 \
+# file://300-libstdc++-pic.patch;patch=1 \
+ file://301-missing-execinfo_h.patch;patch=1 \
+ file://302-c99-snprintf.patch;patch=1 \
+ file://303-c99-complex-ugly-hack.patch;patch=1 \
+ file://304-index_macro.patch;patch=1 \
+ file://602-sdk-libstdc++-includes.patch;patch=1 \
+ file://gcc41-configure.in.patch;patch=1 \
+ file://ldflags.patch;patch=1 \
+ file://zecke-xgcc-cpp.patch;patch=1 \
+ file://cache-amnesia.patch;patch=1 \
+ "
+
+do_compile_prepend_avr32() {
+ ln -sf ${S}/libstdc++-v3/config/os/uclibc/ ${S}/libstdc++-v3/config/os/uclibc-linux
+}
+
+#Set the fortran bits
+# ',fortran' or '', not 'f77' like gcc3 had
+FORTRAN = ""
+HAS_GFORTRAN = "no"
+HAS_G2C = "no"
+
+#Set the java bits
+JAVA = ""
+JAVA_arm = ""
+
+
+LANGUAGES = "c,c++${FORTRAN}${JAVA}"
+require packages/gcc/gcc-${PV}.inc
+
+
+EXTRA_OECONF += " --disable-libssp --with-slibdir=\"/lib\" "
+
+EXTRA_OEMAKE += "LDFLAGS=\"-static\" build_tooldir=\"${STAGING_DIR}/${TARGET_SYS}\""
+
+CONFIG_SITE=""
+
+do_configure () {
+ export CPP="gcc -E"
+ export CC=gcc
+ export AS=as
+ export LD=ld
+ export CXX=g++
+ export AR=ar
+ export OBJCOPY=objcopy
+ export OBJDUMP=objdump
+ export RANLIB=ranlib
+ export NM=nm
+ export STRIP=strip
+ export CFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
+ export CXXFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -fpermissive -fvisibility-inlines-hidden"
+ oe_runconf
+}
diff --git a/packages/mamona/gcc-package-noemu.inc b/packages/mamona/gcc-package-noemu.inc
index 548c3d4f01..3288e608bd 100644
--- a/packages/mamona/gcc-package-noemu.inc
+++ b/packages/mamona/gcc-package-noemu.inc
@@ -1,15 +1,9 @@
gcclibdir ?= "${libdir}/gcc"
BINV ?= "${PV}"
-PACKAGES = "libgcc ${PN} ${PN}-symlinks \
+PACKAGES = "${PN} ${PN}-symlinks \
g++-noemu g++-noemu-symlinks \
- cpp-noemu cpp-noemu-symlinks \
- g77-noemu g77-noemu-symlinks \
- gcov-noemu gcov-noemu-symlinks \
- libmudflap-noemu libmudflap-noemu-dev \
- libstdc++-noemu libg2c-noemu \
- libstdc++-noemu-dev libg2c-noemu-dev \
- ${PN}-doc"
+ cpp-noemu cpp-noemu-symlinks"
FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \
${bindir}/${TARGET_PREFIX}gccbug \
@@ -18,62 +12,21 @@ FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \
${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/include"
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so"
FILES_${PN}-symlinks = "${bindir}/cc \
${bindir}/gcc \
${bindir}/gccbug"
-FILES_g77-noemu = "${bindir}/${TARGET_PREFIX}g77 \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771"
-FILES_g77-noemu-symlinks = "${bindir}/g77 \
- ${bindir}/f77"
-
FILES_cpp-noemu = "${bindir}/${TARGET_PREFIX}cpp \
${base_libdir}/cpp"
FILES_cpp-noemu-symlinks = "${bindir}/cpp"
-FILES_gcov-noemu = "${bindir}/${TARGET_PREFIX}gcov"
-FILES_gcov-noemu-symlinks = "${bindir}/gcov"
-
-FILES_libgcc-noemu = "${base_libdir}/libgcc*.so.*"
-FILES_libgcc-noemu-dev = "${base_libdir}/libgcc*.so"
-
-# Called from within gcc-cross, so libdir is set wrong
-FILES_libg2c-noemu = "${target_libdir}/libg2c.so.*"
-FILES_libg2c-noemu-dev = "${libdir}/libg2c.so \
- ${libdir}/libg2c.a \
- ${libdir}/libfrtbegin.a"
-
FILES_g++-noemu = "${bindir}/${TARGET_PREFIX}g++ \
${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus"
FILES_g++-noemu-symlinks = "${bindir}/c++ \
${bindir}/g++"
-FILES_libstdc++-noemu = "${libdir}/libstdc++.so.*"
-FILES_libstdc++-noemu-dev = "${includedir}/c++/${BINV} \
- ${libdir}/libstdc++.so \
- ${libdir}/libstdc++.la \
- ${libdir}/libstdc++.a \
- ${libdir}/libsupc++.la \
- ${libdir}/libsupc++.a"
-
-FILES_libmudflap-noemu = "${libdir}/libmudflap*.so.*"
-FILES_libmudflap-noemu-dev = "${libdir}/libmudflap*.so \
- ${libdir}/libmudflap*.a \
- ${libdir}/libmudflap*.a"
-
-
-FILES_${PN}-doc = "${infodir} \
- ${mandir} \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README"
-
-python do_package() {
- if bb.data.getVar('DEBIAN_NAMES', d, 1):
- bb.data.setVar('PKG_libgcc', 'libgcc1', d)
- bb.build.exec_func('package_do_package', d)
-}
-
-
do_install () {
autotools_do_install
@@ -85,14 +38,14 @@ do_install () {
test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
# Using --with-slibdir instead of this hack below..
- ## Move libgcc_s into /lib
+ # Move libgcc_s into /lib
#mkdir -p ${D}${base_libdir}
#mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
- #rm -f ${D}${libdir}/libgcc_s.so
- #ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
- # | tr -s / \
- # | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
- # ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
+ rm -f ${D}${libdir}/libgcc_s.so
+ ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
+ | tr -s / \
+ | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
+ ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
# We don't need libtool libraries
rm -f ${D}${libdir}/libg2c.la &>/dev/null || true
@@ -115,10 +68,10 @@ do_install () {
rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
# Symlinks so we can use these trivially on the target
- ln -sf ${TARGET_SYS}-g77 g77
+# ln -sf ${TARGET_SYS}-g77 g77
ln -sf ${TARGET_SYS}-g++ g++
ln -sf ${TARGET_SYS}-gcc gcc
- ln -sf g77 f77
+# ln -sf g77 f77
ln -sf g++ c++
ln -sf gcc cc
ln -sf ${bindir}/${TARGET_SYS}-cpp ${D}${base_libdir}/cpp
diff --git a/packages/mamona/mamona-input-methods_git.bb b/packages/mamona/mamona-input-methods_git.bb
new file mode 100644
index 0000000000..ca894534d9
--- /dev/null
+++ b/packages/mamona/mamona-input-methods_git.bb
@@ -0,0 +1,78 @@
+# Copyright (C) 2008 Instituto Nokia de Tecnologia
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Mamona input methods"
+HOMEPAGE = "http://dev.openbossa.org/trac/mamona/wiki"
+LICENSE = "GPL"
+SECTION = "libs/inputmethods"
+DEPENDS = "ecore gtk+"
+PR = "r4"
+
+PV = "0.1+git"
+
+inherit autotools pkgconfig lib_package
+
+SRC_URI = "git://dev.openbossa.org/mamona/projects/mamona_input_methods.git;protocol=http"
+
+S = "${WORKDIR}/git"
+
+# Mamona IM
+RPROVIDES_${PN} = "libmamona-im0"
+
+# Ecore
+PACKAGES += "\
+ ${PN}-ecore \
+ ${PN}-ecore-dev \
+ ${PN}-ecore-dbg \
+ "
+RPROVIDES_${PN}-ecore = "libmamona-im-ecore"
+EXTRA_OECONF = "\
+ --enable-ecore-im \
+ "
+FILES_${PN}-ecore = "\
+ ${libdir}/ecore/immodules/mamona-im-ecore-module.so \
+ "
+FILES_${PN}-ecore-dev = "\
+ ${libdir}/ecore/immodules/mamona-im-ecore-module.la \
+ ${libdir}/ecore/immodules/mamona-im-ecore-module.a \
+ "
+FILES_${PN}-ecore-dbg = "\
+ ${libdir}/ecore/immodules/.debug \
+ "
+
+# GTK
+PACKAGES += "\
+ ${PN}-gtk \
+ ${PN}-gtk-dev \
+ ${PN}-gtk-dbg \
+ "
+RPROVIDES_${PN}-gtk = "libmamona-im-gtk"
+EXTRA_OECONF += "\
+ --enable-gtk-im \
+ "
+FILES_${PN}-gtk = "\
+ ${libdir}/gtk-2.0/*/immodules/mamona-im-gtk-module.so \
+ "
+FILES_${PN}-gtk-dev = "\
+ ${libdir}/gtk-2.0/*/immodules/mamona-im-gtk-module.la \
+ ${libdir}/gtk-2.0/*/immodules/mamona-im-gtk-module.a \
+ "
+FILES_${PN}-gtk-dbg = "\
+ ${libdir}/gtk-2.0/*/immodules/.debug \
+ "
+
+do_configure_prepend() {
+ ./autogen.sh
+}
+
+do_stage() {
+ autotools_stage_all
+}
+
+pkg_postinst_${PN}-gtk() {
+ gtk-query-immodules-2.0 > ${sysconfdir}/gtk-2.0/gtk.immodules
+}
+
+pkg_postrm_${PN}-gtk() {
+ gtk-query-immodules-2.0 > ${sysconfdir}/gtk-2.0/gtk.immodules
+}
diff --git a/packages/mamona/mamona-sound-n770/asound.conf b/packages/mamona/mamona-sound-n770/asound.conf
new file mode 100644
index 0000000000..e7f73cec87
--- /dev/null
+++ b/packages/mamona/mamona-sound-n770/asound.conf
@@ -0,0 +1,22 @@
+# PCM
+pcm.!default {
+ type alsa_dsp
+ playback_device_file ["/dev/dsptask/pcm1"]
+ recording_device_file ["/dev/dsptask/pcm_rec"]
+}
+
+# Mixer
+ctl.!master {
+ type hw
+ card 0
+}
+
+ctl.!default {
+ type dsp_ctl
+ playback_devices ["/dev/dsptask/pcm1"]
+ recording_devices ["/dev/dsptask/pcm_rec"]
+}
+
+# OSS emulation
+pcm.dsp0 pcm.default
+ctl.mixer0 mixer.default
diff --git a/packages/mamona/mamona-sound-n770/dsp-n800.rules b/packages/mamona/mamona-sound-n770/dsp-n800.rules
new file mode 100644
index 0000000000..ae01361899
--- /dev/null
+++ b/packages/mamona/mamona-sound-n770/dsp-n800.rules
@@ -0,0 +1,6 @@
+# dsp dev
+KERNEL=="dspctl", NAME="dspctl/ctl"
+KERNEL=="dspmem", NAME="dspctl/mem", MODE="0640", GROUP="kmem"
+KERNEL=="dsptwch", NAME="dspctl/twch", MODE="0640"
+KERNEL=="dsperr", NAME="dspctl/err", MODE="0440"
+KERNEL=="dsptask[0-9]*", MODE="0666"
diff --git a/packages/mamona/mamona-sound-n770_0.1.0.bb b/packages/mamona/mamona-sound-n770_0.1.0.bb
new file mode 100644
index 0000000000..c0bea6a634
--- /dev/null
+++ b/packages/mamona/mamona-sound-n770_0.1.0.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "Mamona's sound configuration for Nokia N770"
+HOMEPAGE = "http://dev.openbossa.org/trac/mamona/"
+#SECTION = "console/utils"
+LICENSE = "GPL"
+RDEPENDS = "dspgw-utils udev alsa-lib alsa-utils-alsactl"
+PR = "r1"
+
+PACKAGES = "${PN}"
+
+SRC_URI = "file://dsp-n800.rules \
+ file://asound.conf \
+ "
+
+# Skipping...
+do_configure () {
+}
+
+# Skipping...
+do_stage () {
+}
+
+# Skipping...
+do_compile () {
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0755 ${WORKDIR}/dsp-n800.rules ${D}${sysconfdir}/udev/rules.d/
+
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}/
+}
diff --git a/packages/mamona/mamona-sound-n800_0.1.0.bb b/packages/mamona/mamona-sound-n800_0.1.0.bb
index c1c66720bc..00507345c9 100644
--- a/packages/mamona/mamona-sound-n800_0.1.0.bb
+++ b/packages/mamona/mamona-sound-n800_0.1.0.bb
@@ -1,15 +1,13 @@
DESCRIPTION = "Mamona's sound configuration for Nokia N800"
HOMEPAGE = "http://dev.openbossa.org/trac/mamona/"
-#SECTION = "console/utils"
LICENSE = "GPL"
-RDEPENDS = "dspgw-utils udev alsa-lib alsa-utils-alsactl alsa-state"
+RDEPENDS = "dspgw-utils udev alsa-lib alsa-utils-alsactl"
PR = "r1"
PACKAGES = "${PN}"
SRC_URI = "file://dsp-n800.rules \
file://asound.conf \
- file://asound.state \
"
# Skipping...
@@ -30,7 +28,4 @@ do_install () {
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}/
-
- install -d ${D}${sysconfdir}
- install -m 0644 ${WORKDIR}/asound.state ${D}${sysconfdir}/
}
diff --git a/packages/mamona/mamonaim-e-applet_git.bb b/packages/mamona/mamonaim-e-applet_git.bb
new file mode 100644
index 0000000000..6f45a457c4
--- /dev/null
+++ b/packages/mamona/mamonaim-e-applet_git.bb
@@ -0,0 +1,36 @@
+# Copyright (C) 2008 Instituto Nokia de Tecnologia
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Mamona-IM Enlightenment Applet"
+HOMEPAGE = "http://dev.openbossa.org/trac/mamona/wiki"
+LICENSE = "MIT BSD"
+DEPENDS = "mamona-input-methods e-wm"
+PR = "r0"
+
+PV = "0.1+git"
+
+inherit autotools pkgconfig
+
+SRC_URI = "git://dev.openbossa.org/mamona/projects/mamonaim_e_applet.git;protocol=http"
+
+S = "${WORKDIR}/git"
+
+# E Applet
+FILES_${PN} = "\
+ ${libdir}/enlightenment/modules/mamonaim/module.desktop \
+ ${libdir}/enlightenment/modules/mamonaim/mamonaim.edj \
+ ${libdir}/enlightenment/modules/mamonaim/e-module-mamonaim.edj \
+ ${libdir}/enlightenment/modules/mamonaim/*.png \
+ ${libdir}/enlightenment/modules/mamonaim/*/module.so \
+ "
+FILES_${PN}-dev = "\
+ ${libdir}/enlightenment/modules/mamonaim/*/module.la \
+ ${libdir}/enlightenment/modules/mamonaim/*/module.a \
+ "
+FILES_${PN}-dbg = "\
+ ${libdir}/enlightenment/modules/mamonaim/*/.debug \
+ "
+
+do_configure_prepend() {
+ ./autogen.sh
+}
diff --git a/packages/mamona/udev-usbserial/80-usbconsole.rules b/packages/mamona/udev-usbserial/80-usbconsole.rules
new file mode 100644
index 0000000000..aa479b2916
--- /dev/null
+++ b/packages/mamona/udev-usbserial/80-usbconsole.rules
@@ -0,0 +1 @@
+BUS=="usb", KERNEL=="ttyUSB0", SUBSYSTEM=="tty", ACTION=="add", RUN+="/bin/sh -c 'while [ -e /dev/ttyUSB0 ]; do /sbin/getty 115200 ttyUSB0; done'"
diff --git a/packages/mamona/udev-usbserial_0.1.bb b/packages/mamona/udev-usbserial_0.1.bb
new file mode 100644
index 0000000000..32e967db2e
--- /dev/null
+++ b/packages/mamona/udev-usbserial_0.1.bb
@@ -0,0 +1,30 @@
+DESCRIPTION = "Udev rules file to spawn getty in ttyUSB"
+SECTION = "utils"
+LICENSE = "GPL"
+RDEPENDS = "udev"
+PR = "r1"
+
+PACKAGES = "${PN}"
+
+SRC_URI = "file://80-usbconsole.rules"
+
+inherit autotools
+
+# Skipping...
+do_configure () {
+}
+# Skipping...
+do_stage () {
+}
+# Skipping...
+do_compile () {
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0644 ${WORKDIR}/80-usbconsole.rules ${D}${sysconfdir}/udev/rules.d
+}
+
+pkg_postinst_${PN}() {
+ udevcontrol reload_rules || true
+}
diff --git a/packages/mamona/uinput-2.6.21/nokia800/defconfig b/packages/mamona/uinput-2.6.21/nokia800/defconfig
new file mode 100644
index 0000000000..188b1851f0
--- /dev/null
+++ b/packages/mamona/uinput-2.6.21/nokia800/defconfig
@@ -0,0 +1,1556 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.21-omap1
+# Mon Jun 2 20:06:59 2008
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# 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_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+CONFIG_ARCH_OMAP=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+CONFIG_ARCH_OMAP2=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_MACH_OMAP2420_DVFS is not set
+# CONFIG_ARCH_OMAP2420_DEBUG is not set
+# CONFIG_ARCH_OMAP2420_DMA_DRAIN is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+CONFIG_OMAP_COMPONENT_VERSION=y
+CONFIG_OMAP_GPIO_SWITCH=y
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_STI=y
+CONFIG_OMAP_STI_CONSOLE=y
+# CONFIG_OMAP_MCBSP is not set
+CONFIG_OMAP_MMU_FWK=y
+CONFIG_OMAP_MBOX_FWK=y
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+CONFIG_OMAP_LL_DEBUG_UART3=y
+CONFIG_OMAP_DSP=y
+# CONFIG_OMAP_DSP_MBCMD_VERBOSE is not set
+CONFIG_OMAP_DSP_TASK_MULTIOPEN=y
+CONFIG_OMAP_DSP_FBEXPORT=y
+# CONFIG_OMAP_DSP_PAUSING is not set
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP Core Type
+#
+CONFIG_ARCH_OMAP24XX=y
+CONFIG_ARCH_OMAP2420=y
+# CONFIG_ARCH_OMAP2430 is not set
+
+#
+# OMAP Board Type
+#
+CONFIG_MACH_NOKIA_N800=y
+# CONFIG_MACH_NOKIA_RX44 is not set
+CONFIG_MACH_OMAP2_TUSB6010=y
+# CONFIG_MACH_OMAP_H4 is not set
+# CONFIG_MACH_OMAP_APOLLON is not set
+# CONFIG_MACH_OMAP_2430SDP is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_V6=y
+# CONFIG_CPU_32v6K is not set
+CONFIG_CPU_32v6=y
+CONFIG_CPU_ABRT_EV6=y
+CONFIG_CPU_CACHE_V6=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+CONFIG_NO_IDLE_HZ=y
+CONFIG_HZ=128
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_LEDS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x10C08000
+CONFIG_ZBOOT_ROM_BSS=0x10200000
+# CONFIG_ZBOOT_ROM is not set
+CONFIG_CMDLINE="root=1f03 rootfstype=jffs2"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_VFP=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_LEGACY is not set
+# CONFIG_PM_DEBUG is not set
+# CONFIG_PM_SYSFS_DEPRECATED is not set
+# CONFIG_APM_EMULATION is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETLABEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=y
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK_ENABLED is not set
+CONFIG_NETFILTER_XTABLES=y
+# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
+# CONFIG_NETFILTER_XT_TARGET_MARK is not set
+# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
+# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
+# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
+# CONFIG_NETFILTER_XT_MATCH_ESP is not set
+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
+# CONFIG_NETFILTER_XT_MATCH_MAC is not set
+# CONFIG_NETFILTER_XT_MATCH_MARK is not set
+# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
+# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
+# CONFIG_NETFILTER_XT_MATCH_REALM is not set
+# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
+# CONFIG_NETFILTER_XT_MATCH_STRING is not set
+# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
+# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=y
+# CONFIG_IP_NF_MATCH_IPRANGE is not set
+# CONFIG_IP_NF_MATCH_TOS is not set
+# CONFIG_IP_NF_MATCH_RECENT is not set
+# CONFIG_IP_NF_MATCH_ECN is not set
+# CONFIG_IP_NF_MATCH_AH is not set
+# CONFIG_IP_NF_MATCH_TTL is not set
+# CONFIG_IP_NF_MATCH_OWNER is not set
+# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
+CONFIG_IP_NF_FILTER=y
+# CONFIG_IP_NF_TARGET_REJECT is not set
+# CONFIG_IP_NF_TARGET_LOG is not set
+# CONFIG_IP_NF_TARGET_ULOG is not set
+CONFIG_IP_NF_TARGET_IDLETIMER=y
+# CONFIG_IP_NF_MANGLE is not set
+# CONFIG_IP_NF_RAW is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+# CONFIG_BT_BNEP_MC_FILTER is not set
+# CONFIG_BT_BNEP_PROTO_FILTER is not set
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIUSB is not set
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_IEEE80211 is not set
+CONFIG_WIRELESS_EXT=y
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+CONFIG_MTD_ONENAND=y
+# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
+# CONFIG_MTD_ONENAND_GENERIC is not set
+CONFIG_MTD_ONENAND_OMAP2=y
+CONFIG_MTD_ONENAND_OTP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=y
+
+#
+# PHY device support
+#
+
+#
+# Ethernet (10 or 100Mbit)
+#
+# CONFIG_NET_ETHERNET is not set
+CONFIG_MII=y
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+# CONFIG_NET_WIRELESS_RTNETLINK is not set
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_HOSTAP is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_PPP=y
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_BSDCOMP=y
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=y
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_OMAP is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_TSC2301=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_ADS7846 is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_UCB1400 is not set
+CONFIG_TOUCHSCREEN_TSC2301=y
+# CONFIG_TOUCHSCREEN_TSC2046 is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_OMAP=y
+CONFIG_SERIAL_OMAP_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_ISP1301_OMAP is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_SENSORS_TLV320AIC23 is not set
+# CONFIG_SENSORS_TSL2563 is not set
+# CONFIG_GPIOEXPANDER_OMAP is not set
+# CONFIG_LM8323 is not set
+# CONFIG_LP5521 is not set
+CONFIG_MENELAUS=y
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_OMAP24XX is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_TSC2005 is not set
+# CONFIG_SPI_TSC2101 is not set
+# CONFIG_SPI_TSC2102 is not set
+CONFIG_SPI_TSC2301=y
+CONFIG_SPI_TSC2301_AUDIO=y
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_TMP105 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# LED devices
+#
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+# CONFIG_LEDS_OMAP is not set
+CONFIG_LEDS_OMAP_PWM=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=y
+# CONFIG_VIDEO_V4L1 is not set
+# CONFIG_VIDEO_V4L1_COMPAT is not set
+CONFIG_VIDEO_V4L2=y
+
+#
+# Video Capture Adapters
+#
+
+#
+# Video Capture Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+
+#
+# V4L USB devices
+#
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_USBVISION is not set
+# CONFIG_VIDEO_OMAP_CAMERA is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_TEA5761 is not set
+# CONFIG_USB_DSBR is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_OMAP=y
+CONFIG_FB_OMAP_LCDC_EXTERNAL=y
+# CONFIG_FB_OMAP_LCDC_HWA742 is not set
+CONFIG_FB_OMAP_LCDC_BLIZZARD=y
+# CONFIG_FB_OMAP_MANUAL_UPDATE is not set
+CONFIG_FB_OMAP_LCD_MIPID=y
+CONFIG_FB_OMAP_BOOTLOADER_INIT=y
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4
+# CONFIG_FB_OMAP_PAUSING is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=y
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PROCFS is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA ARM devices
+#
+# CONFIG_SND_OMAP_AIC23 is not set
+CONFIG_SND_AIC33=y
+# CONFIG_SND_OMAP_TSC2101 is not set
+# CONFIG_SND_SX1 is not set
+# CONFIG_SND_OMAP_TSC2102 is not set
+CONFIG_SND_OMAP24XX_EAC=y
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# SoC audio support
+#
+# CONFIG_SND_SOC is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+CONFIG_USB_DEBUG=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DYNAMIC_MINORS=y
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+CONFIG_USB_OTG_WHITELIST=y
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_TUSB6010=y
+# CONFIG_USB_TUSB6010_TEST is not set
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+CONFIG_USB_MUSB_HSET=y
+CONFIG_MUSB_PIO_ONLY=y
+CONFIG_USB_MUSB_LOGLEVEL=0
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_TOUCHSCREEN is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_GTCO is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+CONFIG_USB_RTL8150=y
+# CONFIG_USB_USBNET_MII is not set
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_CDCETHER=y
+# CONFIG_USB_NET_DM9601 is not set
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=y
+CONFIG_USB_NET_PLUSB=y
+# CONFIG_USB_NET_MCS7830 is not set
+CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_CDC_SUBSET=y
+# CONFIG_USB_ALI_M5632 is not set
+# CONFIG_USB_AN2720 is not set
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_EPSON2888 is not set
+# CONFIG_USB_KC2190 is not set
+CONFIG_USB_NET_ZAURUS=y
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_OMAP=y
+# CONFIG_MMC_PAUSING is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# CBUS support
+#
+CONFIG_CBUS=y
+CONFIG_CBUS_TAHVO=y
+CONFIG_CBUS_TAHVO_USER=y
+# CONFIG_CBUS_TAHVO_USB is not set
+CONFIG_CBUS_RETU=y
+CONFIG_CBUS_RETU_USER=y
+CONFIG_CBUS_RETU_POWERBUTTON=y
+CONFIG_CBUS_RETU_RTC=y
+CONFIG_CBUS_RETU_WDT=y
+CONFIG_CBUS_RETU_HEADSET=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=m
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=m
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_SYSFS is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+CONFIG_NLS_ISO8859_15=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_NETWORK is not set
+# CONFIG_SECURITY_CAPABILITIES is not set
+# CONFIG_SECURITY_ROOTPLUG is not set
+# CONFIG_SECURITY_LOWMEM is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
diff --git a/packages/mamona/uinput-2.6.21/uinput b/packages/mamona/uinput-2.6.21/uinput
new file mode 100755
index 0000000000..c929a93f95
--- /dev/null
+++ b/packages/mamona/uinput-2.6.21/uinput
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+insmod /lib/modules/uinput.ko
+
+exit 0
diff --git a/packages/mamona/uinput_2.6.21.bb b/packages/mamona/uinput_2.6.21.bb
new file mode 100644
index 0000000000..c2ec71dab2
--- /dev/null
+++ b/packages/mamona/uinput_2.6.21.bb
@@ -0,0 +1,43 @@
+DESCRIPTION = "uinput support to Nokia 770/8*0 using Nokia kernel"
+SECTION = "kernel/modules"
+LICENSE = "GPL"
+PR = "r0"
+
+PACKAGES = "${PN}"
+
+FILES_${PN} += "/lib/modules/uinput.ko /etc/init.d/uinput"
+
+COMPATIBLE_MACHINE = "(nokia770|nokia800)"
+
+SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \
+ http://dev.openbossa.org/mamona/sources/kernel-source-rx-34_2.6.21.0.tar.gz \
+ file://defconfig \
+ file://uinput \
+"
+
+LDFLAGS=""
+BUILD_LDFLAGS=""
+CFLAGS=""
+BUILD_CFLAGS=""
+TARGET_LDFLAGS=""
+
+S = "${WORKDIR}/kernel-source-rx-34-2.6.21.0"
+
+do_configure() {
+}
+
+do_compile() {
+ cp ${WORKDIR}/defconfig ${S}/.config
+ PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules
+}
+
+do_install() {
+ install -d ${D}/lib/modules/
+ install -m 0644 ${S}/drivers/input/misc/uinput.ko ${D}/lib/modules/
+ install -d ${D}/etc/init.d/
+ install -m 0755 ${WORKDIR}/uinput ${D}/etc/init.d/
+}
+
+pkg_postinst () {
+ update-rc.d uinput defaults 10
+} \ No newline at end of file
diff --git a/packages/meta/mamona-buildall.inc b/packages/meta/mamona-buildall.inc
deleted file mode 100644
index 735243a5c8..0000000000
--- a/packages/meta/mamona-buildall.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-# Forcing build all rdepends
-do_mamona[nostamp] = "1"
-do_mamona[recrdeptask] = "do_package_write"
-addtask mamona before do_build after do_install
diff --git a/packages/meta/meta-mamona.bb b/packages/meta/meta-mamona.bb
index e4fb4bdfb7..a7e3d9f89e 100644
--- a/packages/meta/meta-mamona.bb
+++ b/packages/meta/meta-mamona.bb
@@ -1,17 +1,102 @@
DESCRIPTION = "Meta package for Mamona"
LICENSE = "MIT"
-PR = "r1"
+PR = "r2"
inherit meta
EXCLUDE_FROM_WORLD = "1"
RDEPENDS = " \
task-mamona-base \
+task-mamona \
task-mamona-devel \
-task-mamona-extras \
-task-mamona-nokia-it \
-task-mamona-noemu \
-task-mamona-e \
+task-mamona-sdk \
+task-mamona-sdk-noemu \
+task-mamona-wm \
+task-mamona-python \
+task-mamona-systemtap \
+coreutils \
+cpio \
+dbus \
+diffstat \
+dnsmasq \
+dosfstools \
+e2fsprogs \
+expat \
+findutils \
+firefox \
+fontconfig \
+gconf \
+glib-2.0 \
+gnome-common \
+gnome-vfs \
+groff \
+gstreamer \
+gtk+ \
+gtk+-doc \
+gtk-engines-dev \
+ifupdown \
+initscripts \
+intltool \
+libart-lgpl \
+libdbi \
+libelf \
+libfontenc \
+libmatchbox \
+liboil \
+libpng \
+libtelepathy \
+libtool \
+libusb \
+libxau \
+libxcursor \
+libxdmcp \
+libxext \
+libxfixes \
+libxfont \
+libxi \
+libxkbfile \
+libxml2 \
+libxpm \
+libxrandr \
+libxrender \
+libxslt \
+libxt \
+libxtst \
+libxv \
+lsof \
+makedev \
+matchbox-wm \
+midori \
+mime-support \
+module-init-tools \
+mplayer-maemo \
+ncurses \
+net-tools \
+netbase \
+openobex \
+portmap \
+ppp \
+procps \
+qt4-x11-free \
+quilt \
+renderproto-dev \
+samba \
+sgml-common \
+shared-mime-info \
+slang \
+sqlite \
+sqlite3 \
+sudo \
+sysvinit \
+telepathy-gabble \
+telepathy-glib \
+telepathy-mission-control \
+tslib \
+ttf-bitstream-vera \
+udev \
+util-linux \
+vim \
+wget \
+xkbd \
+xtrans-dev \
"
-
-include mamona-buildall.inc
diff --git a/packages/opkg/opkg_svn.bb b/packages/opkg/opkg_svn.bb
index d53fb11fd8..24547d6503 100644
--- a/packages/opkg/opkg_svn.bb
+++ b/packages/opkg/opkg_svn.bb
@@ -17,8 +17,9 @@ if [ "x$D" != "x" ]; then
# this happens at S98 where our good 'ole packages script used to run
echo "#!/bin/sh
opkg-cl configure
+rm -f /${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
" > ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
- chmod 0755 ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
+ chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
fi
update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100
diff --git a/packages/pidgin/pidgin.inc b/packages/pidgin/pidgin.inc
index db66d13b20..7e99ba7eed 100644
--- a/packages/pidgin/pidgin.inc
+++ b/packages/pidgin/pidgin.inc
@@ -44,7 +44,7 @@ FILES_finch-dbg = "${bindir}/.debug/finch \
FILES_${PN} = "${bindir} ${datadir}/${PN} ${libdir}/${PN}/*.so \
${datadir}/applications"
-RRECOMMENDS_${PN{ += "${PN}-data "
+RRECOMMENDS_${PN} += "${PN}-data "
FILES_${PN}-data = "${datadir}/pixmaps ${datadir}/sounds ${datadir}/icons"
FILES_${PN}-dev += "${libdir}/${PN}/*.la"
diff --git a/packages/qemu/qemu-0.9.1+svn/05_non-fatal_if_linux_hd_missing.patch b/packages/qemu/qemu-0.9.1+svn/05_non-fatal_if_linux_hd_missing.patch
new file mode 100644
index 0000000000..a66737d9ce
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/05_non-fatal_if_linux_hd_missing.patch
@@ -0,0 +1,17 @@
+#DPATCHLEVEL=1
+---
+# hw/pc.c | 1 -
+# 1 file changed, 1 deletion(-)
+#
+Index: trunk/hw/pc.c
+===================================================================
+--- trunk.orig/hw/pc.c 2008-04-24 20:15:46.000000000 +0100
++++ trunk/hw/pc.c 2008-04-24 20:15:49.000000000 +0100
+@@ -399,7 +399,6 @@
+ if (hda == -1) {
+ fprintf(stderr, "A disk image must be given for 'hda' when booting "
+ "a Linux kernel\n");
+- exit(1);
+ }
+
+ memset(bootsect, 0, sizeof(bootsect));
diff --git a/packages/qemu/qemu-0.9.1+svn/06_exit_segfault.patch b/packages/qemu/qemu-0.9.1+svn/06_exit_segfault.patch
new file mode 100644
index 0000000000..bc02d31839
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/06_exit_segfault.patch
@@ -0,0 +1,45 @@
+#DPATCHLEVEL=0
+---
+# linux-user/main.c | 8 ++++----
+# 1 file changed, 4 insertions(+), 4 deletions(-)
+#
+Index: linux-user/main.c
+===================================================================
+--- linux-user/main.c.orig 2008-04-24 20:15:46.000000000 +0100
++++ linux-user/main.c 2008-04-24 20:15:53.000000000 +0100
+@@ -765,7 +765,7 @@
+ default:
+ printf ("Unhandled trap: 0x%x\n", trapnr);
+ cpu_dump_state(env, stderr, fprintf, 0);
+- exit (1);
++ _exit (1);
+ }
+ process_pending_signals (env);
+ }
+@@ -1697,7 +1697,7 @@
+ default:
+ printf ("Unhandled trap: 0x%x\n", trapnr);
+ cpu_dump_state(env, stderr, fprintf, 0);
+- exit (1);
++ _exit (1);
+ }
+ process_pending_signals (env);
+ }
+@@ -2026,7 +2026,7 @@
+ for(item = cpu_log_items; item->mask != 0; item++) {
+ printf("%-10s %s\n", item->name, item->help);
+ }
+- exit(1);
++ _exit(1);
+ }
+ cpu_set_log(mask);
+ } else if (!strcmp(r, "s")) {
+@@ -2045,7 +2045,7 @@
+ if (qemu_host_page_size == 0 ||
+ (qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
+ fprintf(stderr, "page size must be a power of two\n");
+- exit(1);
++ _exit(1);
+ }
+ } else if (!strcmp(r, "g")) {
+ gdbstub_port = atoi(argv[optind++]);
diff --git a/packages/qemu/qemu-0.9.1+svn/10_signal_jobs.patch b/packages/qemu/qemu-0.9.1+svn/10_signal_jobs.patch
new file mode 100644
index 0000000000..d79482d2f4
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/10_signal_jobs.patch
@@ -0,0 +1,26 @@
+#DPATCHLEVEL=0
+---
+# linux-user/signal.c | 7 ++++++-
+# 1 file changed, 6 insertions(+), 1 deletion(-)
+#
+Index: linux-user/signal.c
+===================================================================
+--- linux-user/signal.c.orig 2008-04-24 20:15:46.000000000 +0100
++++ linux-user/signal.c 2008-04-24 20:15:55.000000000 +0100
+@@ -364,10 +364,15 @@
+ k = &sigact_table[sig - 1];
+ handler = k->sa._sa_handler;
+ if (handler == TARGET_SIG_DFL) {
++ if (sig == TARGET_SIGTSTP || sig == TARGET_SIGTTIN || sig == TARGET_SIGTTOU) {
++ kill(getpid(),SIGSTOP);
++ return 0;
++ } else
+ /* default handler : ignore some signal. The other are fatal */
+ if (sig != TARGET_SIGCHLD &&
+ sig != TARGET_SIGURG &&
+- sig != TARGET_SIGWINCH) {
++ sig != TARGET_SIGWINCH &&
++ sig != TARGET_SIGCONT) {
+ force_sig(sig);
+ } else {
+ return 0; /* indicate ignored */
diff --git a/packages/qemu/qemu-0.9.1+svn/11_signal_sigaction.patch b/packages/qemu/qemu-0.9.1+svn/11_signal_sigaction.patch
new file mode 100644
index 0000000000..cd56541b71
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/11_signal_sigaction.patch
@@ -0,0 +1,21 @@
+#DPATCHLEVEL=0
+---
+# linux-user/signal.c | 5 +++++
+# 1 file changed, 5 insertions(+)
+#
+Index: linux-user/signal.c
+===================================================================
+--- linux-user/signal.c.orig 2008-04-24 20:15:55.000000000 +0100
++++ linux-user/signal.c 2008-04-24 20:15:57.000000000 +0100
+@@ -512,6 +512,11 @@
+
+ if (sig < 1 || sig > TARGET_NSIG || sig == SIGKILL || sig == SIGSTOP)
+ return -EINVAL;
++
++ /* no point doing the stuff as those are not allowed for sigaction */
++ if ((sig == TARGET_SIGKILL) || (sig == TARGET_SIGSTOP))
++ return -EINVAL;
++
+ k = &sigact_table[sig - 1];
+ #if defined(DEBUG_SIGNAL)
+ fprintf(stderr, "sigaction sig=%d act=0x%08x, oact=0x%08x\n",
diff --git a/packages/qemu/qemu-0.9.1+svn/22_net_tuntap_stall.patch b/packages/qemu/qemu-0.9.1+svn/22_net_tuntap_stall.patch
new file mode 100644
index 0000000000..0e1038983b
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/22_net_tuntap_stall.patch
@@ -0,0 +1,18 @@
+#DPATCHLEVEL=0
+---
+# vl.c | 2 +-
+# 1 file changed, 1 insertion(+), 1 deletion(-)
+#
+Index: vl.c
+===================================================================
+--- vl.c.orig 2008-04-24 20:15:46.000000000 +0100
++++ vl.c 2008-04-24 20:15:58.000000000 +0100
+@@ -4155,7 +4155,7 @@
+ return -1;
+ }
+ memset(&ifr, 0, sizeof(ifr));
+- ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
++ ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE;
+ if (ifname[0] != '\0')
+ pstrcpy(ifr.ifr_name, IFNAMSIZ, ifname);
+ else
diff --git a/packages/qemu/qemu-0.9.1+svn/31_syscalls.patch b/packages/qemu/qemu-0.9.1+svn/31_syscalls.patch
new file mode 100644
index 0000000000..15565ae11d
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/31_syscalls.patch
@@ -0,0 +1,48 @@
+#DPATCHLEVEL=0
+---
+# linux-user/syscall.c | 11 ++++++++---
+# 1 file changed, 8 insertions(+), 3 deletions(-)
+#
+Index: linux-user/syscall.c
+===================================================================
+--- linux-user/syscall.c.orig 2008-04-24 20:15:46.000000000 +0100
++++ linux-user/syscall.c 2008-04-24 20:15:59.000000000 +0100
+@@ -250,6 +250,7 @@
+ extern int setresgid(gid_t, gid_t, gid_t);
+ extern int getresgid(gid_t *, gid_t *, gid_t *);
+ extern int setgroups(int, gid_t *);
++extern int uselib(const char*);
+
+ #define ERRNO_TABLE_SIZE 1200
+
+@@ -4041,7 +4042,8 @@
+ #endif
+ #ifdef TARGET_NR_uselib
+ case TARGET_NR_uselib:
+- goto unimplemented;
++ ret = get_errno(uselib(path((const char*)arg1)));
++ break;
+ #endif
+ #ifdef TARGET_NR_swapon
+ case TARGET_NR_swapon:
+@@ -5322,7 +5324,9 @@
+ goto unimplemented;
+ #ifdef TARGET_NR_mincore
+ case TARGET_NR_mincore:
+- goto unimplemented;
++ /*page_unprotect_range((void*)arg3, ((size_t)arg2 + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE);*/
++ ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)arg3));
++ break;
+ #endif
+ #ifdef TARGET_NR_madvise
+ case TARGET_NR_madvise:
+@@ -5462,7 +5466,8 @@
+ break;
+ #ifdef TARGET_NR_readahead
+ case TARGET_NR_readahead:
+- goto unimplemented;
++ ret = get_errno(readahead((int)arg1, (off64_t)arg2, (size_t)arg3));
++ break;
+ #endif
+ #ifdef TARGET_NR_setxattr
+ case TARGET_NR_setxattr:
diff --git a/packages/qemu/qemu-0.9.1+svn/32_syscall_sysctl.patch b/packages/qemu/qemu-0.9.1+svn/32_syscall_sysctl.patch
new file mode 100644
index 0000000000..d42c44cebc
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/32_syscall_sysctl.patch
@@ -0,0 +1,55 @@
+#DPATCHLEVEL=0
+---
+# linux-user/syscall.c | 32 +++++++++++++++++++++++++++++---
+# 1 file changed, 29 insertions(+), 3 deletions(-)
+#
+Index: linux-user/syscall.c
+===================================================================
+--- linux-user/syscall.c.orig 2008-04-24 20:15:59.000000000 +0100
++++ linux-user/syscall.c 2008-04-24 20:16:01.000000000 +0100
+@@ -52,6 +52,7 @@
+ //#include <sys/user.h>
+ #include <netinet/ip.h>
+ #include <netinet/tcp.h>
++#include <sys/sysctl.h>
+
+ #define termios host_termios
+ #define winsize host_winsize
+@@ -4758,9 +4759,34 @@
+ break;
+ #endif
+ case TARGET_NR__sysctl:
+- /* We don't implement this, but ENOTDIR is always a safe
+- return value. */
+- ret = -TARGET_ENOTDIR;
++ {
++ struct __sysctl_args *args = (struct __sysctl_args *) arg1;
++ int *name_target, *name, nlen, *oldlenp, oldlen, newlen, i;
++ void *oldval, *newval;
++
++ name_target = (int *) tswapl((long) args->name);
++ nlen = tswapl(args->nlen);
++ oldval = (void *) tswapl((long) args->oldval);
++ oldlenp = (int *) tswapl((long) args->oldlenp);
++ oldlen = tswapl(*oldlenp);
++ newval = (void *) tswapl((long) args->newval);
++ newlen = tswapl(args->newlen);
++
++ name = alloca(nlen * sizeof (int));
++ for (i = 0; i < nlen; i++)
++ name[i] = tswapl(name_target[i]);
++
++ if (nlen == 2 && name[0] == CTL_KERN && name[1] == KERN_VERSION) {
++ ret = get_errno(
++ sysctl(name, nlen, oldval, &oldlen, newval, newlen));
++ if (!is_error(ret)) {
++ *oldlenp = tswapl(oldlen);
++ }
++ } else {
++ gemu_log("qemu: Unsupported sysctl name\n");
++ ret = -ENOSYS;
++ }
++ }
+ break;
+ case TARGET_NR_sched_setparam:
+ {
diff --git a/packages/qemu/qemu-0.9.1+svn/33_syscall_ppc_clone.patch b/packages/qemu/qemu-0.9.1+svn/33_syscall_ppc_clone.patch
new file mode 100644
index 0000000000..962f821523
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/33_syscall_ppc_clone.patch
@@ -0,0 +1,22 @@
+#DPATCHLEVEL=0
+---
+# linux-user/syscall.c | 6 +-----
+# 1 file changed, 1 insertion(+), 5 deletions(-)
+#
+Index: linux-user/syscall.c
+===================================================================
+--- linux-user/syscall.c.orig 2008-04-24 20:16:01.000000000 +0100
++++ linux-user/syscall.c 2008-04-24 20:16:02.000000000 +0100
+@@ -2760,11 +2760,7 @@
+ if (!newsp)
+ newsp = env->gpr[1];
+ new_env->gpr[1] = newsp;
+- {
+- int i;
+- for (i = 7; i < 32; i++)
+- new_env->gpr[i] = 0;
+- }
++ new_env->gpr[3] = 0;
+ #elif defined(TARGET_SH4)
+ if (!newsp)
+ newsp = env->gregs[15];
diff --git a/packages/qemu/qemu-0.9.1+svn/39_syscall_fadvise64.patch b/packages/qemu/qemu-0.9.1+svn/39_syscall_fadvise64.patch
new file mode 100644
index 0000000000..845232cfca
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/39_syscall_fadvise64.patch
@@ -0,0 +1,21 @@
+---
+ linux-user/syscall.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: linux-user/syscall.c
+===================================================================
+--- linux-user/syscall.c.orig 2008-04-24 20:16:02.000000000 +0100
++++ linux-user/syscall.c 2008-04-24 20:16:03.000000000 +0100
+@@ -5350,6 +5350,12 @@
+ ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)arg3));
+ break;
+ #endif
++#ifdef TARGET_NR_fadvise64_64
++ case TARGET_NR_fadvise64_64:
++ /* Just return success */
++ ret = get_errno(0);
++ break;
++#endif
+ #ifdef TARGET_NR_madvise
+ case TARGET_NR_madvise:
+ /* A straight passthrough may not be safe because qemu sometimes
diff --git a/packages/qemu/qemu-0.9.1+svn/52_ne2000_return.patch b/packages/qemu/qemu-0.9.1+svn/52_ne2000_return.patch
new file mode 100644
index 0000000000..e364bff731
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/52_ne2000_return.patch
@@ -0,0 +1,17 @@
+---
+ hw/ne2000.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: trunk/hw/ne2000.c
+===================================================================
+--- trunk.orig/hw/ne2000.c 2008-04-24 20:15:46.000000000 +0100
++++ trunk/hw/ne2000.c 2008-04-24 20:16:05.000000000 +0100
+@@ -217,7 +217,7 @@
+ NE2000State *s = opaque;
+
+ if (s->cmd & E8390_STOP)
+- return 1;
++ return 0;
+ return !ne2000_buffer_full(s);
+ }
+
diff --git a/packages/qemu/qemu-0.9.1+svn/61_safe_64bit_int.patch b/packages/qemu/qemu-0.9.1+svn/61_safe_64bit_int.patch
new file mode 100644
index 0000000000..9a67feac6b
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/61_safe_64bit_int.patch
@@ -0,0 +1,27 @@
+#DPATCHLEVEL=0
+---
+# dyngen-exec.h | 4 ++--
+# 1 file changed, 2 insertions(+), 2 deletions(-)
+#
+Index: dyngen-exec.h
+===================================================================
+--- dyngen-exec.h.orig 2008-04-24 20:15:46.000000000 +0100
++++ dyngen-exec.h 2008-04-24 20:16:06.000000000 +0100
+@@ -38,7 +38,7 @@
+ // Linux/Sparc64 defines uint64_t
+ #if !(defined (__sparc_v9__) && defined(__linux__))
+ /* XXX may be done for all 64 bits targets ? */
+-#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__)
++#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__sparc__)
+ typedef unsigned long uint64_t;
+ #else
+ typedef unsigned long long uint64_t;
+@@ -55,7 +55,7 @@
+ typedef signed int int32_t;
+ // Linux/Sparc64 defines int64_t
+ #if !(defined (__sparc_v9__) && defined(__linux__))
+-#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__)
++#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__sparc__)
+ typedef signed long int64_t;
+ #else
+ typedef signed long long int64_t;
diff --git a/packages/qemu/qemu-0.9.1+svn/63_sparc_build.patch b/packages/qemu/qemu-0.9.1+svn/63_sparc_build.patch
new file mode 100644
index 0000000000..097f55a09e
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/63_sparc_build.patch
@@ -0,0 +1,18 @@
+#DPATCHLEVEL=0
+---
+# sparc.ld | 2 +-
+# 1 file changed, 1 insertion(+), 1 deletion(-)
+#
+Index: sparc.ld
+===================================================================
+--- sparc.ld.orig 2008-04-24 20:15:46.000000000 +0100
++++ sparc.ld 2008-04-24 20:16:07.000000000 +0100
+@@ -6,7 +6,7 @@
+ SECTIONS
+ {
+ /* Read-only sections, merged into text segment: */
+- . = 0x60000000 + SIZEOF_HEADERS;
++ . = 0x60000000 + 0x400;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
diff --git a/packages/qemu/qemu-0.9.1+svn/64_ppc_asm_constraints.patch b/packages/qemu/qemu-0.9.1+svn/64_ppc_asm_constraints.patch
new file mode 100644
index 0000000000..7d19817278
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/64_ppc_asm_constraints.patch
@@ -0,0 +1,18 @@
+#DPATCHLEVEL=1
+---
+# cpu-all.h | 2 +-
+# 1 file changed, 1 insertion(+), 1 deletion(-)
+#
+Index: trunk/cpu-all.h
+===================================================================
+--- trunk.orig/cpu-all.h 2008-04-24 20:15:46.000000000 +0100
++++ trunk/cpu-all.h 2008-04-24 20:16:08.000000000 +0100
+@@ -285,7 +285,7 @@
+ static inline void stl_le_p(void *ptr, int v)
+ {
+ #ifdef __powerpc__
+- __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr));
++ __asm__ __volatile__ ("stwbrx %0,0,%1" : : "r" (v), "r" (ptr) : "memory");
+ #else
+ uint8_t *p = ptr;
+ p[0] = v;
diff --git a/packages/qemu/qemu-0.9.1+svn/65_kfreebsd.patch b/packages/qemu/qemu-0.9.1+svn/65_kfreebsd.patch
new file mode 100644
index 0000000000..028e85a878
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/65_kfreebsd.patch
@@ -0,0 +1,35 @@
+---
+ configure | 6 ++++++
+ vl.c | 2 ++
+ 2 files changed, 8 insertions(+)
+
+Index: configure
+===================================================================
+--- configure.orig 2008-04-24 20:15:46.000000000 +0100
++++ configure 2008-04-24 20:16:09.000000000 +0100
+@@ -135,6 +135,12 @@
+ kqemu="yes"
+ fi
+ ;;
++GNU/kFreeBSD)
++oss="yes"
++if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
++ kqemu="yes"
++fi
++;;
+ FreeBSD)
+ bsd="yes"
+ oss="yes"
+Index: vl.c
+===================================================================
+--- vl.c.orig 2008-04-24 20:15:58.000000000 +0100
++++ vl.c 2008-04-24 20:16:09.000000000 +0100
+@@ -97,6 +97,8 @@
+ #include <stropts.h>
+ #endif
+ #endif
++#elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
++#include <freebsd/stdlib.h>
+ #else
+ #include <winsock2.h>
+ int inet_aton(const char *cp, struct in_addr *ia);
diff --git a/packages/qemu/qemu-0.9.1+svn/66_tls_ld.patch b/packages/qemu/qemu-0.9.1+svn/66_tls_ld.patch
new file mode 100644
index 0000000000..cbd3f873d8
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/66_tls_ld.patch
@@ -0,0 +1,55 @@
+---
+ arm.ld | 7 +++++++
+ i386.ld | 7 +++++++
+ 2 files changed, 14 insertions(+)
+
+Index: arm.ld
+===================================================================
+--- arm.ld.orig 2008-04-24 20:15:45.000000000 +0100
++++ arm.ld 2008-04-24 20:16:11.000000000 +0100
+@@ -26,6 +26,10 @@
+ { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
+ .rela.rodata :
+ { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
++ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
++ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
++ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
++ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+@@ -58,6 +62,9 @@
+ .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
+ __exidx_end = .;
+ .reginfo : { *(.reginfo) }
++ /* Thread Local Storage sections */
++ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
++ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN(0x100000) + (. & (0x100000 - 1));
+Index: i386.ld
+===================================================================
+--- i386.ld.orig 2008-04-24 20:15:45.000000000 +0100
++++ i386.ld 2008-04-24 20:16:11.000000000 +0100
+@@ -28,6 +28,10 @@
+ { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
+ .rela.rodata :
+ { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
++ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
++ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
++ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
++ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+@@ -53,6 +57,9 @@
+ _etext = .;
+ PROVIDE (etext = .);
+ .fini : { *(.fini) } =0x47ff041f
++ /* Thread Local Storage sections */
++ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
++ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ . = ALIGN(32 / 8);
+ PROVIDE (__preinit_array_start = .);
+ .preinit_array : { *(.preinit_array) }
diff --git a/packages/qemu/qemu-0.9.1+svn/91-oh-sdl-cursor.patch b/packages/qemu/qemu-0.9.1+svn/91-oh-sdl-cursor.patch
new file mode 100644
index 0000000000..b3d95a4534
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/91-oh-sdl-cursor.patch
@@ -0,0 +1,18 @@
+=== modified file 'sdl.c'
+---
+ sdl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: sdl.c
+===================================================================
+--- sdl.c.orig 2008-04-24 20:15:45.000000000 +0100
++++ sdl.c 2008-04-24 20:16:12.000000000 +0100
+@@ -247,7 +247,7 @@
+
+ if (kbd_mouse_is_absolute()) {
+ SDL_ShowCursor(1);
+- SDL_SetCursor(sdl_cursor_hidden);
++ /* SDL_SetCursor(sdl_cursor_hidden); */
+ } else {
+ SDL_ShowCursor(0);
+ }
diff --git a/packages/qemu/qemu-0.9.1+svn/configure_symlinkpath_fix.patch b/packages/qemu/qemu-0.9.1+svn/configure_symlinkpath_fix.patch
new file mode 100644
index 0000000000..3ec304a38c
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/configure_symlinkpath_fix.patch
@@ -0,0 +1,28 @@
+Index: qemu-0.9.1/configure
+===================================================================
+--- qemu-0.9.1.orig/configure 2008-01-24 15:33:13.000000000 +0000
++++ qemu-0.9.1/configure 2008-01-24 15:45:50.000000000 +0000
+@@ -209,15 +209,17 @@
+
+ # find source path
+ source_path=`dirname "$0"`
++source_path_used="no"
++workdir=`pwd`
++workdir=`readlink -f $workdir`
+ if [ -z "$source_path" ]; then
+- source_path=`pwd`
++ source_path=$workdir
+ else
+ source_path=`cd "$source_path"; pwd`
+-fi
+-if test "$source_path" = `pwd` ; then
+- source_path_used="no"
+-else
+- source_path_used="yes"
++ source_path=`readlink -f $source_path`
++ if test "$source_path" != "$workdir" ; then
++ source_path_used="yes"
++ fi
+ fi
+
+ werror="no"
diff --git a/packages/qemu/qemu-0.9.1+svn/fix_brk.patch b/packages/qemu/qemu-0.9.1+svn/fix_brk.patch
new file mode 100644
index 0000000000..f15e001dd6
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/fix_brk.patch
@@ -0,0 +1,59 @@
+Index: trunk/linux-user/syscall.c
+===================================================================
+--- trunk.orig/linux-user/syscall.c 2008-04-24 20:16:24.000000000 +0100
++++ trunk/linux-user/syscall.c 2008-04-24 20:16:32.000000000 +0100
+@@ -440,7 +440,7 @@
+ if (!new_brk)
+ return target_brk;
+ if (new_brk < target_original_brk)
+- return -TARGET_ENOMEM;
++ return target_brk;
+
+ brk_page = HOST_PAGE_ALIGN(target_brk);
+
+@@ -455,12 +455,11 @@
+ mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size,
+ PROT_READ|PROT_WRITE,
+ MAP_ANON|MAP_FIXED|MAP_PRIVATE, 0, 0));
+- if (is_error(mapped_addr)) {
+- return mapped_addr;
+- } else {
++
++ if (!is_error(mapped_addr))
+ target_brk = new_brk;
+- return target_brk;
+- }
++
++ return target_brk;
+ }
+
+ static inline abi_long copy_from_user_fdset(fd_set *fds,
+Index: trunk/linux-user/mmap.c
+===================================================================
+--- trunk.orig/linux-user/mmap.c 2008-04-24 20:16:16.000000000 +0100
++++ trunk/linux-user/mmap.c 2008-04-24 20:16:32.000000000 +0100
+@@ -264,6 +264,9 @@
+ host_start += offset - host_offset;
+ start = h2g(host_start);
+ } else {
++ int flg;
++ target_ulong addr;
++
+ if (start & ~TARGET_PAGE_MASK) {
+ errno = EINVAL;
+ return -1;
+@@ -271,6 +274,14 @@
+ end = start + len;
+ real_end = HOST_PAGE_ALIGN(end);
+
++ for(addr = real_start; addr < real_end; addr += TARGET_PAGE_SIZE) {
++ flg = page_get_flags(addr);
++ if( flg & PAGE_RESERVED ) {
++ errno = ENXIO;
++ return -1;
++ }
++ }
++
+ /* worst case: we cannot map the file because the offset is not
+ aligned, so we read it */
+ if (!(flags & MAP_ANONYMOUS) &&
diff --git a/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch b/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch
new file mode 100644
index 0000000000..ee2b077602
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/fix_protection_bits.patch
@@ -0,0 +1,14 @@
+Index: qemu-0.9.1/linux-user/mmap.c
+===================================================================
+--- qemu-0.9.1.orig/linux-user/mmap.c 2008-04-16 14:10:26.000000000 +0100
++++ qemu-0.9.1/linux-user/mmap.c 2008-04-16 14:10:51.000000000 +0100
+@@ -49,8 +49,7 @@
+ end = start + len;
+ if (end < start)
+ return -EINVAL;
+- if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC))
+- return -EINVAL;
++ prot = prot & (PROT_READ | PROT_WRITE | PROT_EXEC);
+ if (len == 0)
+ return 0;
+
diff --git a/packages/qemu/qemu-0.9.1+svn/fix_segfault.patch b/packages/qemu/qemu-0.9.1+svn/fix_segfault.patch
new file mode 100644
index 0000000000..224a8b813d
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/fix_segfault.patch
@@ -0,0 +1,37 @@
+---
+ linux-user/syscall.c | 22 ----------------------
+ 1 file changed, 22 deletions(-)
+
+Index: trunk/linux-user/syscall.c
+===================================================================
+--- trunk.orig/linux-user/syscall.c 2008-04-24 20:16:21.000000000 +0100
++++ trunk/linux-user/syscall.c 2008-04-24 20:16:24.000000000 +0100
+@@ -5728,28 +5728,6 @@
+ goto unimplemented_nowarn;
+ #endif
+
+-#ifdef TARGET_NR_clock_gettime
+- case TARGET_NR_clock_gettime:
+- {
+- struct timespec ts;
+- ret = get_errno(clock_gettime(arg1, &ts));
+- if (!is_error(ret)) {
+- host_to_target_timespec(arg2, &ts);
+- }
+- break;
+- }
+-#endif
+-#ifdef TARGET_NR_clock_getres
+- case TARGET_NR_clock_getres:
+- {
+- struct timespec ts;
+- ret = get_errno(clock_getres(arg1, &ts));
+- if (!is_error(ret)) {
+- host_to_target_timespec(arg2, &ts);
+- }
+- break;
+- }
+-#endif
+
+ #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
+ case TARGET_NR_set_tid_address:
diff --git a/packages/qemu/qemu-0.9.1+svn/no-strip.patch b/packages/qemu/qemu-0.9.1+svn/no-strip.patch
new file mode 100644
index 0000000000..4813dd4e2b
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/no-strip.patch
@@ -0,0 +1,26 @@
+Index: trunk/Makefile
+===================================================================
+--- trunk.orig/Makefile 2008-04-24 20:15:37.000000000 +0100
++++ trunk/Makefile 2008-04-24 20:16:30.000000000 +0100
+@@ -196,7 +196,7 @@
+ install: all $(if $(BUILD_DOCS),install-doc)
+ mkdir -p "$(DESTDIR)$(bindir)"
+ ifneq ($(TOOLS),)
+- $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
++ $(INSTALL) -m 755 $(TOOLS) "$(DESTDIR)$(bindir)"
+ endif
+ mkdir -p "$(DESTDIR)$(datadir)"
+ set -e; for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
+Index: trunk/Makefile.target
+===================================================================
+--- trunk.orig/Makefile.target 2008-04-24 20:15:37.000000000 +0100
++++ trunk/Makefile.target 2008-04-24 20:16:30.000000000 +0100
+@@ -685,7 +685,7 @@
+
+ install: all
+ ifneq ($(PROGS),)
+- $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
++ $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
+ endif
+
+ # Include automatically generated dependency files
diff --git a/packages/qemu/qemu-0.9.1+svn/qemu-0.9.0-nptl.patch b/packages/qemu/qemu-0.9.1+svn/qemu-0.9.0-nptl.patch
new file mode 100644
index 0000000000..ac68ebf460
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/qemu-0.9.0-nptl.patch
@@ -0,0 +1,1100 @@
+---
+ configure | 25 ++++++
+ exec-all.h | 165 ------------------------------------------
+ linux-user/arm/syscall.h | 4 -
+ linux-user/main.c | 94 +++++++++++++++++++++---
+ linux-user/qemu.h | 3
+ linux-user/syscall.c | 91 ++++++++++++++++++++++-
+ qemu_spinlock.h | 181 +++++++++++++++++++++++++++++++++++++++++++++++
+ target-arm/cpu.h | 10 ++
+ target-arm/op.c | 6 +
+ target-arm/translate.c | 9 ++
+ 10 files changed, 405 insertions(+), 183 deletions(-)
+
+Index: trunk/configure
+===================================================================
+--- trunk.orig/configure 2008-04-24 20:16:52.000000000 +0100
++++ trunk/configure 2008-04-24 20:16:53.000000000 +0100
+@@ -112,6 +112,7 @@
+ build_docs="no"
+ uname_release=""
+ curses="yes"
++nptl="yes"
+
+ # OS specific
+ targetos=`uname -s`
+@@ -339,6 +340,8 @@
+ ;;
+ *) echo "ERROR: unknown option $opt"; show_help="yes"
+ ;;
++ --disable-nptl) nptl="no"
++ ;;
+ esac
+ done
+
+@@ -436,6 +439,7 @@
+ echo " --disable-linux-user disable all linux usermode emulation targets"
+ echo " --enable-darwin-user enable all darwin usermode emulation targets"
+ echo " --disable-darwin-user disable all darwin usermode emulation targets"
++echo " --disable-nptl disable usermode NPTL guest support"
+ echo " --fmod-lib path to FMOD library"
+ echo " --fmod-inc path to FMOD includes"
+ echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
+@@ -647,6 +651,23 @@
+ }
+ EOF
+
++# check NPTL support
++cat > $TMPC <<EOF
++#include <sched.h>
++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
+
+@@ -845,6 +866,7 @@
+ echo "Documentation $build_docs"
+ [ ! -z "$uname_release" ] && \
+ echo "uname -r $uname_release"
++echo "NPTL support $nptl"
+
+ if test $sdl_too_old = "yes"; then
+ echo "-> Your SDL version is too old - please upgrade to have SDL support"
+@@ -1228,6 +1250,9 @@
+ echo "#define TARGET_ARM 1" >> $config_h
+ echo "#define CONFIG_NO_DYNGEN_OP 1" >> $config_h
+ bflt="yes"
++ if test "$nptl" = "yes" ; then
++ echo "#define USE_NPTL 1" >> $config_h
++ fi
+ ;;
+ cris)
+ echo "TARGET_ARCH=cris" >> $config_mak
+Index: trunk/exec-all.h
+===================================================================
+--- trunk.orig/exec-all.h 2008-04-24 20:16:41.000000000 +0100
++++ trunk/exec-all.h 2008-04-24 20:16:53.000000000 +0100
+@@ -303,217 +303,7 @@
+ extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];
+ extern void *io_mem_opaque[IO_MEM_NB_ENTRIES];
+
+-#if defined(__hppa__)
+-
+-typedef int spinlock_t[4];
+-
+-#define SPIN_LOCK_UNLOCKED { 1, 1, 1, 1 }
+-
+-static inline void resetlock (spinlock_t *p)
+-{
+- (*p)[0] = (*p)[1] = (*p)[2] = (*p)[3] = 1;
+-}
+-
+-#else
+-
+-typedef int spinlock_t;
+-
+-#define SPIN_LOCK_UNLOCKED 0
+-
+-static inline void resetlock (spinlock_t *p)
+-{
+- *p = SPIN_LOCK_UNLOCKED;
+-}
+-
+-#endif
+-
+-#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(__hppa__)
+-
+-/* Because malloc only guarantees 8-byte alignment for malloc'd data,
+- and GCC only guarantees 8-byte alignment for stack locals, we can't
+- be assured of 16-byte alignment for atomic lock data even if we
+- specify "__attribute ((aligned(16)))" in the type declaration. So,
+- we use a struct containing an array of four ints for the atomic lock
+- type and dynamically select the 16-byte aligned int from the array
+- for the semaphore. */
+-#define __PA_LDCW_ALIGNMENT 16
+-static inline void *ldcw_align (void *p) {
+- unsigned long a = (unsigned long)p;
+- a = (a + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1);
+- return (void *)a;
+-}
+-
+-static inline int testandset (spinlock_t *p)
+-{
+- unsigned int ret;
+- p = ldcw_align(p);
+- __asm__ __volatile__("ldcw 0(%1),%0"
+- : "=r" (ret)
+- : "r" (p)
+- : "memory" );
+- return !ret;
+-}
+-
+-#elif defined(__ia64)
+-
+-#include <ia64intrin.h>
+-
+-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
+-
+-#if defined(CONFIG_USER_ONLY)
+-static inline void spin_lock(spinlock_t *lock)
+-{
+- while (testandset(lock));
+-}
+-
+-static inline void spin_unlock(spinlock_t *lock)
+-{
+- resetlock(lock);
+-}
+-
+-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;
+
+Index: trunk/linux-user/arm/syscall.h
+===================================================================
+--- trunk.orig/linux-user/arm/syscall.h 2008-04-24 20:16:41.000000000 +0100
++++ trunk/linux-user/arm/syscall.h 2008-04-24 20:16:53.000000000 +0100
+@@ -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
+Index: trunk/linux-user/main.c
+===================================================================
+--- trunk.orig/linux-user/main.c 2008-04-24 20:16:47.000000000 +0100
++++ trunk/linux-user/main.c 2008-04-24 20:17:38.000000000 +0100
+@@ -365,6 +365,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_tls2;
++ 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;
+@@ -475,10 +519,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)) {
+@@ -489,14 +531,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;
+ }
+@@ -535,6 +597,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",
+@@ -1994,6 +2060,11 @@
+ int drop_ld_preload = 0, environ_count = 0;
+ char **target_environ, **wrk, **dst;
+
++ char *assume_kernel = getenv("QEMU_ASSUME_KERNEL");
++
++ if (assume_kernel)
++ setenv("LD_ASSUME_KERNEL", assume_kernel, 1);
++
+ if (argc <= 1)
+ usage();
+
+@@ -2403,6 +2474,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) {
+Index: trunk/linux-user/qemu.h
+===================================================================
+--- trunk.orig/linux-user/qemu.h 2008-04-24 20:16:41.000000000 +0100
++++ trunk/linux-user/qemu.h 2008-04-24 20:16:53.000000000 +0100
+@@ -107,6 +107,9 @@
+ uint32_t heap_base;
+ uint32_t heap_limit;
+ #endif
++#ifdef USE_NPTL
++ uint32_t *child_tidptr;
++#endif
+ int used; /* non zero if used */
+ struct image_info *info;
+ uint8_t stack[0];
+Index: trunk/linux-user/syscall.c
+===================================================================
+--- trunk.orig/linux-user/syscall.c 2008-04-24 20:16:50.000000000 +0100
++++ trunk/linux-user/syscall.c 2008-04-24 20:19:52.000000000 +0100
+@@ -61,6 +61,7 @@
+ #define tchars host_tchars /* same as target */
+ #define ltchars host_ltchars /* same as target */
+
++#include <linux/futex.h>
+ #include <linux/termios.h>
+ #include <linux/unistd.h>
+ #include <linux/utsname.h>
+@@ -71,9 +72,18 @@
+ #include <linux/kd.h>
+
+ #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) || defined(TARGET_CRIS)
+ /* 16 bit uid wrappers emulation */
+@@ -2695,16 +2705,25 @@
+ return 0;
+ }
+ #endif
+-
+ #endif /* defined(TARGET_I386) */
+
+ /* this stack is the equivalent of the kernel stack associated with a
+ 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;
+@@ -2712,15 +2731,27 @@
+
+ /* do_fork() Must return host values and target errnos (unlike most
+ do_*() functions). */
+-int do_fork(CPUState *env, unsigned int flags, abi_ulong 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;
++#if defined(TARGET_I386)
++ uint64_t *new_gdt_table;
++#endif
++#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);
++ if (!ts)
++ return -ENOMEM;
+ memset(ts, 0, sizeof(TaskState));
+ new_stack = ts->stack;
+ ts->used = 1;
+@@ -2732,6 +2763,29 @@
+ #if defined(TARGET_I386)
+ if (!newsp)
+ newsp = env->regs[R_ESP];
++ new_gdt_table = malloc(9 * 8);
++ if (!new_gdt_table) {
++ free(new_env);
++ return -ENOMEM;
++ }
++ /* Copy main GDT table from parent, but clear TLS entries */
++ memcpy(new_gdt_table, g2h(env->gdt.base), 6 * 8);
++ memset(&new_gdt_table[6], 0, 3 * 8);
++ new_env->gdt.base = h2g(new_gdt_table);
++ if (flags & 0x00080000 /* CLONE_SETTLS */) {
++ ret = do_set_thread_area(new_env, new_env->regs[R_ESI]);
++ if (ret) {
++ free(new_gdt_table);
++ free(new_env);
++ return ret;
++ }
++ }
++ cpu_x86_load_seg(env, R_CS, new_env->regs[R_CS]);
++ cpu_x86_load_seg(env, R_DS, new_env->regs[R_DS]);
++ cpu_x86_load_seg(env, R_ES, new_env->regs[R_ES]);
++ cpu_x86_load_seg(env, R_SS, new_env->regs[R_SS]);
++ cpu_x86_load_seg(env, R_FS, new_env->regs[R_FS]);
++ cpu_x86_load_seg(env, R_GS, new_env->regs[R_GS]);
+ new_env->regs[R_ESP] = newsp;
+ new_env->regs[R_EAX] = 0;
+ #elif defined(TARGET_ARM)
+@@ -2784,16 +2838,67 @@
+ #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
++
++ if (CLONE_VFORK & flags)
++ flags ^= CLONE_VM;
+ #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)
++ 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;
+ }
+@@ -3052,6 +3157,68 @@
+ unlock_user_struct(target_ts, target_addr, 1);
+ }
+
++static long do_futex(target_ulong uaddr, int op, uint32_t val,
++ target_ulong utime, target_ulong uaddr2,
++ uint32_t val3)
++{
++ struct timespec host_utime;
++ unsigned long val2 = utime;
++
++ if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) {
++ target_to_host_timespec(&host_utime, utime);
++ val2 = (unsigned long)&host_utime;
++ }
++
++#ifdef BSWAP_NEEDED
++ switch(op) {
++ case FUTEX_CMP_REQUEUE:
++ val3 = tswap32(val3);
++ case FUTEX_REQUEUE:
++ val2 = tswap32(val2);
++ case FUTEX_WAIT:
++ case FUTEX_WAKE:
++ val = tswap32(val);
++ case FUTEX_LOCK_PI: /* This one's icky, but comes out OK */
++ case FUTEX_UNLOCK_PI:
++ break;
++ default:
++ gemu_log("qemu: Unsupported futex op %d\n", op);
++ return -ENOSYS;
++ }
++#if 0 /* No, it's worse than this */
++ if (op == FUTEX_WAKE_OP) {
++ /* Need to munge the secondary operation (val3) */
++ val3 = tswap32(val3);
++ int op2 = (val3 >> 28) & 7;
++ int cmp = (val3 >> 24) & 15;
++ int oparg = (val3 << 8) >> 20;
++ int cmparg = (val3 << 20) >> 20;
++ int shift = val3 & (FUTEX_OP_OPARG_SHIFT << 28);
++
++ if (shift)
++ oparg = (oparg & 7) + 24 - (oparg & 24);
++ else oparg =
++ if (op2 == FUTEX_OP_ADD) {
++ gemu_log("qemu: Unsupported wrong-endian FUTEX_OP_ADD\n");
++ return -ENOSYS;
++ }
++ if (cmparg == FUTEX_OP_CMP_LT || cmparg == FUTEX_OP_CMP_GE ||
++ cmparg == FUTEX_OP_CMP_LE || cmparg == FUTEX_OP_CMP_GT) {
++ gemu_log("qemu: Unsupported wrong-endian futex cmparg %d\n", cmparg);
++ return -ENOSYS;
++ }
++ val3 = shift | (op2<<28) | (cmp<<24) | (oparg<<12) | cmparg;
++ }
++#endif
++#endif
++ return syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
++}
++
++int do_set_tid_address(target_ulong tidptr)
++{
++ return syscall(__NR_set_tid_address, g2h(tidptr));
++}
++
+ /* do_syscall() should always have a single exit point at the end so
+ that actions, such as logging of syscall results, can be performed.
+ All errnos that do_syscall() returns must be -TARGET_<errcode>. */
+@@ -3076,7 +3243,7 @@
+ _mcleanup();
+ #endif
+ gdb_exit(cpu_env, arg1);
+- /* XXX: should free thread stack and CPU env */
++ /* XXX: should free thread stack, GDT and CPU env */
+ _exit(arg1);
+ ret = 0; /* avoid warning */
+ break;
+@@ -3118,7 +3285,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:
+@@ -4482,7 +4649,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 */
+@@ -4943,7 +5111,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
+@@ -5521,6 +5690,9 @@
+ #elif defined(TARGET_I386) && defined(TARGET_ABI32)
+ ret = do_set_thread_area(cpu_env, arg1);
+ break;
++#elif TARGET_i386
++ ret = get_errno(do_set_thread_area(cpu_env, arg1));
++ break;
+ #else
+ goto unimplemented_nowarn;
+ #endif
+@@ -5538,6 +5710,12 @@
+ goto unimplemented_nowarn;
+ #endif
+
++#ifdef TARGET_NR_futex
++ case TARGET_NR_futex:
++ ret = get_errno(do_futex(arg1, arg2, arg3, arg4, arg5, arg6));
++ break;
++#endif
++
+ #ifdef TARGET_NR_clock_gettime
+ case TARGET_NR_clock_gettime:
+ {
+Index: trunk/qemu_spinlock.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ trunk/qemu_spinlock.h 2008-04-24 20:16:53.000000000 +0100
+@@ -0,0 +1,250 @@
++/*
++ * Atomic operation helper include
++ *
++ * Copyright (c) 2005 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)
++ : "cc");
++ return readval;
++}
++#endif
++
++#ifdef __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;
++}
++#endif
++
++#ifdef __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;
++}
++#endif
++
++#ifdef __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;
++}
++#endif
++
++#ifdef __sparc__
++static inline int testandset (int *p)
++{
++ int ret;
++
++ __asm__ __volatile__("ldstub [%1], %0"
++ : "=r" (ret)
++ : "r" (p)
++ : "memory");
++
++ return (ret ? 1 : 0);
++}
++#endif
++
++#ifdef __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;
++}
++#endif
++
++#ifdef __mc68000
++static inline int testandset (int *p)
++{
++ char ret;
++ __asm__ __volatile__("tas %1; sne %0"
++ : "=r" (ret)
++ : "m" (p)
++ : "cc","memory");
++ return ret;
++}
++#endif
++
++#ifdef __hppa__
++/* Because malloc only guarantees 8-byte alignment for malloc'd data,
++ and GCC only guarantees 8-byte alignment for stack locals, we can't
++ be assured of 16-byte alignment for atomic lock data even if we
++ specify "__attribute ((aligned(16)))" in the type declaration. So,
++ we use a struct containing an array of four ints for the atomic lock
++ type and dynamically select the 16-byte aligned int from the array
++ for the semaphore. */
++#define __PA_LDCW_ALIGNMENT 16
++static inline void *ldcw_align (void *p) {
++ unsigned long a = (unsigned long)p;
++ a = (a + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1);
++ return (void *)a;
++}
++
++static inline int testandset (spinlock_t *p)
++{
++ unsigned int ret;
++ p = ldcw_align(p);
++ __asm__ __volatile__("ldcw 0(%1),%0"
++ : "=r" (ret)
++ : "r" (p)
++ : "memory" );
++ return !ret;
++}
++#endif
++
++#ifdef __ia64
++#include <ia64intrin.h>
++
++static inline int testandset (int *p)
++{
++ return __sync_lock_test_and_set (p, 1);
++}
++#endif
++
++#ifdef __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;
++}
++#endif
++
++#if defined(__hppa__)
++
++typedef int spinlock_t[4];
++
++#define SPIN_LOCK_UNLOCKED { 1, 1, 1, 1 }
++
++static inline void resetlock (spinlock_t *p)
++{
++ (*p)[0] = (*p)[1] = (*p)[2] = (*p)[3] = 1;
++}
++
++#else
++
++typedef int spinlock_t;
++
++#define SPIN_LOCK_UNLOCKED 0
++
++static inline void resetlock (spinlock_t *p)
++{
++ *p = SPIN_LOCK_UNLOCKED;
++}
++
++#endif
++
++#if defined(CONFIG_USER_ONLY)
++static inline void spin_lock(spinlock_t *lock)
++{
++ while (testandset(lock));
++}
++
++static inline void spin_unlock(spinlock_t *lock)
++{
++ resetlock(lock);
++}
++
++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
++
++#endif
+Index: trunk/target-arm/cpu.h
+===================================================================
+--- trunk.orig/target-arm/cpu.h 2008-04-24 20:16:41.000000000 +0100
++++ trunk/target-arm/cpu.h 2008-04-24 20:16:53.000000000 +0100
+@@ -38,6 +38,7 @@
+ #define EXCP_FIQ 6
+ #define EXCP_BKPT 7
+ #define EXCP_EXCEPTION_EXIT 8 /* Return from v7M exception. */
++#define EXCP_KERNEL_TRAP 9 /* Jumped to kernel code page. */
+
+ #define ARMV7M_EXCP_RESET 1
+ #define ARMV7M_EXCP_NMI 2
+@@ -218,6 +219,15 @@
+ void cpu_lock(void);
+ void cpu_unlock(void);
+
++void cpu_lock(void);
++void cpu_unlock(void);
++#if defined(USE_NPTL)
++static inline void cpu_set_tls(CPUARMState *env, void *newtls)
++{
++ env->cp15.c13_tls2 = (uint32_t)(long)newtls;
++}
++#endif
++
+ #define CPSR_M (0x1f)
+ #define CPSR_T (1 << 5)
+ #define CPSR_F (1 << 6)
+Index: trunk/target-arm/translate.c
+===================================================================
+--- trunk.orig/target-arm/translate.c 2008-04-24 20:16:41.000000000 +0100
++++ trunk/target-arm/translate.c 2008-04-24 20:16:53.000000000 +0100
+@@ -8606,7 +8606,14 @@
+ gen_exception(EXCP_EXCEPTION_EXIT);
+ }
+ #endif
+-
++#ifdef CONFIG_USER_ONLY
++ /* Intercept jump to the magic kernel page. */
++ if (dc->pc > 0xffff0000) {
++ gen_exception(EXCP_KERNEL_TRAP);
++ dc->is_jmp = DISAS_UPDATE;
++ break;
++ }
++#endif
+ if (env->nb_breakpoints > 0) {
+ for(j = 0; j < env->nb_breakpoints; j++) {
+ if (env->breakpoints[j] == dc->pc) {
diff --git a/packages/qemu/qemu-0.9.1+svn/qemu-amd64-32b-mapping-0.9.0.patch b/packages/qemu/qemu-0.9.1+svn/qemu-amd64-32b-mapping-0.9.0.patch
new file mode 100644
index 0000000000..02f093abb9
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/qemu-amd64-32b-mapping-0.9.0.patch
@@ -0,0 +1,37 @@
+---
+ linux-user/mmap.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+Index: trunk/linux-user/mmap.c
+===================================================================
+--- trunk.orig/linux-user/mmap.c 2008-04-24 20:15:37.000000000 +0100
++++ trunk/linux-user/mmap.c 2008-04-24 20:16:16.000000000 +0100
+@@ -29,6 +29,10 @@
+
+ //#define DEBUG_MMAP
+
++#ifndef MAP_32BIT
++#define MAP_32BIT 0
++#endif
++
+ /* NOTE: all the constants are the HOST ones, but addresses are target. */
+ int target_mprotect(abi_ulong start, abi_ulong len, int prot)
+ {
+@@ -251,7 +255,7 @@
+ especially important if qemu_host_page_size >
+ qemu_real_host_page_size */
+ p = mmap(g2h(mmap_start),
+- host_len, prot, flags | MAP_FIXED, fd, host_offset);
++ host_len, prot, flags | MAP_FIXED | MAP_32BIT, fd, host_offset);
+ if (p == MAP_FAILED)
+ return -1;
+ /* update start so that it points to the file position at 'offset' */
+@@ -406,7 +410,7 @@
+ unsigned long host_addr;
+
+ /* XXX: use 5 args syscall */
+- host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
++ host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
+ if (host_addr == -1)
+ return -1;
+ new_addr = h2g(host_addr);
diff --git a/packages/qemu/qemu-0.9.1+svn/qemu-n800-support.patch b/packages/qemu/qemu-0.9.1+svn/qemu-n800-support.patch
new file mode 100644
index 0000000000..1224fb4cbd
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/qemu-n800-support.patch
@@ -0,0 +1,2381 @@
+diff -urN 4242/cpu-all.h qemu-omap/cpu-all.h
+--- 4242/cpu-all.h 2008-04-24 21:26:19.000000000 +0100
++++ qemu-omap/cpu-all.h 2008-04-23 09:57:55.000000000 +0100
+@@ -816,7 +816,7 @@
+ /* physical memory access */
+ #define TLB_INVALID_MASK (1 << 3)
+ #define IO_MEM_SHIFT 4
+-#define IO_MEM_NB_ENTRIES (1 << (TARGET_PAGE_BITS - IO_MEM_SHIFT))
++#define IO_MEM_NB_ENTRIES (16 << (TARGET_PAGE_BITS - IO_MEM_SHIFT))
+
+ #define IO_MEM_RAM (0 << IO_MEM_SHIFT) /* hardcoded offset */
+ #define IO_MEM_ROM (1 << IO_MEM_SHIFT) /* hardcoded offset */
+diff -urN 4242/exec.c qemu-omap/exec.c
+--- 4242/exec.c 2008-04-24 18:11:49.000000000 +0100
++++ qemu-omap/exec.c 2008-04-23 09:57:55.000000000 +0100
+@@ -1664,7 +1664,7 @@
+ {
+ if ((pd & ~TARGET_PAGE_MASK) > IO_MEM_ROM && !(pd & IO_MEM_ROMD)) {
+ /* IO memory case */
+- address = vaddr | pd;
++ address = vaddr | (pd & ~TARGET_PAGE_MASK);
+ addend = paddr;
+ } else {
+ /* standard memory */
+@@ -1698,7 +1698,9 @@
+ } else {
+ te->addr_read = -1;
+ }
+- if (prot & PAGE_EXEC) {
++ if ((pd & ~TARGET_PAGE_MASK) > IO_MEM_ROM && !(pd & IO_MEM_ROMD)) {
++ te->addr_code = pd;
++ } else if (prot & PAGE_EXEC) {
+ te->addr_code = address;
+ } else {
+ te->addr_code = -1;
+@@ -2493,7 +2495,9 @@
+ if (io_index <= 0) {
+ if (io_mem_nb >= IO_MEM_NB_ENTRIES)
+ return -1;
+- io_index = io_mem_nb++;
++ do io_index = io_mem_nb++;
++ while (((io_index << IO_MEM_SHIFT) & ~TARGET_PAGE_MASK)
++ <= IO_MEM_NOTDIRTY);
+ } else {
+ if (io_index >= IO_MEM_NB_ENTRIES)
+ return -1;
+diff -urN 4242/hw/max7310.c qemu-omap/hw/max7310.c
+--- 4242/hw/max7310.c 2008-04-24 18:11:49.000000000 +0100
++++ qemu-omap/hw/max7310.c 2008-03-02 19:31:55.000000000 +0000
+@@ -134,8 +134,8 @@
+ s->i2c_command_byte = 1;
+ break;
+ case I2C_FINISH:
+- if (s->len == 1)
+ #ifdef VERBOSE
++ if (s->len == 1)
+ printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->len);
+ #endif
+ break;
+diff -urN 4242/hw/ndis.h qemu-omap/hw/ndis.h
+--- 4242/hw/ndis.h 1970-01-01 01:00:00.000000000 +0100
++++ qemu-omap/hw/ndis.h 2008-04-23 09:57:56.000000000 +0100
+@@ -0,0 +1,217 @@
++/*
++ * ndis.h
++ *
++ * ntddndis.h modified by Benedikt Spranger <b.spranger@pengutronix.de>
++ *
++ * Thanks to the cygwin development team,
++ * espacially to Casper S. Hornstrup <chorns@users.sourceforge.net>
++ *
++ * THIS SOFTWARE IS NOT COPYRIGHTED
++ *
++ * This source code is offered for use in the public domain. You may
++ * use, modify or distribute it freely.
++ *
++ * This code is distributed in the hope that it will be useful but
++ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
++ * DISCLAIMED. This includes but is not limited to warranties of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ *
++ */
++
++#ifndef _LINUX_NDIS_H
++#define _LINUX_NDIS_H
++
++
++#define NDIS_STATUS_MULTICAST_FULL 0xC0010009
++#define NDIS_STATUS_MULTICAST_EXISTS 0xC001000A
++#define NDIS_STATUS_MULTICAST_NOT_FOUND 0xC001000B
++
++enum NDIS_DEVICE_POWER_STATE {
++ NdisDeviceStateUnspecified = 0,
++ NdisDeviceStateD0,
++ NdisDeviceStateD1,
++ NdisDeviceStateD2,
++ NdisDeviceStateD3,
++ NdisDeviceStateMaximum
++};
++
++struct NDIS_PM_WAKE_UP_CAPABILITIES {
++ enum NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp;
++ enum NDIS_DEVICE_POWER_STATE MinPatternWakeUp;
++ enum NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp;
++};
++
++/* NDIS_PNP_CAPABILITIES.Flags constants */
++#define NDIS_DEVICE_WAKE_UP_ENABLE 0x00000001
++#define NDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE 0x00000002
++#define NDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE 0x00000004
++
++struct NDIS_PNP_CAPABILITIES {
++ __le32 Flags;
++ struct NDIS_PM_WAKE_UP_CAPABILITIES WakeUpCapabilities;
++};
++
++struct NDIS_PM_PACKET_PATTERN {
++ __le32 Priority;
++ __le32 Reserved;
++ __le32 MaskSize;
++ __le32 PatternOffset;
++ __le32 PatternSize;
++ __le32 PatternFlags;
++};
++
++
++/* Required Object IDs (OIDs) */
++#define OID_GEN_SUPPORTED_LIST 0x00010101
++#define OID_GEN_HARDWARE_STATUS 0x00010102
++#define OID_GEN_MEDIA_SUPPORTED 0x00010103
++#define OID_GEN_MEDIA_IN_USE 0x00010104
++#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
++#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
++#define OID_GEN_LINK_SPEED 0x00010107
++#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
++#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
++#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
++#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
++#define OID_GEN_VENDOR_ID 0x0001010C
++#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
++#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
++#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
++#define OID_GEN_DRIVER_VERSION 0x00010110
++#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
++#define OID_GEN_PROTOCOL_OPTIONS 0x00010112
++#define OID_GEN_MAC_OPTIONS 0x00010113
++#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
++#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
++#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
++#define OID_GEN_SUPPORTED_GUIDS 0x00010117
++#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
++#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
++#define OID_GEN_MACHINE_NAME 0x0001021A
++#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B
++#define OID_GEN_VLAN_ID 0x0001021C
++
++/* Optional OIDs */
++#define OID_GEN_MEDIA_CAPABILITIES 0x00010201
++#define OID_GEN_PHYSICAL_MEDIUM 0x00010202
++
++/* Required statistics OIDs */
++#define OID_GEN_XMIT_OK 0x00020101
++#define OID_GEN_RCV_OK 0x00020102
++#define OID_GEN_XMIT_ERROR 0x00020103
++#define OID_GEN_RCV_ERROR 0x00020104
++#define OID_GEN_RCV_NO_BUFFER 0x00020105
++
++/* Optional statistics OIDs */
++#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
++#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
++#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
++#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
++#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
++#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
++#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
++#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
++#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
++#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
++#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
++#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
++#define OID_GEN_RCV_CRC_ERROR 0x0002020D
++#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
++#define OID_GEN_GET_TIME_CAPS 0x0002020F
++#define OID_GEN_GET_NETCARD_TIME 0x00020210
++#define OID_GEN_NETCARD_LOAD 0x00020211
++#define OID_GEN_DEVICE_PROFILE 0x00020212
++#define OID_GEN_INIT_TIME_MS 0x00020213
++#define OID_GEN_RESET_COUNTS 0x00020214
++#define OID_GEN_MEDIA_SENSE_COUNTS 0x00020215
++#define OID_GEN_FRIENDLY_NAME 0x00020216
++#define OID_GEN_MINIPORT_INFO 0x00020217
++#define OID_GEN_RESET_VERIFY_PARAMETERS 0x00020218
++
++/* IEEE 802.3 (Ethernet) OIDs */
++#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
++
++#define OID_802_3_PERMANENT_ADDRESS 0x01010101
++#define OID_802_3_CURRENT_ADDRESS 0x01010102
++#define OID_802_3_MULTICAST_LIST 0x01010103
++#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
++#define OID_802_3_MAC_OPTIONS 0x01010105
++#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
++#define OID_802_3_XMIT_ONE_COLLISION 0x01020102
++#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
++#define OID_802_3_XMIT_DEFERRED 0x01020201
++#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
++#define OID_802_3_RCV_OVERRUN 0x01020203
++#define OID_802_3_XMIT_UNDERRUN 0x01020204
++#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
++#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
++#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
++
++/* OID_GEN_MINIPORT_INFO constants */
++#define NDIS_MINIPORT_BUS_MASTER 0x00000001
++#define NDIS_MINIPORT_WDM_DRIVER 0x00000002
++#define NDIS_MINIPORT_SG_LIST 0x00000004
++#define NDIS_MINIPORT_SUPPORTS_MEDIA_QUERY 0x00000008
++#define NDIS_MINIPORT_INDICATES_PACKETS 0x00000010
++#define NDIS_MINIPORT_IGNORE_PACKET_QUEUE 0x00000020
++#define NDIS_MINIPORT_IGNORE_REQUEST_QUEUE 0x00000040
++#define NDIS_MINIPORT_IGNORE_TOKEN_RING_ERRORS 0x00000080
++#define NDIS_MINIPORT_INTERMEDIATE_DRIVER 0x00000100
++#define NDIS_MINIPORT_IS_NDIS_5 0x00000200
++#define NDIS_MINIPORT_IS_CO 0x00000400
++#define NDIS_MINIPORT_DESERIALIZE 0x00000800
++#define NDIS_MINIPORT_REQUIRES_MEDIA_POLLING 0x00001000
++#define NDIS_MINIPORT_SUPPORTS_MEDIA_SENSE 0x00002000
++#define NDIS_MINIPORT_NETBOOT_CARD 0x00004000
++#define NDIS_MINIPORT_PM_SUPPORTED 0x00008000
++#define NDIS_MINIPORT_SUPPORTS_MAC_ADDRESS_OVERWRITE 0x00010000
++#define NDIS_MINIPORT_USES_SAFE_BUFFER_APIS 0x00020000
++#define NDIS_MINIPORT_HIDDEN 0x00040000
++#define NDIS_MINIPORT_SWENUM 0x00080000
++#define NDIS_MINIPORT_SURPRISE_REMOVE_OK 0x00100000
++#define NDIS_MINIPORT_NO_HALT_ON_SUSPEND 0x00200000
++#define NDIS_MINIPORT_HARDWARE_DEVICE 0x00400000
++#define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000
++#define NDIS_MINIPORT_64BITS_DMA 0x01000000
++
++#define NDIS_MEDIUM_802_3 0x00000000
++#define NDIS_MEDIUM_802_5 0x00000001
++#define NDIS_MEDIUM_FDDI 0x00000002
++#define NDIS_MEDIUM_WAN 0x00000003
++#define NDIS_MEDIUM_LOCAL_TALK 0x00000004
++#define NDIS_MEDIUM_DIX 0x00000005
++#define NDIS_MEDIUM_ARCENT_RAW 0x00000006
++#define NDIS_MEDIUM_ARCENT_878_2 0x00000007
++#define NDIS_MEDIUM_ATM 0x00000008
++#define NDIS_MEDIUM_WIRELESS_LAN 0x00000009
++#define NDIS_MEDIUM_IRDA 0x0000000A
++#define NDIS_MEDIUM_BPC 0x0000000B
++#define NDIS_MEDIUM_CO_WAN 0x0000000C
++#define NDIS_MEDIUM_1394 0x0000000D
++
++#define NDIS_PACKET_TYPE_DIRECTED 0x00000001
++#define NDIS_PACKET_TYPE_MULTICAST 0x00000002
++#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
++#define NDIS_PACKET_TYPE_BROADCAST 0x00000008
++#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
++#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
++#define NDIS_PACKET_TYPE_SMT 0x00000040
++#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
++#define NDIS_PACKET_TYPE_GROUP 0x00000100
++#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200
++#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400
++#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800
++
++#define NDIS_MEDIA_STATE_CONNECTED 0x00000000
++#define NDIS_MEDIA_STATE_DISCONNECTED 0x00000001
++
++#define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
++#define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
++#define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
++#define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
++#define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
++#define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
++#define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
++#define NDIS_MAC_OPTION_RESERVED 0x80000000
++
++#endif /* _LINUX_NDIS_H */
+diff -urN 4242/hw/nseries.c qemu-omap/hw/nseries.c
+--- 4242/hw/nseries.c 2008-04-24 18:11:49.000000000 +0100
++++ qemu-omap/hw/nseries.c 2008-04-23 09:57:56.000000000 +0100
+@@ -602,6 +602,37 @@
+ (void *) &config7, sizeof(config7));
+ }
+
++#if 0
++static uint32_t n800_pinout[104] = {
++ 0x080f00d8, 0x00d40808, 0x03080808, 0x080800d0,
++ 0x00dc0808, 0x0b0f0f00, 0x080800b4, 0x00c00808,
++ 0x08080808, 0x180800c4, 0x00b80000, 0x08080808,
++ 0x080800bc, 0x00cc0808, 0x08081818, 0x18180128,
++ 0x01241800, 0x18181818, 0x000000f0, 0x01300000,
++ 0x00001b0b, 0x1b0f0138, 0x00e0181b, 0x1b031b0b,
++ 0x180f0078, 0x00740018, 0x0f0f0f1a, 0x00000080,
++ 0x007c0000, 0x00000000, 0x00000088, 0x00840000,
++ 0x00000000, 0x00000094, 0x00980300, 0x0f180003,
++ 0x0000008c, 0x00900f0f, 0x0f0f1b00, 0x0f00009c,
++ 0x01140000, 0x1b1b0f18, 0x0818013c, 0x01400008,
++ 0x00001818, 0x000b0110, 0x010c1800, 0x0b030b0f,
++ 0x181800f4, 0x00f81818, 0x00000018, 0x000000fc,
++ 0x00401808, 0x00000000, 0x0f1b0030, 0x003c0008,
++ 0x00000000, 0x00000038, 0x00340000, 0x00000000,
++ 0x1a080070, 0x00641a1a, 0x08080808, 0x08080060,
++ 0x005c0808, 0x08080808, 0x08080058, 0x00540808,
++ 0x08080808, 0x0808006c, 0x00680808, 0x08080808,
++ 0x000000a8, 0x00b00000, 0x08080808, 0x000000a0,
++ 0x00a40000, 0x00000000, 0x08ff0050, 0x004c0808,
++ 0xffffffff, 0xffff0048, 0x0044ffff, 0xffffffff,
++ 0x000000ac, 0x01040800, 0x08080b0f, 0x18180100,
++ 0x01081818, 0x0b0b1808, 0x1a0300e4, 0x012c0b1a,
++ 0x02020018, 0x0b000134, 0x011c0800, 0x0b1b1b00,
++ 0x0f0000c8, 0x00ec181b, 0x000f0f02, 0x00180118,
++ 0x01200000, 0x0f0b1b1b, 0x0f0200e8, 0x0000020b,
++};
++#endif
++
+ /* Setup sequence done by the bootloader */
+ static void n800_boot_init(void *opaque)
+ {
+@@ -942,3 +973,71 @@
+ "Nokia N800 aka. RX-34 tablet (OMAP2420)",
+ n800_init,
+ };
++
++#if 0
++/* cx3110x.c */
++#define CY_ARM_INT 0x00
++#define CY_ARM_INT_ENA 0x00
++#define CY_HOST_INT 0x00
++#define CY_HOST_INT_ENA 0x00
++#define CY_HOST_INT_ACK 0x00
++#define CY_GP1_COMM 0x00
++#define CY_GP2_COMM 0x00
++#define CY_DEV_CTRL_STA 0x00
++#define CY_DMA_DATA 0x00 /* 16-bit */
++#define CY_DMA_WR_CTRL 0x00 /* 16-bit */
++#define CY_DMA_WR_LEN 0x00 /* 16-bit */
++#define CY_DMA_WR_BASE 0x00
++#define CY_DMA_RD_CTRL 0x00 /* 16-bit */
++#define CY_DMA_RD_LEN 0x00 /* 16-bit */
++#define CY_DMA_RD_BASE 0x00
++
++HW:
++(spi bus 1.0)
++ tsc2005
++(spi bus 1.1)
++ lcd_mipid
++(spi bus 2.0)
++ cx3110x (WLAN)
++(spi somewhere?)
++ pc2400m (WiMAX)
++(i2c bus 0)
++ TLV320AIC33 (audio codec on i2c)
++ TCM825x (camera on i2c)
++ lp5521 (LED on i2c)
++ tsl2563 (light sensor, hwmon on i2c)
++ lm8323 (keypad on i2c)
++(i2c bus 1)
++ tmp105 (temperature sensor, hwmon on i2c)
++ menelaus (power on i2c)
++
++GPIO 0: out hi
++GPIO 8: in hi
++GPIO 9: out hi
++GPIO 10: out lo
++GPIO 12: out lo
++GPIO 15: out lo
++GPIO 23: out hi
++GPIO 26: in hi, irq-186 rising
++GPIO 53: out lo
++GPIO 58: in hi, irq-218 low wakeup
++GPIO 62: out lo
++GPIO 64: out hi
++GPIO 65: in hi
++GPIO 66: out lo
++GPIO 93: out lo
++GPIO 94: in hi
++GPIO 95: out lo
++GPIO 96: out hi
++GPIO 101: out lo
++GPIO 102: in hi, irq-262 bothedge
++GPIO 106: in hi, irq-266 falling wakeup
++GPIO 107: in hi, irq-267 bothedge
++GPIO 108: in lo, irq-268 rising wakeup
++GPIO 109: in hi, irq-269 falling wakeup
++GPIO 110: in hi, irq-270 bothedge
++GPIO 111: in lo, irq-271 rising
++GPIO 112: out hi
++GPIO 118: out hi
++GPIO 125: in lo, irq-285 rising
++#endif
+diff -urN 4242/hw/omap2.c qemu-omap/hw/omap2.c
+--- 4242/hw/omap2.c 2008-04-24 18:11:49.000000000 +0100
++++ qemu-omap/hw/omap2.c 2008-04-23 09:57:56.000000000 +0100
+@@ -3675,152 +3675,152 @@
+ omap_findclk(s, "dss_l4_iclk"));
+
+ /* All register mappings (includin those not currenlty implemented):
+- * SystemControlMod 48000000 - 48000fff
+- * SystemControlL4 48001000 - 48001fff
+- * 32kHz Timer Mod 48004000 - 48004fff
+- * 32kHz Timer L4 48005000 - 48005fff
+- * PRCM ModA 48008000 - 480087ff
++ * SystemControlMod 48000000 - 48000fff (REV 0x00000010)
++ * SystemControlL4 48001000 - 48001fff (0x00200010, 0x01000200, 0x00000000)
++ * 32kHz Timer Mod 48004000 - 48004fff (REV 0x00000011)
++ * 32kHz Timer L4 48005000 - 48005fff (0x00200010, 0x01000200, 0x00000000)
++ * PRCM ModA 48008000 - 480087ff (REV 0x00000010)
+ * PRCM ModB 48008800 - 48008fff
+- * PRCM L4 48009000 - 48009fff
+- * TEST-BCM Mod 48012000 - 48012fff
+- * TEST-BCM L4 48013000 - 48013fff
+- * TEST-TAP Mod 48014000 - 48014fff
+- * TEST-TAP L4 48015000 - 48015fff
+- * GPIO1 Mod 48018000 - 48018fff
+- * GPIO Top 48019000 - 48019fff
+- * GPIO2 Mod 4801a000 - 4801afff
+- * GPIO L4 4801b000 - 4801bfff
+- * GPIO3 Mod 4801c000 - 4801cfff
+- * GPIO4 Mod 4801e000 - 4801efff
+- * WDTIMER1 Mod 48020000 - 48010fff
++ * PRCM L4 48009000 - 48009fff (0x00200010, 0x00000200, 0x00000000)
++ * TEST-BCM Mod 48012000 - 48012fff (REV 0x00000010)
++ * TEST-BCM L4 48013000 - 48013fff (0x00200010, 0x00000200, 0x00000000)
++ * TEST-TAP Mod 48014000 - 48014fff (REV 0x00000010)
++ * TEST-TAP L4 48015000 - 48015fff (0x00200010, 0x00000200, 0x00000000)
++ * GPIO1 Mod 48018000 - 48018fff (REV 0x00000018)
++ * GPIO Top 48019000 - 48019fff (REV 0x00000011)
++ * GPIO2 Mod 4801a000 - 4801afff (REV 0x00000018)
++ * GPIO L4 4801b000 - 4801bfff (0x00200010, 0x00000200, 0x00000000)
++ * GPIO3 Mod 4801c000 - 4801cfff (REV 0x00000018)
++ * GPIO4 Mod 4801e000 - 4801efff (REV 0x00000018)
++ * WDTIMER1 Mod 48020000 - 48010fff (REV Abort)
+ * WDTIMER Top 48021000 - 48011fff
+- * WDTIMER2 Mod 48022000 - 48012fff
+- * WDTIMER L4 48023000 - 48013fff
+- * WDTIMER3 Mod 48024000 - 48014fff
+- * WDTIMER3 L4 48025000 - 48015fff
+- * WDTIMER4 Mod 48026000 - 48016fff
+- * WDTIMER4 L4 48027000 - 48017fff
+- * GPTIMER1 Mod 48028000 - 48018fff
+- * GPTIMER1 L4 48029000 - 48019fff
+- * GPTIMER2 Mod 4802a000 - 4801afff
+- * GPTIMER2 L4 4802b000 - 4801bfff
++ * WDTIMER2 Mod 48022000 - 48012fff (REV 0x00000011)
++ * WDTIMER L4 48023000 - 48013fff (0x00200010, 0x00000200, 0x00000000)
++ * WDTIMER3 Mod 48024000 - 48014fff (REV 0x00000011)
++ * WDTIMER3 L4 48025000 - 48015fff (0x00200010, 0x00000200, 0x00000000)
++ * WDTIMER4 Mod 48026000 - 48016fff (REV 0x00000011)
++ * WDTIMER4 L4 48027000 - 48017fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER1 Mod 48028000 - 48018fff (REV 0x00000013)
++ * GPTIMER1 L4 48029000 - 48019fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER2 Mod 4802a000 - 4801afff (REV Abort)
++ * GPTIMER2 L4 4802b000 - 4801bfff (0x00200010, 0x00000200, 0x00000000)
+ * L4-Config AP 48040000 - 480407ff
+ * L4-Config IP 48040800 - 48040fff
+ * L4-Config LA 48041000 - 48041fff
+- * ARM11ETB Mod 48048000 - 48049fff
+- * ARM11ETB L4 4804a000 - 4804afff
+- * DISPLAY Top 48050000 - 480503ff
+- * DISPLAY DISPC 48050400 - 480507ff
+- * DISPLAY RFBI 48050800 - 48050bff
+- * DISPLAY VENC 48050c00 - 48050fff
+- * DISPLAY L4 48051000 - 48051fff
+- * CAMERA Top 48052000 - 480523ff
+- * CAMERA core 48052400 - 480527ff
+- * CAMERA DMA 48052800 - 48052bff
+- * CAMERA MMU 48052c00 - 48052fff
+- * CAMERA L4 48053000 - 48053fff
+- * SDMA Mod 48056000 - 48056fff
+- * SDMA L4 48057000 - 48057fff
+- * SSI Top 48058000 - 48058fff
+- * SSI GDD 48059000 - 48059fff
+- * SSI Port1 4805a000 - 4805afff
+- * SSI Port2 4805b000 - 4805bfff
+- * SSI L4 4805c000 - 4805cfff
+- * USB Mod 4805e000 - 480fefff
+- * USB L4 4805f000 - 480fffff
+- * WIN_TRACER1 Mod 48060000 - 48060fff
+- * WIN_TRACER1 L4 48061000 - 48061fff
+- * WIN_TRACER2 Mod 48062000 - 48062fff
+- * WIN_TRACER2 L4 48063000 - 48063fff
+- * WIN_TRACER3 Mod 48064000 - 48064fff
+- * WIN_TRACER3 L4 48065000 - 48065fff
+- * WIN_TRACER4 Top 48066000 - 480660ff
+- * WIN_TRACER4 ETT 48066100 - 480661ff
+- * WIN_TRACER4 WT 48066200 - 480662ff
+- * WIN_TRACER4 L4 48067000 - 48067fff
+- * XTI Mod 48068000 - 48068fff
+- * XTI L4 48069000 - 48069fff
+- * UART1 Mod 4806a000 - 4806afff
+- * UART1 L4 4806b000 - 4806bfff
+- * UART2 Mod 4806c000 - 4806cfff
+- * UART2 L4 4806d000 - 4806dfff
+- * UART3 Mod 4806e000 - 4806efff
+- * UART3 L4 4806f000 - 4806ffff
+- * I2C1 Mod 48070000 - 48070fff
+- * I2C1 L4 48071000 - 48071fff
+- * I2C2 Mod 48072000 - 48072fff
+- * I2C2 L4 48073000 - 48073fff
+- * McBSP1 Mod 48074000 - 48074fff
+- * McBSP1 L4 48075000 - 48075fff
+- * McBSP2 Mod 48076000 - 48076fff
+- * McBSP2 L4 48077000 - 48077fff
+- * GPTIMER3 Mod 48078000 - 48078fff
+- * GPTIMER3 L4 48079000 - 48079fff
+- * GPTIMER4 Mod 4807a000 - 4807afff
+- * GPTIMER4 L4 4807b000 - 4807bfff
+- * GPTIMER5 Mod 4807c000 - 4807cfff
+- * GPTIMER5 L4 4807d000 - 4807dfff
+- * GPTIMER6 Mod 4807e000 - 4807efff
+- * GPTIMER6 L4 4807f000 - 4807ffff
+- * GPTIMER7 Mod 48080000 - 48080fff
+- * GPTIMER7 L4 48081000 - 48081fff
+- * GPTIMER8 Mod 48082000 - 48082fff
+- * GPTIMER8 L4 48083000 - 48083fff
+- * GPTIMER9 Mod 48084000 - 48084fff
+- * GPTIMER9 L4 48085000 - 48085fff
+- * GPTIMER10 Mod 48086000 - 48086fff
+- * GPTIMER10 L4 48087000 - 48087fff
+- * GPTIMER11 Mod 48088000 - 48088fff
+- * GPTIMER11 L4 48089000 - 48089fff
+- * GPTIMER12 Mod 4808a000 - 4808afff
+- * GPTIMER12 L4 4808b000 - 4808bfff
+- * EAC Mod 48090000 - 48090fff
+- * EAC L4 48091000 - 48091fff
+- * FAC Mod 48092000 - 48092fff
+- * FAC L4 48093000 - 48093fff
+- * MAILBOX Mod 48094000 - 48094fff
+- * MAILBOX L4 48095000 - 48095fff
+- * SPI1 Mod 48098000 - 48098fff
+- * SPI1 L4 48099000 - 48099fff
+- * SPI2 Mod 4809a000 - 4809afff
+- * SPI2 L4 4809b000 - 4809bfff
+- * MMC/SDIO Mod 4809c000 - 4809cfff
+- * MMC/SDIO L4 4809d000 - 4809dfff
+- * MS_PRO Mod 4809e000 - 4809efff
+- * MS_PRO L4 4809f000 - 4809ffff
+- * RNG Mod 480a0000 - 480a0fff
+- * RNG L4 480a1000 - 480a1fff
+- * DES3DES Mod 480a2000 - 480a2fff
+- * DES3DES L4 480a3000 - 480a3fff
+- * SHA1MD5 Mod 480a4000 - 480a4fff
+- * SHA1MD5 L4 480a5000 - 480a5fff
+- * AES Mod 480a6000 - 480a6fff
+- * AES L4 480a7000 - 480a7fff
+- * PKA Mod 480a8000 - 480a9fff
+- * PKA L4 480aa000 - 480aafff
+- * MG Mod 480b0000 - 480b0fff
+- * MG L4 480b1000 - 480b1fff
+- * HDQ/1-wire Mod 480b2000 - 480b2fff
+- * HDQ/1-wire L4 480b3000 - 480b3fff
+- * MPU interrupt 480fe000 - 480fefff
+- * IVA RAM 5c000000 - 5c01ffff
+- * IVA ROM 5c020000 - 5c027fff
+- * IMG_BUF_A 5c040000 - 5c040fff
+- * IMG_BUF_B 5c042000 - 5c042fff
+- * VLCDS 5c048000 - 5c0487ff
+- * IMX_COEF 5c049000 - 5c04afff
+- * IMX_CMD 5c051000 - 5c051fff
+- * VLCDQ 5c053000 - 5c0533ff
+- * VLCDH 5c054000 - 5c054fff
+- * SEQ_CMD 5c055000 - 5c055fff
+- * IMX_REG 5c056000 - 5c0560ff
+- * VLCD_REG 5c056100 - 5c0561ff
+- * SEQ_REG 5c056200 - 5c0562ff
+- * IMG_BUF_REG 5c056300 - 5c0563ff
+- * SEQIRQ_REG 5c056400 - 5c0564ff
+- * OCP_REG 5c060000 - 5c060fff
+- * SYSC_REG 5c070000 - 5c070fff
+- * MMU_REG 5d000000 - 5d000fff
++ * ARM11ETB Mod 48048000 - 48049fff (REV 0x00000011)
++ * ARM11ETB L4 4804a000 - 4804afff (0x00200010, 0x00000200, 0x00000000)
++ * DISPLAY Top 48050000 - 480503ff (REV 0x00000003)
++ * DISPLAY DISPC 48050400 - 480507ff (REV 0x00000020)
++ * DISPLAY RFBI 48050800 - 48050bff (REV 0x00000010)
++ * DISPLAY VENC 48050c00 - 48050fff (REV Abort)
++ * DISPLAY L4 48051000 - 48051fff (0x00200010, 0x00000200, 0x00000100)
++ * CAMERA Top 48052000 - 480523ff (REV 0x00000020)
++ * CAMERA core 48052400 - 480527ff (REV 0x00000020)
++ * CAMERA DMA 48052800 - 48052bff (REV 0x00000020)
++ * CAMERA MMU 48052c00 - 48052fff (REV 0x00000010)
++ * CAMERA L4 48053000 - 48053fff (0x00200010, 0x00000200, 0x00000000)
++ * SDMA Mod 48056000 - 48056fff (REV 0x00000020)
++ * SDMA L4 48057000 - 48057fff (0x00200010, 0x00000200, 0x00000000)
++ * SSI Top 48058000 - 48058fff (REV Abort)
++ * SSI GDD 48059000 - 48059fff (REV Abort)
++ * SSI Port1 4805a000 - 4805afff (REV Abort)
++ * SSI Port2 4805b000 - 4805bfff (REV Abort)
++ * SSI L4 4805c000 - 4805cfff (0x00200010, 0x00000200, 0x00000100)
++ * USB Mod 4805e000 - 480fefff (REV Abort)
++ * USB L4 4805f000 - 480fffff (0x00200010, 0x01000200, 0x00000100)
++ * WIN_TRACER1 Mod 48060000 - 48060fff (REV 0x00000020)
++ * WIN_TRACER1 L4 48061000 - 48061fff (0x00200010, 0x00000200, 0x00000000)
++ * WIN_TRACER2 Mod 48062000 - 48062fff (REV 0x00000020)
++ * WIN_TRACER2 L4 48063000 - 48063fff (0x00200010, 0x00000200, 0x00000000)
++ * WIN_TRACER3 Mod 48064000 - 48064fff (REV 0x00000020)
++ * WIN_TRACER3 L4 48065000 - 48065fff (0x00200010, 0x00000200, 0x00000000)
++ * WIN_TRACER4 Top 48066000 - 480660ff (REV 0x00000011)
++ * WIN_TRACER4 ETT 48066100 - 480661ff (REV 0x00000011)
++ * WIN_TRACER4 WT 48066200 - 480662ff (REV 0x00000020)
++ * WIN_TRACER4 L4 48067000 - 48067fff (0x00200010, 0x00000200, 0x00000000)
++ * XTI Mod 48068000 - 48068fff (REV 0x00000010)
++ * XTI L4 48069000 - 48069fff (0x00200010, 0x00000200, 0x00000000)
++ * UART1 Mod 4806a000 - 4806afff (MVR Abort)
++ * UART1 L4 4806b000 - 4806bfff (0x00200010, 0x00000200, 0x00000000)
++ * UART2 Mod 4806c000 - 4806cfff (MVR Abort)
++ * UART2 L4 4806d000 - 4806dfff (0x00200010, 0x00000200, 0x00000000)
++ * UART3 Mod 4806e000 - 4806efff (MVR 0x20)
++ * UART3 L4 4806f000 - 4806ffff (0x00200010, 0x00000200, 0x00000000)
++ * I2C1 Mod 48070000 - 48070fff (REV 0x0034)
++ * I2C1 L4 48071000 - 48071fff (0x00200010, 0x01000200, 0x01000000)
++ * I2C2 Mod 48072000 - 48072fff (REV 0x0034)
++ * I2C2 L4 48073000 - 48073fff (0x00200010, 0x01000200, 0x01000000)
++ * McBSP1 Mod 48074000 - 48074fff (REV Abort)
++ * McBSP1 L4 48075000 - 48075fff (0x00200010, 0x01000200, 0x01000000)
++ * McBSP2 Mod 48076000 - 48076fff (REV Abort)
++ * McBSP2 L4 48077000 - 48077fff (0x00200010, 0x01000200, 0x01000000)
++ * GPTIMER3 Mod 48078000 - 48078fff (REV Abort)
++ * GPTIMER3 L4 48079000 - 48079fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER4 Mod 4807a000 - 4807afff (REV Abort)
++ * GPTIMER4 L4 4807b000 - 4807bfff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER5 Mod 4807c000 - 4807cfff (REV Abort)
++ * GPTIMER5 L4 4807d000 - 4807dfff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER6 Mod 4807e000 - 4807efff (REV Abort)
++ * GPTIMER6 L4 4807f000 - 4807ffff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER7 Mod 48080000 - 48080fff (REV Abort)
++ * GPTIMER7 L4 48081000 - 48081fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER8 Mod 48082000 - 48082fff (REV Abort)
++ * GPTIMER8 L4 48083000 - 48083fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER9 Mod 48084000 - 48084fff (REV Abort)
++ * GPTIMER9 L4 48085000 - 48085fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER10 Mod 48086000 - 48086fff (REV Abort)
++ * GPTIMER10 L4 48087000 - 48087fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER11 Mod 48088000 - 48088fff (REV Abort)
++ * GPTIMER11 L4 48089000 - 48089fff (0x00200010, 0x00000200, 0x00000000)
++ * GPTIMER12 Mod 4808a000 - 4808afff (REV Abort)
++ * GPTIMER12 L4 4808b000 - 4808bfff (0x00200010, 0x00000200, 0x00000000)
++ * EAC Mod 48090000 - 48090fff (REV Abort)
++ * EAC L4 48091000 - 48091fff (0x00200010, 0x00000200, 0x00000000)
++ * FAC Mod 48092000 - 48092fff (REV Abort)
++ * FAC L4 48093000 - 48093fff (0x00200010, 0x00000200, 0x00000000)
++ * MAILBOX Mod 48094000 - 48094fff (REV 0x00000010)
++ * MAILBOX L4 48095000 - 48095fff (0x00200010, 0x00000200, 0x00000000)
++ * SPI1 Mod 48098000 - 48098fff (REV Abort)
++ * SPI1 L4 48099000 - 48099fff (0x00200010, 0x00000200, 0x00000000)
++ * SPI2 Mod 4809a000 - 4809afff (REV Abort)
++ * SPI2 L4 4809b000 - 4809bfff (0x00200010, 0x00000200, 0x00000000)
++ * MMC/SDIO Mod 4809c000 - 4809cfff (REV 0x0044)
++ * MMC/SDIO L4 4809d000 - 4809dfff (0x00200010, 0x01000200, 0x01000000)
++ * MS_PRO Mod 4809e000 - 4809efff (REV Abort)
++ * MS_PRO L4 4809f000 - 4809ffff (0x00200010, 0x01000200, 0x01000000)
++ * RNG Mod 480a0000 - 480a0fff (REV 0xFC066F93?)
++ * RNG L4 480a1000 - 480a1fff (0x00200010, 0x01000200, 0x00000000)
++ * DES3DES Mod 480a2000 - 480a2fff (REV 0x00000000?)
++ * DES3DES L4 480a3000 - 480a3fff (0x00200010, 0x01000200, 0x00000000)
++ * SHA1MD5 Mod 480a4000 - 480a4fff (REV 0x00000000?)
++ * SHA1MD5 L4 480a5000 - 480a5fff (0x00200010, 0x01000200, 0x00000000)
++ * AES Mod 480a6000 - 480a6fff (REV 0x00000000?)
++ * AES L4 480a7000 - 480a7fff (0x00200010, 0x00000200, 0x00000000)
++ * PKA Mod 480a8000 - 480a9fff (REV 0x00000000?)
++ * PKA L4 480aa000 - 480aafff (0x00200010, 0x00000200, 0x00000000)
++ * MG Mod 480b0000 - 480b0fff (REV Abort)
++ * MG L4 480b1000 - 480b1fff (0x00200010, 0x01000200, 0x01000000)
++ * HDQ/1-wire Mod 480b2000 - 480b2fff (REV 0x00000002)
++ * HDQ/1-wire L4 480b3000 - 480b3fff (0x00200010, 0x00000200, 0x00000000)
++ * MPU interrupt 480fe000 - 480fefff (REV 0x00000020)
++ * IVA RAM 5c000000 - 5c01ffff (REV Abort)
++ * IVA ROM 5c020000 - 5c027fff (REV Abort)
++ * IMG_BUF_A 5c040000 - 5c040fff (REV Abort)
++ * IMG_BUF_B 5c042000 - 5c042fff (REV Abort)
++ * VLCDS 5c048000 - 5c0487ff (REV Abort)
++ * IMX_COEF 5c049000 - 5c04afff (REV Abort)
++ * IMX_CMD 5c051000 - 5c051fff (REV Abort)
++ * VLCDQ 5c053000 - 5c0533ff (REV Abort)
++ * VLCDH 5c054000 - 5c054fff (REV Abort)
++ * SEQ_CMD 5c055000 - 5c055fff (REV Abort)
++ * IMX_REG 5c056000 - 5c0560ff (REV Abort)
++ * VLCD_REG 5c056100 - 5c0561ff (REV Abort)
++ * SEQ_REG 5c056200 - 5c0562ff (REV Abort)
++ * IMG_BUF_REG 5c056300 - 5c0563ff (REV Abort)
++ * SEQIRQ_REG 5c056400 - 5c0564ff (REV Abort)
++ * OCP_REG 5c060000 - 5c060fff (REV Abort)
++ * SYSC_REG 5c070000 - 5c070fff (REV Abort)
++ * MMU_REG 5d000000 - 5d000fff (REV Abort)
+ * sDMA R 68000400 - 680005ff
+ * sDMA W 68000600 - 680007ff
+ * Display Control 68000800 - 680009ff
+@@ -3849,9 +3849,9 @@
+ * GPMC (firewall) 68006000 - 680063ff
+ * GPMC (err login) 68006400 - 680067ff
+ * SMS (err login) 68006c00 - 68006fff
+- * SMS registers 68008000 - 68008fff
+- * SDRC registers 68009000 - 68009fff
+- * GPMC registers 6800a000 6800afff
++ * SMS registers 68008000 - 68008fff (REV 0x00000020)
++ * SDRC registers 68009000 - 68009fff (REV 0x00000020)
++ * GPMC registers 6800a000 6800afff (REV 0x00000020)
+ */
+
+ qemu_register_reset(omap2_mpu_reset, s);
+diff -urN 4242/hw/pc.c qemu-omap/hw/pc.c
+--- 4242/hw/pc.c 2008-04-24 21:26:22.000000000 +0100
++++ qemu-omap/hw/pc.c 2008-04-23 09:57:56.000000000 +0100
+@@ -445,6 +445,37 @@
+ bdrv_set_boot_sector(drives_table[hda].bdrv, bootsect, sizeof(bootsect));
+ }
+
++static int load_kernel(const char *filename, uint8_t *addr,
++ uint8_t *real_addr)
++{
++ int fd, size;
++ int setup_sects;
++
++ fd = open(filename, O_RDONLY | O_BINARY);
++ if (fd < 0)
++ return -1;
++
++ /* load 16 bit code */
++ if (read(fd, real_addr, 512) != 512)
++ goto fail;
++ setup_sects = real_addr[0x1F1];
++ if (!setup_sects)
++ setup_sects = 4;
++ if (read(fd, real_addr + 512, setup_sects * 512) !=
++ setup_sects * 512)
++ goto fail;
++
++ /* load 32 bit code */
++ size = read(fd, addr, 16 * 1024 * 1024);
++ if (size < 0)
++ goto fail;
++ close(fd);
++ return size;
++ fail:
++ close(fd);
++ return -1;
++}
++
+ static long get_file_size(FILE *f)
+ {
+ long where, size;
+diff -urN 4242/hw/tusb6010.c qemu-omap/hw/tusb6010.c
+--- 4242/hw/tusb6010.c 2008-04-23 12:18:54.000000000 +0100
++++ qemu-omap/hw/tusb6010.c 2008-04-23 09:57:56.000000000 +0100
+@@ -287,9 +287,6 @@
+ /* TODO: How is this signalled? */
+ }
+
+-extern CPUReadMemoryFunc *musb_read[];
+-extern CPUWriteMemoryFunc *musb_write[];
+-
+ static uint32_t tusb_async_readb(void *opaque, target_phys_addr_t addr)
+ {
+ struct tusb_s *s = (struct tusb_s *) opaque;
+diff -urN 4242/hw/usb.h qemu-omap/hw/usb.h
+--- 4242/hw/usb.h 2008-04-23 12:18:54.000000000 +0100
++++ qemu-omap/hw/usb.h 2008-04-23 09:57:56.000000000 +0100
+@@ -219,6 +219,9 @@
+ /* usb-msd.c */
+ USBDevice *usb_msd_init(const char *filename);
+
++/* usb-net.c */
++USBDevice *usb_net_init(NICInfo *nd);
++
+ /* usb-wacom.c */
+ USBDevice *usb_wacom_init(void);
+
+@@ -254,3 +257,7 @@
+ uint32_t musb_core_intr_get(struct musb_s *s);
+ void musb_core_intr_clear(struct musb_s *s, uint32_t mask);
+ void musb_set_size(struct musb_s *s, int epnum, int size, int is_tx);
++#ifdef NEED_CPU_H
++extern CPUReadMemoryFunc *musb_read[];
++extern CPUWriteMemoryFunc *musb_write[];
++#endif
+diff -urN 4242/hw/usb-hub.c qemu-omap/hw/usb-hub.c
+--- 4242/hw/usb-hub.c 2008-04-23 11:43:37.000000000 +0100
++++ qemu-omap/hw/usb-hub.c 2008-04-23 09:57:56.000000000 +0100
+@@ -146,8 +146,8 @@
+ 0x07, /* u8 ep_bLength; */
+ 0x05, /* u8 ep_bDescriptorType; Endpoint */
+ 0x81, /* u8 ep_bEndpointAddress; IN Endpoint 1 */
+- 0x03, /* u8 ep_bmAttributes; Interrupt */
+- 0x02, 0x00, /* u16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) */
++ 0x03, /* u8 ep_bmAttributes; Interrupt */
++ 0x02, 0x00, /* u16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) */
+ 0xff /* u8 ep_bInterval; (255ms -- usb 2.0 spec) */
+ };
+
+diff -urN 4242/hw/usb-net.c qemu-omap/hw/usb-net.c
+--- 4242/hw/usb-net.c 1970-01-01 01:00:00.000000000 +0100
++++ qemu-omap/hw/usb-net.c 2008-04-23 09:57:56.000000000 +0100
+@@ -0,0 +1,1334 @@
++/*
++ * QEMU USB Net devices
++ *
++ * Copyright (c) 2006 Thomas Sailer
++ * based on usb-hid.c Copyright (c) 2005 Fabrice Bellard
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to deal
++ * in the Software without restriction, including without limitation the rights
++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ * copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++ * THE SOFTWARE.
++ */
++
++#include "qemu-common.h"
++#include "usb.h"
++#include "net.h"
++#include "../audio/sys-queue.h"
++
++typedef uint32_t __le32;
++#include "ndis.h"
++
++/*#define TRAFFIC_DEBUG*/
++/* Thanks to NetChip Technologies for donating this product ID.
++ * It's for devices with only CDC Ethernet configurations.
++ */
++#define CDC_VENDOR_NUM 0x0525 /* NetChip */
++#define CDC_PRODUCT_NUM 0xa4a1 /* Linux-USB Ethernet Gadget */
++/* For hardware that can talk RNDIS and either of the above protocols,
++ * use this ID ... the windows INF files will know it.
++ */
++#define RNDIS_VENDOR_NUM 0x0525 /* NetChip */
++#define RNDIS_PRODUCT_NUM 0xa4a2 /* Ethernet/RNDIS Gadget */
++
++#define STRING_MANUFACTURER 1
++#define STRING_PRODUCT 2
++#define STRING_ETHADDR 3
++#define STRING_DATA 4
++#define STRING_CONTROL 5
++#define STRING_RNDIS_CONTROL 6
++#define STRING_CDC 7
++#define STRING_SUBSET 8
++#define STRING_RNDIS 9
++#define STRING_SERIALNUMBER 10
++
++#define DEV_CONFIG_VALUE 1 /* cdc or subset */
++#define DEV_RNDIS_CONFIG_VALUE 2 /* rndis; optional */
++
++#define USB_CDC_SUBCLASS_ACM 0x02
++#define USB_CDC_SUBCLASS_ETHERNET 0x06
++
++#define USB_CDC_PROTO_NONE 0
++#define USB_CDC_ACM_PROTO_VENDOR 0xff
++
++#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */
++#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */
++#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
++#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
++#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
++
++#define USB_DT_CS_INTERFACE 0x24
++#define USB_DT_CS_ENDPOINT 0x25
++
++#define ClassInterfaceRequest \
++ ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE)<<8)
++#define ClassInterfaceOutRequest \
++ ((USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE)<<8)
++
++#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00
++#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01
++#define USB_CDC_REQ_SET_LINE_CODING 0x20
++#define USB_CDC_REQ_GET_LINE_CODING 0x21
++#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22
++#define USB_CDC_REQ_SEND_BREAK 0x23
++#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
++#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
++#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
++#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
++#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
++
++#define USB_ENDPOINT_XFER_BULK 2
++#define USB_ENDPOINT_XFER_INT 3
++
++#define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */
++#define STATUS_BYTECOUNT 16 /* 8 byte header + data */
++
++#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
++
++/*
++ * mostly the same descriptor as the linux gadget rndis driver
++ */
++static const uint8_t qemu_net_dev_descriptor[] = {
++ 0x12, /* u8 bLength; */
++ USB_DT_DEVICE, /* u8 bDescriptorType; Device */
++ 0x00, 0x02, /* u16 bcdUSB; v2.0 */
++ USB_CLASS_COMM, /* u8 bDeviceClass; */
++ 0x00, /* u8 bDeviceSubClass; */
++ 0x00, /* u8 bDeviceProtocol; [ low/full speeds only ] */
++ 0x40, /* u8 bMaxPacketSize0 */
++ RNDIS_VENDOR_NUM & 0xff, RNDIS_VENDOR_NUM >> 8, /* u16 idVendor; */
++ RNDIS_PRODUCT_NUM & 0xff, RNDIS_PRODUCT_NUM >> 8, /* u16 idProduct; */
++ 0x00, 0x00, /* u16 bcdDevice */
++ STRING_MANUFACTURER, /* u8 iManufacturer; */
++ STRING_PRODUCT, /* u8 iProduct; */
++ STRING_SERIALNUMBER, /* u8 iSerialNumber; */
++ 0x02 /* u8 bNumConfigurations; */
++};
++
++static const uint8_t qemu_net_rndis_config_descriptor[] = {
++ /* Configuration Descriptor */
++ 0x09, /* u8 bLength */
++ USB_DT_CONFIG, /* u8 bDescriptorType */
++ 0x43, 0x00, /* le16 wTotalLength */
++ 0x02, /* u8 bNumInterfaces */
++ DEV_RNDIS_CONFIG_VALUE, /* u8 bConfigurationValue */
++ STRING_RNDIS, /* u8 iConfiguration */
++ 0xc0, /* u8 bmAttributes */
++ 0x32, /* u8 bMaxPower */
++ /* RNDIS Control Interface */
++ 0x09, /* u8 bLength */
++ USB_DT_INTERFACE, /* u8 bDescriptorType */
++ 0x00, /* u8 bInterfaceNumber */
++ 0x00, /* u8 bAlternateSetting */
++ 0x01, /* u8 bNumEndpoints */
++ USB_CLASS_COMM, /* u8 bInterfaceClass */
++ USB_CDC_SUBCLASS_ACM, /* u8 bInterfaceSubClass */
++ USB_CDC_ACM_PROTO_VENDOR, /* u8 bInterfaceProtocol */
++ STRING_RNDIS_CONTROL, /* u8 iInterface */
++ /* Header Descriptor */
++ 0x05, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_HEADER_TYPE, /* u8 bDescriptorSubType */
++ 0x10, 0x01, /* le16 bcdCDC */
++ /* Call Management Descriptor */
++ 0x05, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_CALL_MANAGEMENT_TYPE, /* u8 bDescriptorSubType */
++ 0x00, /* u8 bmCapabilities */
++ 0x01, /* u8 bDataInterface */
++ /* ACM Descriptor */
++ 0x04, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_ACM_TYPE, /* u8 bDescriptorSubType */
++ 0x00, /* u8 bmCapabilities */
++ /* Union Descriptor */
++ 0x05, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_UNION_TYPE, /* u8 bDescriptorSubType */
++ 0x00, /* u8 bMasterInterface0 */
++ 0x01, /* u8 bSlaveInterface0 */
++ /* Status Descriptor */
++ 0x07, /* u8 bLength */
++ USB_DT_ENDPOINT, /* u8 bDescriptorType */
++ USB_DIR_IN | 1, /* u8 bEndpointAddress */
++ USB_ENDPOINT_XFER_INT, /* u8 bmAttributes */
++ STATUS_BYTECOUNT & 0xff, STATUS_BYTECOUNT >> 8, /* le16 wMaxPacketSize */
++ 1 << LOG2_STATUS_INTERVAL_MSEC, /* u8 bInterval */
++ /* RNDIS Data Interface */
++ 0x09, /* u8 bLength */
++ USB_DT_INTERFACE, /* u8 bDescriptorType */
++ 0x01, /* u8 bInterfaceNumber */
++ 0x00, /* u8 bAlternateSetting */
++ 0x02, /* u8 bNumEndpoints */
++ USB_CLASS_CDC_DATA, /* u8 bInterfaceClass */
++ 0x00, /* u8 bInterfaceSubClass */
++ 0x00, /* u8 bInterfaceProtocol */
++ STRING_DATA, /* u8 iInterface */
++ /* Source Endpoint */
++ 0x07, /* u8 bLength */
++ USB_DT_ENDPOINT, /* u8 bDescriptorType */
++ USB_DIR_IN | 2, /* u8 bEndpointAddress */
++ USB_ENDPOINT_XFER_BULK, /* u8 bmAttributes */
++ 0x40, 0x00, /* le16 wMaxPacketSize */
++ 0x00, /* u8 bInterval */
++ /* Sink Endpoint */
++ 0x07, /* u8 bLength */
++ USB_DT_ENDPOINT, /* u8 bDescriptorType */
++ USB_DIR_OUT | 2, /* u8 bEndpointAddress */
++ USB_ENDPOINT_XFER_BULK, /* u8 bmAttributes */
++ 0x40, 0x00, /* le16 wMaxPacketSize */
++ 0x00 /* u8 bInterval */
++};
++
++static const uint8_t qemu_net_cdc_config_descriptor[] = {
++ /* Configuration Descriptor */
++ 0x09, /* u8 bLength */
++ USB_DT_CONFIG, /* u8 bDescriptorType */
++ 0x50, 0x00, /* le16 wTotalLength */
++ 0x02, /* u8 bNumInterfaces */
++ DEV_CONFIG_VALUE, /* u8 bConfigurationValue */
++ STRING_CDC, /* u8 iConfiguration */
++ 0xc0, /* u8 bmAttributes */
++ 0x32, /* u8 bMaxPower */
++ /* CDC Control Interface */
++ 0x09, /* u8 bLength */
++ USB_DT_INTERFACE, /* u8 bDescriptorType */
++ 0x00, /* u8 bInterfaceNumber */
++ 0x00, /* u8 bAlternateSetting */
++ 0x01, /* u8 bNumEndpoints */
++ USB_CLASS_COMM, /* u8 bInterfaceClass */
++ USB_CDC_SUBCLASS_ETHERNET, /* u8 bInterfaceSubClass */
++ USB_CDC_PROTO_NONE, /* u8 bInterfaceProtocol */
++ STRING_CONTROL, /* u8 iInterface */
++ /* Header Descriptor */
++ 0x05, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_HEADER_TYPE, /* u8 bDescriptorSubType */
++ 0x10, 0x01, /* le16 bcdCDC */
++ /* Union Descriptor */
++ 0x05, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_UNION_TYPE, /* u8 bDescriptorSubType */
++ 0x00, /* u8 bMasterInterface0 */
++ 0x01, /* u8 bSlaveInterface0 */
++ /* Ethernet Descriptor */
++ 0x0d, /* u8 bLength */
++ USB_DT_CS_INTERFACE, /* u8 bDescriptorType */
++ USB_CDC_ETHERNET_TYPE, /* u8 bDescriptorSubType */
++ STRING_ETHADDR, /* u8 iMACAddress */
++ 0x00, 0x00, 0x00, 0x00, /* le32 bmEthernetStatistics */
++ ETH_FRAME_LEN & 0xff, ETH_FRAME_LEN >> 8, /* le16 wMaxSegmentSize */
++ 0x00, 0x00, /* le16 wNumberMCFilters */
++ 0x00, /* u8 bNumberPowerFilters */
++ /* Status Descriptor */
++ 0x07, /* u8 bLength */
++ USB_DT_ENDPOINT, /* u8 bDescriptorType */
++ USB_DIR_IN | 1, /* u8 bEndpointAddress */
++ USB_ENDPOINT_XFER_INT, /* u8 bmAttributes */
++ STATUS_BYTECOUNT & 0xff, STATUS_BYTECOUNT >> 8, /* le16 wMaxPacketSize */
++ 1 << LOG2_STATUS_INTERVAL_MSEC, /* u8 bInterval */
++ /* CDC Data (nop) Interface */
++ 0x09, /* u8 bLength */
++ USB_DT_INTERFACE, /* u8 bDescriptorType */
++ 0x01, /* u8 bInterfaceNumber */
++ 0x00, /* u8 bAlternateSetting */
++ 0x00, /* u8 bNumEndpoints */
++ USB_CLASS_CDC_DATA, /* u8 bInterfaceClass */
++ 0x00, /* u8 bInterfaceSubClass */
++ 0x00, /* u8 bInterfaceProtocol */
++ 0x00, /* u8 iInterface */
++ /* CDC Data Interface */
++ 0x09, /* u8 bLength */
++ USB_DT_INTERFACE, /* u8 bDescriptorType */
++ 0x01, /* u8 bInterfaceNumber */
++ 0x01, /* u8 bAlternateSetting */
++ 0x02, /* u8 bNumEndpoints */
++ USB_CLASS_CDC_DATA, /* u8 bInterfaceClass */
++ 0x00, /* u8 bInterfaceSubClass */
++ 0x00, /* u8 bInterfaceProtocol */
++ STRING_DATA, /* u8 iInterface */
++ /* Source Endpoint */
++ 0x07, /* u8 bLength */
++ USB_DT_ENDPOINT, /* u8 bDescriptorType */
++ USB_DIR_IN | 2, /* u8 bEndpointAddress */
++ USB_ENDPOINT_XFER_BULK, /* u8 bmAttributes */
++ 0x40, 0x00, /* le16 wMaxPacketSize */
++ 0x00, /* u8 bInterval */
++ /* Sink Endpoint */
++ 0x07, /* u8 bLength */
++ USB_DT_ENDPOINT, /* u8 bDescriptorType */
++ USB_DIR_OUT | 2, /* u8 bEndpointAddress */
++ USB_ENDPOINT_XFER_BULK, /* u8 bmAttributes */
++ 0x40, 0x00, /* le16 wMaxPacketSize */
++ 0x00 /* u8 bInterval */
++};
++
++/*
++ * RNDIS Status
++ */
++
++#define RNDIS_MAXIMUM_FRAME_SIZE 1518
++#define RNDIS_MAX_TOTAL_SIZE 1558
++
++/* Remote NDIS Versions */
++#define RNDIS_MAJOR_VERSION 1
++#define RNDIS_MINOR_VERSION 0
++
++/* Status Values */
++#define RNDIS_STATUS_SUCCESS 0x00000000U /* Success */
++#define RNDIS_STATUS_FAILURE 0xC0000001U /* Unspecified error */
++#define RNDIS_STATUS_INVALID_DATA 0xC0010015U /* Invalid data */
++#define RNDIS_STATUS_NOT_SUPPORTED 0xC00000BBU /* Unsupported request */
++#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BU /* Device connected */
++#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CU /* Device disconnected */
++
++/* Message Set for Connectionless (802.3) Devices */
++#define REMOTE_NDIS_PACKET_MSG 0x00000001U
++#define REMOTE_NDIS_INITIALIZE_MSG 0x00000002U /* Initialize device */
++#define REMOTE_NDIS_HALT_MSG 0x00000003U
++#define REMOTE_NDIS_QUERY_MSG 0x00000004U
++#define REMOTE_NDIS_SET_MSG 0x00000005U
++#define REMOTE_NDIS_RESET_MSG 0x00000006U
++#define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007U
++#define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008U
++
++/* Message completion */
++#define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002U
++#define REMOTE_NDIS_QUERY_CMPLT 0x80000004U
++#define REMOTE_NDIS_SET_CMPLT 0x80000005U
++#define REMOTE_NDIS_RESET_CMPLT 0x80000006U
++#define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008U
++
++/* Device Flags */
++#define RNDIS_DF_CONNECTIONLESS 0x00000001U
++#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002U
++
++#define RNDIS_MEDIUM_802_3 0x00000000U
++
++/* from drivers/net/sk98lin/h/skgepnmi.h */
++#define OID_PNP_CAPABILITIES 0xFD010100
++#define OID_PNP_SET_POWER 0xFD010101
++#define OID_PNP_QUERY_POWER 0xFD010102
++#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103
++#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104
++#define OID_PNP_ENABLE_WAKE_UP 0xFD010106
++
++typedef struct rndis_init_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 MajorVersion;
++ __le32 MinorVersion;
++ __le32 MaxTransferSize;
++} rndis_init_msg_type;
++
++typedef struct rndis_init_cmplt_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 Status;
++ __le32 MajorVersion;
++ __le32 MinorVersion;
++ __le32 DeviceFlags;
++ __le32 Medium;
++ __le32 MaxPacketsPerTransfer;
++ __le32 MaxTransferSize;
++ __le32 PacketAlignmentFactor;
++ __le32 AFListOffset;
++ __le32 AFListSize;
++} rndis_init_cmplt_type;
++
++typedef struct rndis_halt_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++} rndis_halt_msg_type;
++
++typedef struct rndis_query_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 OID;
++ __le32 InformationBufferLength;
++ __le32 InformationBufferOffset;
++ __le32 DeviceVcHandle;
++} rndis_query_msg_type;
++
++typedef struct rndis_query_cmplt_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 Status;
++ __le32 InformationBufferLength;
++ __le32 InformationBufferOffset;
++} rndis_query_cmplt_type;
++
++typedef struct rndis_set_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 OID;
++ __le32 InformationBufferLength;
++ __le32 InformationBufferOffset;
++ __le32 DeviceVcHandle;
++} rndis_set_msg_type;
++
++typedef struct rndis_set_cmplt_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 Status;
++} rndis_set_cmplt_type;
++
++typedef struct rndis_reset_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 Reserved;
++} rndis_reset_msg_type;
++
++typedef struct rndis_reset_cmplt_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 Status;
++ __le32 AddressingReset;
++} rndis_reset_cmplt_type;
++
++typedef struct rndis_indicate_status_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 Status;
++ __le32 StatusBufferLength;
++ __le32 StatusBufferOffset;
++} rndis_indicate_status_msg_type;
++
++typedef struct rndis_keepalive_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++} rndis_keepalive_msg_type;
++
++typedef struct rndis_keepalive_cmplt_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 RequestID;
++ __le32 Status;
++} rndis_keepalive_cmplt_type;
++
++struct rndis_packet_msg_type
++{
++ __le32 MessageType;
++ __le32 MessageLength;
++ __le32 DataOffset;
++ __le32 DataLength;
++ __le32 OOBDataOffset;
++ __le32 OOBDataLength;
++ __le32 NumOOBDataElements;
++ __le32 PerPacketInfoOffset;
++ __le32 PerPacketInfoLength;
++ __le32 VcHandle;
++ __le32 Reserved;
++};
++
++struct rndis_config_parameter
++{
++ __le32 ParameterNameOffset;
++ __le32 ParameterNameLength;
++ __le32 ParameterType;
++ __le32 ParameterValueOffset;
++ __le32 ParameterValueLength;
++};
++
++/* implementation specific */
++enum rndis_state
++{
++ RNDIS_UNINITIALIZED,
++ RNDIS_INITIALIZED,
++ RNDIS_DATA_INITIALIZED,
++};
++
++static const uint32_t oid_supported_list[] =
++{
++ /* the general stuff */
++ OID_GEN_SUPPORTED_LIST,
++ OID_GEN_HARDWARE_STATUS,
++ OID_GEN_MEDIA_SUPPORTED,
++ OID_GEN_MEDIA_IN_USE,
++ OID_GEN_MAXIMUM_FRAME_SIZE,
++ OID_GEN_LINK_SPEED,
++ OID_GEN_TRANSMIT_BLOCK_SIZE,
++ OID_GEN_RECEIVE_BLOCK_SIZE,
++ OID_GEN_VENDOR_ID,
++ OID_GEN_VENDOR_DESCRIPTION,
++ OID_GEN_VENDOR_DRIVER_VERSION,
++ OID_GEN_CURRENT_PACKET_FILTER,
++ OID_GEN_MAXIMUM_TOTAL_SIZE,
++ OID_GEN_MEDIA_CONNECT_STATUS,
++ OID_GEN_PHYSICAL_MEDIUM,
++ /* the statistical stuff */
++ OID_GEN_XMIT_OK,
++ OID_GEN_RCV_OK,
++ OID_GEN_XMIT_ERROR,
++ OID_GEN_RCV_ERROR,
++ OID_GEN_RCV_NO_BUFFER,
++ /* mandatory 802.3 */
++ /* the general stuff */
++ OID_802_3_PERMANENT_ADDRESS,
++ OID_802_3_CURRENT_ADDRESS,
++ OID_802_3_MULTICAST_LIST,
++ OID_802_3_MAC_OPTIONS,
++ OID_802_3_MAXIMUM_LIST_SIZE,
++
++ /* the statistical stuff */
++ OID_802_3_RCV_ERROR_ALIGNMENT,
++ OID_802_3_XMIT_ONE_COLLISION,
++ OID_802_3_XMIT_MORE_COLLISIONS
++};
++
++struct rndis_response {
++ TAILQ_ENTRY(rndis_response) entries;
++ uint32_t length;
++ uint8_t buf[0];
++};
++
++
++typedef struct USBNetState {
++ USBDevice dev;
++
++ unsigned int rndis;
++ enum rndis_state rndis_state;
++ uint32_t medium;
++ uint32_t speed;
++ uint32_t media_state;
++ uint16_t filter;
++ uint32_t vendorid;
++ uint8_t mac[6];
++
++ unsigned int out_ptr;
++ uint8_t out_buf[2048];
++
++ USBPacket *inpkt;
++ unsigned int in_ptr, in_len;
++ uint8_t in_buf[2048];
++
++ VLANClientState *vc;
++ TAILQ_HEAD(rndis_resp_head, rndis_response) rndis_resp;
++} USBNetState;
++
++
++static int ndis_query(USBNetState *s, uint32_t oid, uint8_t *inbuf, unsigned int inlen, uint8_t *outbuf)
++{
++ switch (oid) {
++ /* general oids (table 4-1) */
++ /* mandatory */
++ case OID_GEN_SUPPORTED_LIST:
++ {
++ unsigned int i, count = sizeof(oid_supported_list) / sizeof(uint32_t);
++ for (i = 0; i < count; i++)
++ ((__le32 *)outbuf)[i] = cpu_to_le32(oid_supported_list[i]);
++ return sizeof(oid_supported_list);
++ }
++
++ /* mandatory */
++ case OID_GEN_HARDWARE_STATUS:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_MEDIA_SUPPORTED:
++ *((__le32 *)outbuf) = cpu_to_le32(s->medium);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_MEDIA_IN_USE:
++ *((__le32 *)outbuf) = cpu_to_le32(s->medium);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_MAXIMUM_FRAME_SIZE:
++ *((__le32 *)outbuf) = cpu_to_le32(ETH_FRAME_LEN);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_LINK_SPEED:
++ *((__le32 *)outbuf) = cpu_to_le32(s->speed);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_TRANSMIT_BLOCK_SIZE:
++ *((__le32 *)outbuf) = cpu_to_le32(ETH_FRAME_LEN);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_RECEIVE_BLOCK_SIZE:
++ *((__le32 *)outbuf) = cpu_to_le32(ETH_FRAME_LEN);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_VENDOR_ID:
++ *((__le32 *)outbuf) = cpu_to_le32(0x1234);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_VENDOR_DESCRIPTION:
++ strcpy(outbuf, "QEMU USB RNDIS Net");
++ return strlen(outbuf) + 1;
++
++ case OID_GEN_VENDOR_DRIVER_VERSION:
++ *((__le32 *)outbuf) = cpu_to_le32(1);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_CURRENT_PACKET_FILTER:
++ *((__le32 *)outbuf) = cpu_to_le32(s->filter);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_MAXIMUM_TOTAL_SIZE:
++ *((__le32 *)outbuf) = cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_MEDIA_CONNECT_STATUS:
++ *((__le32 *)outbuf) = cpu_to_le32(s->media_state);
++ return sizeof(__le32);
++
++ case OID_GEN_PHYSICAL_MEDIUM:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ case OID_GEN_MAC_OPTIONS:
++ *((__le32 *)outbuf) = cpu_to_le32(NDIS_MAC_OPTION_RECEIVE_SERIALIZED | NDIS_MAC_OPTION_FULL_DUPLEX);
++ return sizeof(__le32);
++
++ /* statistics OIDs (table 4-2) */
++ /* mandatory */
++ case OID_GEN_XMIT_OK:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_RCV_OK:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_XMIT_ERROR:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_RCV_ERROR:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_GEN_RCV_NO_BUFFER:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* ieee802.3 OIDs (table 4-3) */
++ /* mandatory */
++ case OID_802_3_PERMANENT_ADDRESS:
++ memcpy(outbuf, s->mac, 6);
++ return 6;
++
++ /* mandatory */
++ case OID_802_3_CURRENT_ADDRESS:
++ memcpy(outbuf, s->mac, 6);
++ return 6;
++
++ /* mandatory */
++ case OID_802_3_MULTICAST_LIST:
++ *((__le32 *)outbuf) = cpu_to_le32(0xE0000000);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_802_3_MAXIMUM_LIST_SIZE:
++ *((__le32 *)outbuf) = cpu_to_le32(1);
++ return sizeof(__le32);
++
++ case OID_802_3_MAC_OPTIONS:
++ return 0;
++
++ /* ieee802.3 statistics OIDs (table 4-4) */
++ /* mandatory */
++ case OID_802_3_RCV_ERROR_ALIGNMENT:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_802_3_XMIT_ONE_COLLISION:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ /* mandatory */
++ case OID_802_3_XMIT_MORE_COLLISIONS:
++ *((__le32 *)outbuf) = cpu_to_le32(0);
++ return sizeof(__le32);
++
++ default:
++ fprintf(stderr, "usbnet: unknown OID 0x%08x\n", oid);
++ return 0;
++ }
++ return -1;
++}
++
++static int ndis_set(USBNetState *s, uint32_t oid, uint8_t *inbuf, unsigned int inlen)
++{
++ switch (oid) {
++ case OID_GEN_CURRENT_PACKET_FILTER:
++ s->filter = le32_to_cpup((__le32 *)inbuf);
++ if (s->filter) {
++ s->rndis_state = RNDIS_DATA_INITIALIZED;
++ } else {
++ s->rndis_state = RNDIS_INITIALIZED;
++ }
++ return 0;
++
++ case OID_802_3_MULTICAST_LIST:
++ return 0;
++
++ }
++ return -1;
++}
++
++static int rndis_get_response(USBNetState *s, uint8_t *buf)
++{
++ int ret = 0;
++ struct rndis_response *r = s->rndis_resp.tqh_first;
++ if (!r)
++ return ret;
++ TAILQ_REMOVE(&s->rndis_resp, r, entries);
++ ret = r->length;
++ memcpy(buf, r->buf, r->length);
++ qemu_free(r);
++ return ret;
++}
++
++static void *rndis_queue_response(USBNetState *s, unsigned int length)
++{
++ struct rndis_response *r = qemu_mallocz(sizeof(struct rndis_response) + length);
++ if (!r)
++ return NULL;
++ TAILQ_INSERT_TAIL(&s->rndis_resp, r, entries);
++ r->length = length;
++ return &r->buf[0];
++}
++
++static void rndis_clear_responsequeue(USBNetState *s)
++{
++ struct rndis_response *r;
++
++ while ((r = s->rndis_resp.tqh_first)) {
++ TAILQ_REMOVE(&s->rndis_resp, r, entries);
++ qemu_free(r);
++ }
++}
++
++static int rndis_init_response(USBNetState *s, rndis_init_msg_type *buf)
++{
++ rndis_init_cmplt_type *resp = rndis_queue_response(s, sizeof(rndis_init_cmplt_type));
++ if (!resp)
++ return USB_RET_STALL;
++ resp->MessageType = cpu_to_le32(REMOTE_NDIS_INITIALIZE_CMPLT);
++ resp->MessageLength = cpu_to_le32(sizeof(rndis_init_cmplt_type));
++ resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
++ resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
++ resp->MajorVersion = cpu_to_le32(RNDIS_MAJOR_VERSION);
++ resp->MinorVersion = cpu_to_le32(RNDIS_MINOR_VERSION);
++ resp->DeviceFlags = cpu_to_le32(RNDIS_DF_CONNECTIONLESS);
++ resp->Medium = cpu_to_le32(RNDIS_MEDIUM_802_3);
++ resp->MaxPacketsPerTransfer = cpu_to_le32(1);
++ resp->MaxTransferSize = cpu_to_le32(ETH_FRAME_LEN + sizeof(struct rndis_packet_msg_type) + 22);
++ resp->PacketAlignmentFactor = cpu_to_le32(0);
++ resp->AFListOffset = cpu_to_le32(0);
++ resp->AFListSize = cpu_to_le32(0);
++ return 0;
++}
++
++static int rndis_query_response(USBNetState *s, rndis_query_msg_type *buf, unsigned int length)
++{
++ rndis_query_cmplt_type *resp;
++ uint8_t infobuf[sizeof(oid_supported_list)]; /* oid_supported_list is the largest data reply */
++ uint32_t bufoffs, buflen;
++ int infobuflen;
++ unsigned int resplen;
++ bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
++ buflen = le32_to_cpu(buf->InformationBufferLength);
++ if (bufoffs + buflen > length)
++ return USB_RET_STALL;
++ infobuflen = ndis_query(s, le32_to_cpu(buf->OID), bufoffs + (uint8_t *)buf, buflen, infobuf);
++ resplen = sizeof(rndis_query_cmplt_type) + ((infobuflen < 0) ? 0 : infobuflen);
++ resp = rndis_queue_response(s, resplen);
++ if (!resp)
++ return USB_RET_STALL;
++ resp->MessageType = cpu_to_le32(REMOTE_NDIS_QUERY_CMPLT);
++ resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
++ resp->MessageLength = cpu_to_le32(resplen);
++ if (infobuflen < 0) {
++ /* OID not supported */
++ resp->Status = cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED);
++ resp->InformationBufferLength = cpu_to_le32(0);
++ resp->InformationBufferOffset = cpu_to_le32(0);
++ return 0;
++ }
++ resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
++ resp->InformationBufferOffset = cpu_to_le32(infobuflen ? sizeof(rndis_query_cmplt_type) - 8 : 0);
++ resp->InformationBufferLength = cpu_to_le32(infobuflen);
++ memcpy(resp + 1, infobuf, infobuflen);
++ return 0;
++}
++
++static int rndis_set_response(USBNetState *s, rndis_set_msg_type *buf, unsigned int length)
++{
++ rndis_set_cmplt_type *resp = rndis_queue_response(s, sizeof(rndis_set_cmplt_type));
++ uint32_t bufoffs, buflen;
++ if (!resp)
++ return USB_RET_STALL;
++ bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
++ buflen = le32_to_cpu(buf->InformationBufferLength);
++ if (bufoffs + buflen > length)
++ return USB_RET_STALL;
++ int ret = ndis_set(s, le32_to_cpu(buf->OID), bufoffs + (uint8_t *)buf, buflen);
++ resp->MessageType = cpu_to_le32(REMOTE_NDIS_SET_CMPLT);
++ resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
++ resp->MessageLength = cpu_to_le32(sizeof(rndis_set_cmplt_type));
++ if (ret < 0) {
++ /* OID not supported */
++ resp->Status = cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED);
++ return 0;
++ }
++ resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
++ return 0;
++}
++
++static int rndis_reset_response(USBNetState *s, rndis_reset_msg_type *buf)
++{
++ rndis_reset_cmplt_type *resp = rndis_queue_response(s, sizeof(rndis_reset_cmplt_type));
++ if (!resp)
++ return USB_RET_STALL;
++ resp->MessageType = cpu_to_le32(REMOTE_NDIS_RESET_CMPLT);
++ resp->MessageLength = cpu_to_le32(sizeof(rndis_reset_cmplt_type));
++ resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
++ /* resent information */
++ resp->AddressingReset = cpu_to_le32(1);
++ return 0;
++}
++
++static int rndis_keepalive_response(USBNetState *s, rndis_keepalive_msg_type *buf)
++{
++ rndis_keepalive_cmplt_type *resp = rndis_queue_response(s, sizeof(rndis_keepalive_cmplt_type));
++ if (!resp)
++ return USB_RET_STALL;
++ resp->MessageType = cpu_to_le32(REMOTE_NDIS_KEEPALIVE_CMPLT);
++ resp->MessageLength = cpu_to_le32(sizeof(rndis_keepalive_cmplt_type));
++ resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
++ resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
++ return 0;
++}
++
++static int rndis_parse(USBNetState *s, uint8_t *data, int length)
++{
++ uint32_t MsgType, MsgLength;
++ __le32 *tmp = (__le32 *)data;
++ MsgType = le32_to_cpup(tmp++);
++ MsgLength = le32_to_cpup(tmp++);
++
++ switch (MsgType) {
++ case REMOTE_NDIS_INITIALIZE_MSG:
++ s->rndis_state = RNDIS_INITIALIZED;
++ return rndis_init_response(s, (rndis_init_msg_type *)data);
++
++ case REMOTE_NDIS_HALT_MSG:
++ s->rndis_state = RNDIS_UNINITIALIZED;
++ return 0;
++
++ case REMOTE_NDIS_QUERY_MSG:
++ return rndis_query_response(s, (rndis_query_msg_type *)data, length);
++
++ case REMOTE_NDIS_SET_MSG:
++ return rndis_set_response(s, (rndis_set_msg_type *)data, length);
++
++ case REMOTE_NDIS_RESET_MSG:
++ rndis_clear_responsequeue(s);
++ s->out_ptr = s->in_ptr = s->in_len = 0;
++ return rndis_reset_response(s, (rndis_reset_msg_type *)data);
++
++ case REMOTE_NDIS_KEEPALIVE_MSG:
++ /* For USB: host does this every 5 seconds */
++ return rndis_keepalive_response(s, (rndis_keepalive_msg_type *)data);
++ }
++ return USB_RET_STALL;
++}
++
++static void usb_net_handle_reset(USBDevice *dev)
++{
++}
++
++static int usb_net_handle_control(USBDevice *dev, int request, int value,
++ int index, int length, uint8_t *data)
++{
++ USBNetState *s = (USBNetState *)dev;
++ int ret = 0;
++
++ switch(request) {
++ case DeviceRequest | USB_REQ_GET_STATUS:
++ data[0] = (1 << USB_DEVICE_SELF_POWERED) |
++ (dev->remote_wakeup << USB_DEVICE_REMOTE_WAKEUP);
++ data[1] = 0x00;
++ ret = 2;
++ break;
++
++ case DeviceOutRequest | USB_REQ_CLEAR_FEATURE:
++ if (value == USB_DEVICE_REMOTE_WAKEUP) {
++ dev->remote_wakeup = 0;
++ } else {
++ goto fail;
++ }
++ ret = 0;
++ break;
++
++ case DeviceOutRequest | USB_REQ_SET_FEATURE:
++ if (value == USB_DEVICE_REMOTE_WAKEUP) {
++ dev->remote_wakeup = 1;
++ } else {
++ goto fail;
++ }
++ ret = 0;
++ break;
++
++ case DeviceOutRequest | USB_REQ_SET_ADDRESS:
++ dev->addr = value;
++ ret = 0;
++ break;
++
++ case ClassInterfaceOutRequest | USB_CDC_SEND_ENCAPSULATED_COMMAND:
++ if (!s->rndis || value || index != 0)
++ goto fail;
++#if TRAFFIC_DEBUG
++ {
++ unsigned int i;
++ fprintf(stderr, "SEND_ENCAPSULATED_COMMAND:");
++ for (i = 0; i < length; i++) {
++ if (!(i & 15))
++ fprintf(stderr, "\n%04X:", i);
++ fprintf(stderr, " %02X", data[i]);
++ }
++ fprintf(stderr, "\n\n");
++ }
++#endif
++ ret = rndis_parse(s, data, length);
++ break;
++
++ case ClassInterfaceRequest | USB_CDC_GET_ENCAPSULATED_RESPONSE:
++ if (!s->rndis || value || index != 0)
++ goto fail;
++ ret = rndis_get_response(s, data);
++ if (!ret) {
++ data[0] = 0;
++ ret = 1;
++ }
++#if TRAFFIC_DEBUG
++ {
++ unsigned int i;
++ fprintf(stderr, "GET_ENCAPSULATED_RESPONSE:");
++ for (i = 0; i < ret; i++) {
++ if (!(i & 15))
++ fprintf(stderr, "\n%04X:", i);
++ fprintf(stderr, " %02X", data[i]);
++ }
++ fprintf(stderr, "\n\n");
++ }
++#endif
++ break;
++
++ case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
++ switch(value >> 8) {
++ case USB_DT_DEVICE:
++ ret = sizeof(qemu_net_dev_descriptor);
++ memcpy(data, qemu_net_dev_descriptor, ret);
++ break;
++
++ case USB_DT_CONFIG:
++ switch (value & 0xff) {
++ case 0:
++ ret = sizeof(qemu_net_rndis_config_descriptor);
++ memcpy(data, qemu_net_rndis_config_descriptor,
++ ret);
++ break;
++
++ case 1:
++ ret = sizeof(qemu_net_cdc_config_descriptor);
++ memcpy(data, qemu_net_cdc_config_descriptor,
++ ret);
++ break;
++
++ default:
++ goto fail;
++ }
++ data[2] = ret & 0xff;
++ data[3] = ret >> 8;
++ break;
++
++ case USB_DT_STRING:
++ switch (value & 0xff) {
++ case 0:
++ /* language ids */
++ data[0] = 4;
++ data[1] = 3;
++ data[2] = 0x09;
++ data[3] = 0x04;
++ ret = 4;
++ break;
++
++ case STRING_MANUFACTURER:
++ ret = set_usb_string(data, "QEMU");
++ break;
++
++ case STRING_PRODUCT:
++ ret = set_usb_string(data, "RNDIS/QEMU USB Network Device");
++ break;
++
++ case STRING_ETHADDR:
++ ret = set_usb_string(data, "400102030405");
++ break;
++
++ case STRING_DATA:
++ ret = set_usb_string(data, "QEMU USB Net Data Interface");
++ break;
++
++ case STRING_CONTROL:
++ ret = set_usb_string(data, "QEMU USB Net Control Interface");
++ break;
++
++ case STRING_RNDIS_CONTROL:
++ ret = set_usb_string(data, "QEMU USB Net RNDIS Control Interface");
++ break;
++
++ case STRING_CDC:
++ ret = set_usb_string(data, "QEMU USB Net CDC");
++ break;
++
++ case STRING_SUBSET:
++ ret = set_usb_string(data, "QEMU USB Net Subset");
++ break;
++
++ case STRING_RNDIS:
++ ret = set_usb_string(data, "QEMU USB Net RNDIS");
++ break;
++
++ case STRING_SERIALNUMBER:
++ ret = set_usb_string(data, "1");
++ break;
++
++ default:
++ goto fail;
++ }
++ break;
++
++ default:
++ goto fail;
++ }
++ break;
++
++ case DeviceRequest | USB_REQ_GET_CONFIGURATION:
++ data[0] = s->rndis ? DEV_RNDIS_CONFIG_VALUE : DEV_CONFIG_VALUE;
++ ret = 1;
++ break;
++
++ case DeviceOutRequest | USB_REQ_SET_CONFIGURATION:
++ switch (value & 0xff) {
++ case DEV_CONFIG_VALUE:
++ s->rndis = 0;
++ break;
++
++ case DEV_RNDIS_CONFIG_VALUE:
++ s->rndis = 1;
++ break;
++
++ default:
++ goto fail;
++ }
++ ret = 0;
++ break;
++
++ case DeviceRequest | USB_REQ_GET_INTERFACE:
++ case InterfaceRequest | USB_REQ_GET_INTERFACE:
++ data[0] = 0;
++ ret = 1;
++ break;
++
++ case DeviceOutRequest | USB_REQ_SET_INTERFACE:
++ case InterfaceOutRequest | USB_REQ_SET_INTERFACE:
++ ret = 0;
++ break;
++
++ default:
++ fail:
++ fprintf(stderr, "usbnet: failed control transaction: request 0x%x value 0x%x index 0x%x length 0x%x\n",
++ request, value, index, length);
++ ret = USB_RET_STALL;
++ break;
++ }
++ return ret;
++}
++
++static int usb_net_handle_statusin(USBNetState *s, USBPacket *p)
++{
++ int ret = 8;
++ if (p->len < 8)
++ return USB_RET_STALL;
++ ((__le32 *)p->data)[0] = cpu_to_le32(1);
++ ((__le32 *)p->data)[1] = cpu_to_le32(0);
++ if (!s->rndis_resp.tqh_first)
++ ret = USB_RET_NAK;
++#if DEBUG
++ fprintf(stderr, "usbnet: interrupt poll len %u return %d", p->len, ret);
++ {
++ int i;
++ fprintf(stderr, ":");
++ for (i = 0; i < ret; i++) {
++ if (!(i & 15))
++ fprintf(stderr, "\n%04X:", i);
++ fprintf(stderr, " %02X", p->data[i]);
++ }
++ fprintf(stderr, "\n\n");
++ }
++#endif
++ return ret;
++}
++
++static int usb_net_handle_datain(USBNetState *s, USBPacket *p)
++{
++ int ret = USB_RET_NAK;
++
++ if (s->in_ptr > s->in_len) {
++ s->in_ptr = s->in_len = 0;
++ ret = USB_RET_NAK;
++ return ret;
++ }
++ if (!s->in_len) {
++ ret = USB_RET_NAK;
++ return ret;
++ }
++ ret = s->in_len - s->in_ptr;
++ if (ret > p->len)
++ ret = p->len;
++ memcpy(p->data, &s->in_buf[s->in_ptr], ret);
++ s->in_ptr += ret;
++ if (s->in_ptr >= s->in_len && (s->rndis || (s->in_len & (64-1)) || !ret)) {
++ /* no short packet necessary */
++ s->in_ptr = s->in_len = 0;
++ }
++#if TRAFFIC_DEBUG
++ fprintf(stderr, "usbnet: data in len %u return %d", p->len, ret);
++ {
++ int i;
++ fprintf(stderr, ":");
++ for (i = 0; i < ret; i++) {
++ if (!(i & 15))
++ fprintf(stderr, "\n%04X:", i);
++ fprintf(stderr, " %02X", p->data[i]);
++ }
++ fprintf(stderr, "\n\n");
++ }
++#endif
++ return ret;
++}
++
++static int usb_net_handle_dataout(USBNetState *s, USBPacket *p)
++{
++ int ret = p->len;
++ int sz = sizeof(s->out_buf) - s->out_ptr;
++ struct rndis_packet_msg_type *msg = (struct rndis_packet_msg_type *)s->out_buf;
++ uint32_t len;
++
++#if TRAFFIC_DEBUG
++ fprintf(stderr, "usbnet: data out len %u\n", p->len);
++ {
++ int i;
++ fprintf(stderr, ":");
++ for (i = 0; i < p->len; i++) {
++ if (!(i & 15))
++ fprintf(stderr, "\n%04X:", i);
++ fprintf(stderr, " %02X", p->data[i]);
++ }
++ fprintf(stderr, "\n\n");
++ }
++#endif
++ if (sz > ret)
++ sz = ret;
++ memcpy(&s->out_buf[s->out_ptr], p->data, sz);
++ s->out_ptr += sz;
++ if (!s->rndis) {
++ if (ret < 64) {
++ qemu_send_packet(s->vc, s->out_buf, s->out_ptr);
++ s->out_ptr = 0;
++ }
++ return ret;
++ }
++ len = le32_to_cpu(msg->MessageLength);
++ if (s->out_ptr < 8 || s->out_ptr < len)
++ return ret;
++ if (le32_to_cpu(msg->MessageType) == REMOTE_NDIS_PACKET_MSG) {
++ uint32_t offs = 8 + le32_to_cpu(msg->DataOffset);
++ uint32_t size = le32_to_cpu(msg->DataLength);
++ if (offs + size <= len)
++ qemu_send_packet(s->vc, s->out_buf + offs, size);
++ }
++ s->out_ptr -= len;
++ memmove(s->out_buf, &s->out_buf[len], s->out_ptr);
++ return ret;
++}
++
++static int usb_net_handle_data(USBDevice *dev, USBPacket *p)
++{
++ USBNetState *s = (USBNetState *)dev;
++ int ret = 0;
++
++ switch(p->pid) {
++ case USB_TOKEN_IN:
++ switch (p->devep) {
++ case 1:
++ ret = usb_net_handle_statusin(s, p);
++ break;
++
++ case 2:
++ ret = usb_net_handle_datain(s, p);
++ break;
++
++ default:
++ goto fail;
++ }
++ break;
++
++ case USB_TOKEN_OUT:
++ switch (p->devep) {
++ case 2:
++ ret = usb_net_handle_dataout(s, p);
++ break;
++
++ default:
++ goto fail;
++ }
++ break;
++
++ default:
++ fail:
++ ret = USB_RET_STALL;
++ break;
++ }
++ if (ret == USB_RET_STALL)
++ fprintf(stderr, "usbnet: failed data transaction: pid 0x%x ep 0x%x len 0x%x\n", p->pid, p->devep, p->len);
++ return ret;
++}
++
++static void usbnet_receive(void *opaque, const uint8_t *buf, int size)
++{
++ USBNetState *s = opaque;
++
++ if (s->rndis) {
++ struct rndis_packet_msg_type *msg = (struct rndis_packet_msg_type *)s->in_buf;
++ if (!s->rndis_state == RNDIS_DATA_INITIALIZED)
++ return;
++ if (size + sizeof(struct rndis_packet_msg_type) > sizeof(s->in_buf))
++ return;
++ memset(msg, 0, sizeof(struct rndis_packet_msg_type));
++ msg->MessageType = cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
++ msg->MessageLength = cpu_to_le32(size + sizeof(struct rndis_packet_msg_type));
++ msg->DataOffset = cpu_to_le32(sizeof(struct rndis_packet_msg_type) - 8);
++ msg->DataLength = cpu_to_le32(size);
++ //msg->OOBDataOffset;
++ //msg->OOBDataLength;
++ //msg->NumOOBDataElements;
++ //msg->PerPacketInfoOffset;
++ //msg->PerPacketInfoLength;
++ //msg->VcHandle;
++ //msg->Reserved;
++ memcpy(msg + 1, buf, size);
++ s->in_len = size + sizeof(struct rndis_packet_msg_type);
++ } else {
++ if (size > sizeof(s->in_buf))
++ return;
++ memcpy(s->in_buf, buf, size);
++ s->in_len = size;
++ }
++ s->in_ptr = 0;
++}
++
++static int usbnet_can_receive(void *opaque)
++{
++ USBNetState *s = opaque;
++
++ if (s->rndis && !s->rndis_state == RNDIS_DATA_INITIALIZED)
++ return 1;
++ return !s->in_len;
++}
++
++static void usb_net_handle_destroy(USBDevice *dev)
++{
++ USBNetState *s = (USBNetState *)dev;
++ rndis_clear_responsequeue(s);
++ qemu_free(s);
++}
++
++USBDevice *usb_net_init(NICInfo *nd)
++{
++ USBNetState *s;
++
++ s = qemu_mallocz(sizeof(USBNetState));
++ if (!s)
++ return NULL;
++ s->dev.speed = USB_SPEED_FULL;
++ s->dev.handle_packet = usb_generic_handle_packet;
++
++ s->dev.handle_reset = usb_net_handle_reset;
++ s->dev.handle_control = usb_net_handle_control;
++ s->dev.handle_data = usb_net_handle_data;
++ s->dev.handle_destroy = usb_net_handle_destroy;
++
++ s->rndis = 1;
++ s->rndis_state = RNDIS_UNINITIALIZED;
++ s->medium = NDIS_MEDIUM_802_3;
++ s->speed = 1000000; /* 100MBps, in 100Bps units */
++ s->media_state = NDIS_MEDIA_STATE_CONNECTED;
++ s->filter = 0;
++ s->vendorid = 0x1234;
++ memcpy(s->mac, nd->macaddr, 6);
++ TAILQ_INIT(&s->rndis_resp);
++
++ pstrcpy(s->dev.devname, sizeof(s->dev.devname), "QEMU USB Network Interface");
++ s->vc = qemu_new_vlan_client(nd->vlan, usbnet_receive, usbnet_can_receive, s);
++ snprintf(s->vc->info_str, sizeof(s->vc->info_str),
++ "usbnet macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
++ s->mac[0], s->mac[1], s->mac[2],
++ s->mac[3], s->mac[4], s->mac[5]);
++ fprintf(stderr, "usbnet: initialized mac %02x:%02x:%02x:%02x:%02x:%02x\n",
++ s->mac[0], s->mac[1], s->mac[2],
++ s->mac[3], s->mac[4], s->mac[5]);
++ return (USBDevice *)s;
++}
+diff -urN 4242/Makefile qemu-omap/Makefile
+--- 4242/Makefile 2008-04-24 20:17:05.000000000 +0100
++++ qemu-omap/Makefile 2008-04-23 09:57:55.000000000 +0100
+@@ -55,7 +55,8 @@
+ OBJS+=tmp105.o
+ OBJS+=scsi-disk.o cdrom.o
+ OBJS+=scsi-generic.o
+-OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o
++OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-net.o
++OBJS+=usb-wacom.o usb-serial.o
+ OBJS+=sd.o ssi-sd.o
+
+ ifdef CONFIG_BRLAPI
+diff -urN 4242/softmmu_template.h qemu-omap/softmmu_template.h
+--- 4242/softmmu_template.h 2008-04-24 18:11:49.000000000 +0100
++++ qemu-omap/softmmu_template.h 2008-04-23 09:57:56.000000000 +0100
+@@ -51,12 +51,15 @@
+ int mmu_idx,
+ void *retaddr);
+ static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr,
+- target_ulong tlb_addr)
++ target_ulong tlb_addr,
++ target_ulong tlb_io)
+ {
+ DATA_TYPE res;
+ int index;
+
+- index = (tlb_addr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
++ index = (tlb_addr & ~TARGET_PAGE_MASK) >> IO_MEM_SHIFT;
++ if (index > 4)
++ index = (tlb_io >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
+ #if SHIFT <= 2
+ res = io_mem_read[index][SHIFT](io_mem_opaque[index], physaddr);
+ #else
+@@ -95,7 +98,9 @@
+ /* IO access */
+ if ((addr & (DATA_SIZE - 1)) != 0)
+ goto do_unaligned_access;
+- res = glue(io_read, SUFFIX)(physaddr, tlb_addr);
++ res = glue(io_read, SUFFIX)(physaddr, tlb_addr,
++ env->tlb_table[mmu_idx]
++ [index].addr_code);
+ } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
+ /* slow unaligned access (it spans two pages or IO) */
+ do_unaligned_access:
+@@ -147,7 +152,9 @@
+ /* IO access */
+ if ((addr & (DATA_SIZE - 1)) != 0)
+ goto do_unaligned_access;
+- res = glue(io_read, SUFFIX)(physaddr, tlb_addr);
++ res = glue(io_read, SUFFIX)(physaddr, tlb_addr,
++ env->tlb_table[mmu_idx]
++ [index].addr_code);
+ } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
+ do_unaligned_access:
+ /* slow unaligned access (it spans two pages) */
+@@ -186,11 +193,14 @@
+ static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr,
+ DATA_TYPE val,
+ target_ulong tlb_addr,
+- void *retaddr)
++ void *retaddr,
++ target_ulong tlb_io)
+ {
+ int index;
+
+- index = (tlb_addr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
++ index = (tlb_addr & ~TARGET_PAGE_MASK) >> IO_MEM_SHIFT;
++ if (index > 4)
++ index = (tlb_io >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
+ env->mem_write_vaddr = tlb_addr;
+ env->mem_write_pc = (unsigned long)retaddr;
+ #if SHIFT <= 2
+@@ -228,7 +238,8 @@
+ if ((addr & (DATA_SIZE - 1)) != 0)
+ goto do_unaligned_access;
+ retaddr = GETPC();
+- glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr);
++ glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr,
++ env->tlb_table[mmu_idx][index].addr_code);
+ } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
+ do_unaligned_access:
+ retaddr = GETPC();
+@@ -278,7 +289,8 @@
+ /* IO access */
+ if ((addr & (DATA_SIZE - 1)) != 0)
+ goto do_unaligned_access;
+- glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr);
++ glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr,
++ env->tlb_table[mmu_idx][index].addr_code);
+ } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
+ do_unaligned_access:
+ /* XXX: not efficient, but simple */
+diff -urN 4242/target-i386/cpu.h qemu-omap/target-i386/cpu.h
+--- 4242/target-i386/cpu.h 2008-04-23 12:18:51.000000000 +0100
++++ qemu-omap/target-i386/cpu.h 2008-04-23 09:57:56.000000000 +0100
+@@ -499,7 +499,7 @@
+ SegmentCache idt; /* only base and limit are used */
+
+ target_ulong cr[9]; /* NOTE: cr1, cr5-7 are unused */
+- uint64_t a20_mask;
++ uint32_t a20_mask;
+
+ /* FPU state */
+ unsigned int fpstt; /* top of stack index */
+diff -urN 4242/target-i386/helper2.c qemu-omap/target-i386/helper2.c
+--- 4242/target-i386/helper2.c 2008-04-23 12:18:51.000000000 +0100
++++ qemu-omap/target-i386/helper2.c 2008-04-23 09:57:56.000000000 +0100
+@@ -377,7 +377,7 @@
+ env->hflags |= HF_GIF_MASK;
+
+ cpu_x86_update_cr0(env, 0x60000010);
+- env->a20_mask = ~0x0;
++ env->a20_mask = 0xffffffff;
+ env->smbase = 0x30000;
+
+ env->idt.limit = 0xffff;
+@@ -695,7 +695,7 @@
+ /* when a20 is changed, all the MMU mappings are invalid, so
+ we must flush everything */
+ tlb_flush(env, 1);
+- env->a20_mask = (~0x100000) | (a20_state << 20);
++ env->a20_mask = 0xffefffff | (a20_state << 20);
+ }
+ }
+
+@@ -800,8 +800,7 @@
+
+ #else
+
+-/* Bits 52-62 of a PTE are reserved. Bit 63 is the NX bit. */
+-#define PHYS_ADDR_MASK 0xffffffffff000L
++#define PHYS_ADDR_MASK 0xfffff000
+
+ /* return value:
+ -1 = cannot handle fault
+@@ -813,10 +812,9 @@
+ int is_write1, int mmu_idx, int is_softmmu)
+ {
+ uint64_t ptep, pte;
+- target_ulong pde_addr, pte_addr;
++ uint32_t pdpe_addr, pde_addr, pte_addr;
+ int error_code, is_dirty, prot, page_size, ret, is_write, is_user;
+- target_phys_addr_t paddr;
+- uint32_t page_offset;
++ unsigned long paddr, page_offset;
+ target_ulong vaddr, virt_addr;
+
+ is_user = mmu_idx == MMU_USER_IDX;
+@@ -836,11 +834,12 @@
+
+ if (env->cr[4] & CR4_PAE_MASK) {
+ uint64_t pde, pdpe;
+- target_ulong pdpe_addr;
+
++ /* XXX: we only use 32 bit physical addresses */
+ #ifdef TARGET_X86_64
+ if (env->hflags & HF_LMA_MASK) {
+- uint64_t pml4e_addr, pml4e;
++ uint32_t pml4e_addr;
++ uint64_t pml4e;
+ int32_t sext;
+
+ /* test virtual address sign extension */
+@@ -1102,19 +1101,17 @@
+
+ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+ {
+- target_ulong pde_addr, pte_addr;
+- uint64_t pte;
+- target_phys_addr_t paddr;
+- uint32_t page_offset;
+- int page_size;
++ uint32_t pde_addr, pte_addr;
++ uint32_t pde, pte, paddr, page_offset, page_size;
+
+ if (env->cr[4] & CR4_PAE_MASK) {
+- target_ulong pdpe_addr;
+- uint64_t pde, pdpe;
++ uint32_t pdpe_addr, pde_addr, pte_addr;
++ uint32_t pdpe;
+
++ /* XXX: we only use 32 bit physical addresses */
+ #ifdef TARGET_X86_64
+ if (env->hflags & HF_LMA_MASK) {
+- uint64_t pml4e_addr, pml4e;
++ uint32_t pml4e_addr, pml4e;
+ int32_t sext;
+
+ /* test virtual address sign extension */
+@@ -1124,13 +1121,13 @@
+
+ pml4e_addr = ((env->cr[3] & ~0xfff) + (((addr >> 39) & 0x1ff) << 3)) &
+ env->a20_mask;
+- pml4e = ldq_phys(pml4e_addr);
++ pml4e = ldl_phys(pml4e_addr);
+ if (!(pml4e & PG_PRESENT_MASK))
+ return -1;
+
+ pdpe_addr = ((pml4e & ~0xfff) + (((addr >> 30) & 0x1ff) << 3)) &
+ env->a20_mask;
+- pdpe = ldq_phys(pdpe_addr);
++ pdpe = ldl_phys(pdpe_addr);
+ if (!(pdpe & PG_PRESENT_MASK))
+ return -1;
+ } else
+@@ -1138,14 +1135,14 @@
+ {
+ pdpe_addr = ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) &
+ env->a20_mask;
+- pdpe = ldq_phys(pdpe_addr);
++ pdpe = ldl_phys(pdpe_addr);
+ if (!(pdpe & PG_PRESENT_MASK))
+ return -1;
+ }
+
+ pde_addr = ((pdpe & ~0xfff) + (((addr >> 21) & 0x1ff) << 3)) &
+ env->a20_mask;
+- pde = ldq_phys(pde_addr);
++ pde = ldl_phys(pde_addr);
+ if (!(pde & PG_PRESENT_MASK)) {
+ return -1;
+ }
+@@ -1158,11 +1155,9 @@
+ pte_addr = ((pde & ~0xfff) + (((addr >> 12) & 0x1ff) << 3)) &
+ env->a20_mask;
+ page_size = 4096;
+- pte = ldq_phys(pte_addr);
++ pte = ldl_phys(pte_addr);
+ }
+ } else {
+- uint32_t pde;
+-
+ if (!(env->cr[0] & CR0_PG_MASK)) {
+ pte = addr;
+ page_size = 4096;
+diff -urN 4242/vl.c qemu-omap/vl.c
+--- 4242/vl.c 2008-04-24 21:26:21.000000000 +0100
++++ qemu-omap/vl.c 2008-04-23 09:57:57.000000000 +0100
+@@ -5284,6 +5284,11 @@
+ dev = usb_keyboard_init();
+ } else if (strstart(devname, "disk:", &p)) {
+ dev = usb_msd_init(p);
++ } else if (strstart(devname, "net:", &p)) {
++ unsigned int nr = strtoul(p, NULL, 0);
++ if (nr >= (unsigned int) nb_nics || strcmp(nd_table[nr].model, "usb"))
++ return -1;
++ dev = usb_net_init(&nd_table[nr]);
+ } else if (!strcmp(devname, "wacom-tablet")) {
+ dev = usb_wacom_init();
+ } else if (strstart(devname, "serial:", &p)) {
diff --git a/packages/qemu/qemu-0.9.1+svn/revert_arm_tcg.patch.gz b/packages/qemu/qemu-0.9.1+svn/revert_arm_tcg.patch.gz
new file mode 100644
index 0000000000..eb2a76c167
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/revert_arm_tcg.patch.gz
Binary files differ
diff --git a/packages/qemu/qemu-0.9.1+svn/series b/packages/qemu/qemu-0.9.1+svn/series
new file mode 100644
index 0000000000..fb110340c4
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/series
@@ -0,0 +1,25 @@
+05_non-fatal_if_linux_hd_missing.patch
+06_exit_segfault.patch -p0
+10_signal_jobs.patch -p0
+11_signal_sigaction.patch -p0
+22_net_tuntap_stall.patch -p0
+31_syscalls.patch -p0
+32_syscall_sysctl.patch -p0
+33_syscall_ppc_clone.patch -p0
+39_syscall_fadvise64.patch -p0
+52_ne2000_return.patch
+61_safe_64bit_int.patch -p0
+63_sparc_build.patch -p0
+64_ppc_asm_constraints.patch
+65_kfreebsd.patch -p0
+66_tls_ld.patch -p0
+91-oh-sdl-cursor.patch -p0
+qemu-0.9.0-nptl.patch
+qemu-0.9.0-nptl-update.patch
+qemu-amd64-32b-mapping-0.9.0.patch
+workaround_bad_futex_headers.patch -p1
+fix_segfault.patch
+no-strip.patch
+fix_brk.patch
+fix_protection_bits.patch -p1
+qemu-n800-support.patch -p1
diff --git a/packages/qemu/qemu-0.9.1+svn/workaround_bad_futex_headers.patch b/packages/qemu/qemu-0.9.1+svn/workaround_bad_futex_headers.patch
new file mode 100644
index 0000000000..cc122ebdba
--- /dev/null
+++ b/packages/qemu/qemu-0.9.1+svn/workaround_bad_futex_headers.patch
@@ -0,0 +1,25 @@
+---
+ linux-user/syscall.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+Index: qemu/linux-user/syscall.c
+===================================================================
+--- qemu.orig/linux-user/syscall.c 2007-08-09 20:28:06.000000000 +0100
++++ qemu/linux-user/syscall.c 2007-08-09 20:28:41.000000000 +0100
+@@ -61,7 +61,15 @@
+ #define tchars host_tchars /* same as target */
+ #define ltchars host_ltchars /* same as target */
+
+-#include <linux/futex.h>
++#define FUTEX_WAIT 0
++#define FUTEX_WAKE 1
++#define FUTEX_FD 2
++#define FUTEX_REQUEUE 3
++#define FUTEX_CMP_REQUEUE 4
++#define FUTEX_WAKE_OP 5
++#define FUTEX_LOCK_PI 6
++#define FUTEX_UNLOCK_PI 7
++
+ #include <linux/termios.h>
+ #include <linux/unistd.h>
+ #include <linux/utsname.h>
diff --git a/packages/qemu/qemu-native_svn.bb b/packages/qemu/qemu-native_svn.bb
new file mode 100644
index 0000000000..1e3a4dbbfa
--- /dev/null
+++ b/packages/qemu/qemu-native_svn.bb
@@ -0,0 +1,2 @@
+require qemu_svn.bb
+require qemu-native.inc
diff --git a/packages/qemu/qemu_svn.bb b/packages/qemu/qemu_svn.bb
new file mode 100644
index 0000000000..6e52a1513f
--- /dev/null
+++ b/packages/qemu/qemu_svn.bb
@@ -0,0 +1,48 @@
+LICENSE = "GPL"
+DEPENDS = "zlib"
+PV = "0.9.1+svnr${SRCREV}"
+PR = "r12"
+
+FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-0.9.1+svn/"
+
+SRC_URI = "\
+ svn://svn.savannah.nongnu.org/qemu;module=trunk \
+ file://05_non-fatal_if_linux_hd_missing.patch;patch=1;pnum=1 \
+ file://06_exit_segfault.patch;patch=1;pnum=0 \
+ file://10_signal_jobs.patch;patch=1;pnum=0 \
+ file://11_signal_sigaction.patch;patch=1;pnum=0 \
+ file://22_net_tuntap_stall.patch;patch=1;pnum=0 \
+ file://31_syscalls.patch;patch=1;pnum=0 \
+ file://32_syscall_sysctl.patch;patch=1;pnum=0 \
+ file://33_syscall_ppc_clone.patch;patch=1;pnum=0 \
+ file://39_syscall_fadvise64.patch;patch=1;pnum=0 \
+ file://41_arm_fpa_sigfpe.patch;patch=1;pnum=0;maxrev=4028 \
+ file://52_ne2000_return.patch;patch=1;pnum=1 \
+ file://61_safe_64bit_int.patch;patch=1;pnum=0 \
+ file://63_sparc_build.patch;patch=1;pnum=0 \
+ file://64_ppc_asm_constraints.patch;patch=1;pnum=1 \
+ file://65_kfreebsd.patch;patch=1;pnum=0 \
+ file://66_tls_ld.patch;patch=1;pnum=0 \
+ file://91-oh-sdl-cursor.patch;patch=1;pnum=0 \
+ file://qemu-0.9.0-nptl.patch;patch=1 \
+ file://qemu-0.9.0-nptl-update.patch;patch=1;maxrev=4028 \
+ file://qemu-amd64-32b-mapping-0.9.0.patch;patch=1 \
+ file://workaround_bad_futex_headers.patch;patch=1 \
+ file://fix_segfault.patch;patch=1 \
+ file://no-strip.patch;patch=1 \
+ file://fix_brk.patch;patch=1 \
+ file://fix_protection_bits.patch;patch=1 \
+ file://revert_arm_tcg.patch.gz;patch=1;minrev=4242 \
+ file://qemu-n800-support.patch;patch=1"
+
+S = "${WORKDIR}/trunk"
+
+#EXTRA_OECONF += "--disable-sdl"
+#EXTRA_OECONF += "--target-list=arm-linux-user,arm-softmmu,i386-softmmu"
+EXTRA_OECONF += "--disable-gfx-check"
+
+inherit autotools
+
+do_configure() {
+ ${S}/configure --prefix=${prefix} ${EXTRA_OECONF}
+}
diff --git a/packages/tasks/mamona-sdk.inc b/packages/tasks/mamona-sdk.inc
new file mode 100644
index 0000000000..fb54eab541
--- /dev/null
+++ b/packages/tasks/mamona-sdk.inc
@@ -0,0 +1,25 @@
+DESCRIPTION = "Mamona SDK - Packages for compilation and debug"
+LICENSE = "MIT"
+ALLOW_EMPTY = "1"
+
+PACKAGES = "${PN}"
+
+RDEPENDS = "\
+ task-mamona \
+ automake \
+ bison \
+ cmake \
+ fakeroot \
+ flex \
+ git \
+ gdb \
+ gettext \
+ groff \
+ libc6-dev \
+ libstdc++-dev \
+ make \
+ cvs \
+ subversion \
+ pkgconfig \
+ diffutils \
+"
diff --git a/packages/tasks/task-mamona-base.bb b/packages/tasks/task-mamona-base.bb
index 76f84ccaac..c3f867fdec 100644
--- a/packages/tasks/task-mamona-base.bb
+++ b/packages/tasks/task-mamona-base.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "task mamona base"
LICENSE = "MIT"
-PR = "r1"
+PR = "r2"
ALLOW_EMPTY = "1"
PACKAGES = "${PN}"
@@ -9,8 +9,7 @@ RDEPENDS = "\
apt \
base-files \
base-passwd \
- bash \
- binutils \
+ bash | bash-noemu \
busybox \
bzip2 \
coreutils \
@@ -22,24 +21,22 @@ RDEPENDS = "\
file \
gawk \
gawk-common \
+ initscripts \
libgcc \
libstdc++ \
- zlib \
+ makedevs \
ncurses \
netbase \
+ patch \
perl \
- perl-module-base \
- perl-module-carp \
- perl-module-exporter \
- perl-module-strict \
- perl-module-vars \
- perl-module-warnings \
- perl-module-warnings-register \
+ pkgconfig \
procps \
sed \
+ sudo \
sysvinit \
sysvinit-inittab \
tar \
+ tinylogin \
udev \
update-alternatives-dpkg \
update-rc.d \
@@ -47,10 +44,5 @@ RDEPENDS = "\
util-linux-losetup \
util-linux-swaponoff \
util-linux-umount \
- pkgconfig \
- initscripts \
- makedevs \
- patch \
- tinylogin \
- sudo \
+ zlib \
"
diff --git a/packages/tasks/task-mamona-devel.bb b/packages/tasks/task-mamona-devel.bb
index a1d8d2398d..a33083450f 100644
--- a/packages/tasks/task-mamona-devel.bb
+++ b/packages/tasks/task-mamona-devel.bb
@@ -1,26 +1,26 @@
-DESCRIPTION = "Necessary packages for development"
+DESCRIPTION = "Necessary packages for development at runtime environment"
LICENSE = "MIT"
-PR = "r1"
+PR = "r3"
ALLOW_EMPTY = "1"
PACKAGES = "${PN}"
RDEPENDS = "\
- automake \
- bison \
- fakeroot \
- flex \
- gcc \
- gcc-symlinks \
- g++ \
- g++-symlinks \
+ task-mamona \
gdb \
- gettext \
- groff \
- libc6-dev \
- libstdc++-dev \
- make \
- cvs \
- subversion \
- pkgconfig \
-" \ No newline at end of file
+ strace \
+ udev-usbserial \
+ usbnet \
+ openssh-sshd \
+ openssh-scp \
+"
+
+pkg_postinst () {
+ echo; echo
+ echo " ########################################################## "
+ echo " # WARNING: Please set your root password before use your # "
+ echo " # usbnet package. It's required for ssh login. # "
+ echo " ########################################################## "
+ echo; echo
+}
+
diff --git a/packages/tasks/task-mamona-e.bb b/packages/tasks/task-mamona-e.bb
deleted file mode 100644
index cc8af8b3f9..0000000000
--- a/packages/tasks/task-mamona-e.bb
+++ /dev/null
@@ -1,37 +0,0 @@
-DESCRIPTION = "Necessary packages for Enlightenment on Mamona"
-LICENSE = "MIT"
-PR = "r2"
-ALLOW_EMPTY = "1"
-
-PACKAGES = "${PN}"
-
-RDEPENDS = "\
-eet \
-embryo \
-imlib2 \
-edb \
-evas \
-libevas-engine-software-x11 \
-libevas-engine-software-16 \
-libevas-engine-software-16-x11 \
-libevas-saver-eet \
-libevas-saver-edb \
-libevas-saver-jpeg \
-libevas-saver-tiff \
-libevas-loader-eet \
-libevas-loader-edb \
-libevas-loader-jpeg \
-libevas-loader-tiff \
-ecore \
-efreet \
-edje \
-etk \
-ewl \
-epeg \
-esmart \
-epsilon \
-emotion \
-enhance \
-edbus \
-e-wm \
-"
diff --git a/packages/tasks/task-mamona-extras.bb b/packages/tasks/task-mamona-extras.bb
deleted file mode 100644
index 7a5e7a6a29..0000000000
--- a/packages/tasks/task-mamona-extras.bb
+++ /dev/null
@@ -1,174 +0,0 @@
-DESCRIPTION = "Task mamona extras: Dummy package to build extra packages to mamona repository"
-LICENSE = "MIT"
-PR = "r1"
-ALLOW_EMPTY = "1"
-
-PACKAGES = "${PN}"
-
-RDEPENDS = "\
- tinylogin \
- bluez-utils \
- bluez-utils-compat \
- bluez-utils-alsa \
- bluez-libs \
- coreutils \
- cpio \
- dbus \
- diffstat \
- dnsmasq \
- dosfstools \
- e2fsprogs \
- expat \
- findutils \
- fontconfig \
- gconf \
- gnome-common \
- gtk+-doc \
- glib-2.0 \
- ifupdown \
- initscripts \
- intltool \
- iptables \
- libelf \
- libfontenc \
- libmatchbox \
- liboil \
- libpng \
- libtool \
- libusb \
- libxau \
- libxcursor \
- libxdmcp \
- libxext \
- libxfixes \
- libxfont \
- libxi \
- libxkbfile \
- libxml2 \
- libxpm \
- libxrandr \
- libxrender \
- libxslt \
- libxt \
- libxtst \
- libxv \
- lsof \
- makedev \
- mime-support \
- module-init-tools \
- ncurses \
- net-tools \
- netbase \
- osso-af-utils \
- osso-core-config \
- osso-esd \
- osso-sounds \
- portmap \
- ppp \
- procps \
- samba \
- sbrsh \
- sdk-default-icons \
- sdk-default-theme \
- sdk-default-theme-config \
- sgml-common \
- shared-mime-info \
- slang \
- sqlite \
- sqlite3 \
- sudo \
- sysvinit \
- telepathy-gabble \
- libtelepathy \
- telepathy-glib \
- telepathy-mission-control \
- tslib \
- ttf-bitstream-vera \
- udev \
- util-linux \
- wireless-tools \
- xkbd \
- xtrans-dev \
- gnome-vfs \
- groff \
- gstreamer \
- gtk-engines-dev \
- gtk+ \
- libart-lgpl \
- libdbi \
- libosso \
- libosso-gsf \
- matchbox-wm \
- nfs-utils \
- osso-af-settings-dev \
- osso-af-startup \
- osso-af-utils \
- osso-core-config \
- osso-dsp-headers-dev \
- osso-esd \
- python \
- python-ao \
- python-cheetah \
- python-constraint \
- python-pycrypto \
- python-dbus \
- python-dialog \
- python-fnorb \
- python-fpconst \
- python-gmpy \
- python-gnosis \
- python-hmm \
- python-imaging \
- python-imdbpy \
- python-inotify \
- python-irclib \
- python-itools \
- python-libgmail \
- python-libgmail \
- python-logilab-common \
- python-lxml \
- python-mad \
- python-numarray \
- python-numeric \
- python-ogg \
- python-pexpect \
- python-pybluez \
- python-pycairo \
- python-pychecker \
- python-pycodes \
- python-pyephem \
- python-pyfits \
- python-pyflakes \
- python-pygobject \
- python-pygoogle \
- python-pygtk \
- python-pyiw \
- python-pylinda \
- python-pylint \
- python-pymetar \
- python-pymp3 \
- python-pyraf \
- python-pyreverse \
- python-pyrex \
- python-pyro \
- python-pyserial \
- python-pythondaap \
- python-pyvisa \
- python-pyweather \
- python-pywpa \
- python-pyzeroconf \
- python-scons \
- python-sgmlop \
- python-snmplib \
- python-soappy \
- python-tlslite \
- python-urwid \
- python-vmaps \
- python-vorbis \
- python-webpy \
- renderproto-dev \
- wget \
- zlib \
-"
-
-# strace \
diff --git a/packages/tasks/task-mamona-noemu.bb b/packages/tasks/task-mamona-noemu.bb
deleted file mode 100644
index 73659593dd..0000000000
--- a/packages/tasks/task-mamona-noemu.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-DESCRIPTION = "Noemu packages are i386 packages thar run inside ARM chroot environment"
-LICENSE = "MIT"
-PR = "r1"
-ALLOW_EMPTY = "1"
-
-PACKAGES = "${PN}"
-
-RDEPENDS = "\
- bash-noemu \
- binutils-noemu \
- gcc-noemu \
-" \ No newline at end of file
diff --git a/packages/tasks/task-mamona-nokia-it.bb b/packages/tasks/task-mamona-nokia-it.bb
deleted file mode 100644
index 05bc7e773c..0000000000
--- a/packages/tasks/task-mamona-nokia-it.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-DESCRIPTION = "Necessary packages for Mamona run on Nokia Internet Tablets"
-LICENSE = "MIT"
-PR = "r0"
-ALLOW_EMPTY = "1"
-
-RDEPENDS = "\
- task-mamona \
- xmodmap \
- xdpyinfo \
- xtscal \
- wireless-tools \
- wpa-supplicant \
- bluez-utils \
- bluez-utils-compat \
- dspgw-utils \
- libasound-module-ctl-dsp-ctl \
- libasound-module-pcm-alsa-dsp \
- alsa-conf-base \
- alsa-utils-alsamixer \
- alsa-lib \
- alsa-utils-alsactl \
- alsa-state \
- mamona-sound-n800 \
- usbnet \
- openssh-sshd \
- openssh-scp \
-"
diff --git a/packages/tasks/task-mamona-python.bb b/packages/tasks/task-mamona-python.bb
new file mode 100644
index 0000000000..f17d6e731f
--- /dev/null
+++ b/packages/tasks/task-mamona-python.bb
@@ -0,0 +1,79 @@
+DESCRIPTION = "Task mamona: Python Applicattions"
+LICENSE = "MIT"
+PR = "r0"
+
+PACKAGES = "${PN}"
+
+RDEPENDS = "\
+ python-ao \
+ python-cheetah \
+ python-constraint \
+ python-dbus \
+ python-dialog \
+ python-pycurl \
+ python-fam \
+ python-fnorb \
+ python-formencode \
+ python-fpconst \
+ python-gmpy \
+ python-gnosis \
+ python-gst \
+ python-hmm \
+ python-imaging \
+ python-imdbpy \
+ python-inotify \
+ python-irclib \
+ python-itools \
+ python-logilab-common \
+ python-libgmail \
+ python-lightmediascanner \
+ python-lxml \
+ python-mad \
+ python-numarray \
+ python-numeric \
+ python-ogg \
+ python-pexpect \
+ python-pybluez \
+ python-pycairo \
+ python-pychecker \
+ python-pycodes \
+ python-pyephem \
+ python-pyfits \
+ python-pyflakes \
+ python-pygobject \
+ python-pygoogle \
+ python-pygtk \
+ python-pyid3lib \
+ python-pylinda \
+ python-pylint \
+ python-pyqt \
+ python-pyraf \
+ python-pyreverse \
+ python-pyrex \
+ python-pyro \
+ python-pyserial \
+ python-pytester \
+ python-pyusb \
+ python-pyvisa \
+ python-pyweather \
+ python-pyxml \
+ python-pyxmlrpc \
+ python-scons \
+ python-setuptools \
+ python-simplejson \
+ python-sip \
+ python-sgmlop \
+ python-snmplib \
+ python-soappy \
+ python-spydi \
+ python-spyro \
+ python-sqlalchemy \
+ python-sqlobject \
+ python-tlslite \
+ python-urwid \
+ python-vmaps \
+ python-vorbis \
+ python-webpy \
+ task-python-efl \
+ twisted \
+"
diff --git a/packages/tasks/task-mamona-sdk-noemu.bb b/packages/tasks/task-mamona-sdk-noemu.bb
new file mode 100644
index 0000000000..0ef65b916c
--- /dev/null
+++ b/packages/tasks/task-mamona-sdk-noemu.bb
@@ -0,0 +1,16 @@
+PR = "r2"
+
+require mamona-sdk.inc
+
+RCONFLICTS = "task-mamona-sdk"
+RREPLACES = "task-mamona-sdk"
+
+RDEPENDS += "\
+ bash-noemu \
+ binutils-noemu \
+ binutils-noemu-symlinks \
+ gcc-noemu \
+ gcc-noemu-symlinks \
+ g++-noemu \
+ g++-noemu-symlinks \
+"
diff --git a/packages/tasks/task-mamona-sdk.bb b/packages/tasks/task-mamona-sdk.bb
new file mode 100644
index 0000000000..6e5786517a
--- /dev/null
+++ b/packages/tasks/task-mamona-sdk.bb
@@ -0,0 +1,16 @@
+PR = "r4"
+
+include mamona-sdk.inc
+
+RCONFLICTS = "task-mamona-sdk-noemu"
+RREPLACES = "task-mamona-sdk-noemu"
+
+RDEPENDS += "\
+ bash \
+ binutils \
+ binutils-symlinks \
+ gcc \
+ gcc-symlinks \
+ g++ \
+ g++-symlinks \
+"
diff --git a/packages/tasks/task-mamona-systemtap.bb b/packages/tasks/task-mamona-systemtap.bb
new file mode 100644
index 0000000000..01664d3e26
--- /dev/null
+++ b/packages/tasks/task-mamona-systemtap.bb
@@ -0,0 +1,11 @@
+DESCRIPTION = "Task Mamona: Necessary packages for running a systemtap enabled system"
+PR = "r1"
+ALLOW_EMPTY = "1"
+
+PACKAGES = "${PN}"
+
+RDEPENDS = "\
+ libcap \
+ systemtap \
+ task-mamona-sdk \
+"
diff --git a/packages/tasks/task-mamona-wm.bb b/packages/tasks/task-mamona-wm.bb
new file mode 100644
index 0000000000..55893e0eac
--- /dev/null
+++ b/packages/tasks/task-mamona-wm.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Task mamona: Window Manager"
+LICENSE = "MIT"
+PR = "r2"
+ALLOW_EMPTY = "1"
+
+PACKAGES = "${PN}"
+
+RDEPENDS = "\
+ task-mamona \
+ e-wm \
+ libmamona-im-ecore \
+ libmamona-im-gtk \
+ pango-module-basic-x \
+ pango-module-basic-fc \
+ aterm \
+ midori \
+"
diff --git a/packages/tasks/task-mamona.bb b/packages/tasks/task-mamona.bb
index 67c8ed524f..498b67b68f 100644
--- a/packages/tasks/task-mamona.bb
+++ b/packages/tasks/task-mamona.bb
@@ -1,22 +1,31 @@
DESCRIPTION = "Task mamona: Build and Install Mamona Platform"
LICENSE = "MIT"
-PR = "r1"
+PR = "r5"
ALLOW_EMPTY = "1"
PACKAGES = "${PN}"
RDEPENDS = "\
task-mamona-base \
+ alsa-conf-base \
+ alsa-utils-alsamixer \
+ alsa-lib \
+ alsa-utils-alsactl \
+ alsa-state \
+ alsa-utils-alsamixer \
+ bluez-utils \
+ bluez-utils-compat \
dbus \
dbus-glib \
expat \
freetype \
glib-2.0 \
glibc \
+ glibc-utils \
hal \
- hal-info \
intltool \
libfontenc \
+ libmamona-im0 \
libusb \
libx11 \
libxau \
@@ -26,11 +35,17 @@ RDEPENDS = "\
libxkbfile \
libxrandr \
libxrender \
+ matchbox-keyboard \
+ netm-cli \
+ networkmanager \
pointercal \
+ python-core \
tslib \
tslib-calibrate \
udev \
- update-modules \
+ wireless-tools \
+ wpa-supplicant \
+ wpa-supplicant-passphrase \
xserver-kdrive-xomap \
xserver-kdrive-common \
xserver-nodm-init \
@@ -38,3 +53,18 @@ RDEPENDS = "\
xinit \
xsp \
"
+
+RDEPENDS_append_nokia770 = " \
+ cx3110x-770he \
+ libasound-module-ctl-dsp-ctl \
+ libasound-module-pcm-alsa-dsp \
+ mamona-sound-n770 \
+"
+
+RDEPENDS_append_nokia800 = " \
+ cx3110x-chinooke \
+ libasound-module-ctl-dsp-ctl \
+ libasound-module-pcm-alsa-dsp \
+ mamona-sound-n800 \
+"
+
diff --git a/packages/u-boot/u-boot-mkimage-native-1.3.2/fix-arm920t-eabi.patch b/packages/u-boot/u-boot-mkimage-native-1.3.2/fix-arm920t-eabi.patch
new file mode 100644
index 0000000000..69cb75891d
--- /dev/null
+++ b/packages/u-boot/u-boot-mkimage-native-1.3.2/fix-arm920t-eabi.patch
@@ -0,0 +1,22 @@
+---
+ cpu/arm920t/config.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- u-boot-1.3.2.orig/cpu/arm920t/config.mk
++++ u-boot-1.3.2/cpu/arm920t/config.mk
+@@ -22,13 +22,13 @@
+ #
+
+ PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
+ -msoft-float
+
+-PLATFORM_CPPFLAGS += -march=armv4
++#PLATFORM_CPPFLAGS += -march=armv4
+ # =========================================================================
+ #
+ # Supply options according to compiler version
+ #
+ # =========================================================================
+-PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
++PLATFORM_CPPFLAGS +=$(call cc-option)
+ PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
diff --git a/packages/u-boot/u-boot-mkimage-native_1.3.2.bb b/packages/u-boot/u-boot-mkimage-native_1.3.2.bb
new file mode 100644
index 0000000000..38dd700d08
--- /dev/null
+++ b/packages/u-boot/u-boot-mkimage-native_1.3.2.bb
@@ -0,0 +1,22 @@
+DESCRIPTION = "U-boot bootloader mkimage tool"
+LICENSE = "GPL"
+SECTION = "bootloader"
+
+SRC_URI = "ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
+ file://fix-arm920t-eabi.patch;patch=1"
+
+S = "${WORKDIR}/u-boot-${PV}"
+
+inherit native
+
+EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"
+
+do_compile () {
+ oe_runmake smdk2410_config
+ oe_runmake tools
+}
+
+do_stage () {
+ install -m 0755 tools/mkimage ${STAGING_BINDIR_NATIVE}/uboot-mkimage
+ ln -sf ${STAGING_BINDIR_NATIVE}/uboot-mkimage ${STAGING_BINDIR_NATIVE}/mkimage
+}