56 Commits 58e09a5182 ... 13062b648c

Author SHA1 Message Date
  dir 58e09a5182 Fail on non-existing hashes for fetching 7 years ago
  Waldemar Brodkorb f8cc30707a gdb: fix build without makeinfo 7 years ago
  Waldemar Brodkorb 7bf80292df openssh: update to 7.6p1 7 years ago
  Waldemar Brodkorb 18d4a61df6 libressl: update to 2.6.3 7 years ago
  Waldemar Brodkorb 1a46257cf8 barebox: update to 2017.11.0, fix x86 builds 7 years ago
  Waldemar Brodkorb 0bd0ee471b allow USB boot for generic targets 7 years ago
  Waldemar Brodkorb 4a9093159f kodi needs libiconv in uClibc-ng case 7 years ago
  Waldemar Brodkorb 7023f5089d or1k: allow kernel compression 7 years ago
  Waldemar Brodkorb 82955941cc arc: switch to upstream binutils and gcc 7 years ago
  Waldemar Brodkorb df686b6aef uclibc-ng: update to 1.0.27 7 years ago
  Guo Ren 7cee0f1a0c csky: ck610 doesn't support FPU. 7 years ago
  Guo Ren da7ae53945 scripts: Bugfix compile error on chinese system. 7 years ago
  Waldemar Brodkorb 95bb119b6e Merge branch 'master' of ableton-dir/openadk into master 7 years ago
  dir 3da81751c8 Add -D option to install.sh to pre-populate data partition 7 years ago
  dir d3edab2e45 Add ajstarks openvg helper library 7 years ago
  dir 4f64194c55 Add ADK_CUSTOM_TASKS_DIR variable to point to external tasks 7 years ago
  Waldemar Brodkorb 23e23bd816 or1k: default to 4.13 7 years ago
  Waldemar Brodkorb fe8edb2985 sash: remove unused file 7 years ago
  Waldemar Brodkorb 28f83a7fd3 toybox: disable swap tools 7 years ago
  Waldemar Brodkorb 0117f348a5 h8300: more RAM for gdb simulating h8300/h 7 years ago
  mirabilos 0c9c313ff8 use tar(1) to copy the extra directories’ content 7 years ago
  mirabilos 64f6f656d1 sort “builtin help” output 7 years ago
  mirabilos 3c3ff868b2 OpenADK edition, and make buildable on desktop GNU/Linux 7 years ago
  mirabilos 864f03819d implement mksh-like “builtin” command 7 years ago
  mirabilos 69229e524c clean up sash 7 years ago
  mirabilos d68e221723 Use only safe functions after vfork(2) 7 years ago
  Waldemar Brodkorb f75ac8152a jupp: update to latest 7 years ago
  Waldemar Brodkorb 9e63067135 use latest 4.13 for or1k, for working atomics support 7 years ago
  Waldemar Brodkorb ce42b9f844 linux: update 4.13.x 7 years ago
  Waldemar Brodkorb f46a41e8b6 Merge branch 'fuse_ext2' of metalmajor/openadk into master 7 years ago
  Waldemar Brodkorb e797c0e303 Merge branch 'pigpio' of metalmajor/openadk into master 7 years ago
  Tom Deblauwe 5706467b7d pigpio: add new package 7 years ago
  Tom Deblauwe b161aaf30c scripts: support fuse_ext2 to write ext4 on Darwin systems 7 years ago
  Waldemar Brodkorb 1a25210690 dhcpcd: add new package 7 years ago
  Waldemar Brodkorb c09518ad39 ltp: add HOST_PATH to pre-configure 7 years ago
  Waldemar Brodkorb b9a522b762 linux: forgot to move 4.4.x patch directory after bump 7 years ago
  Waldemar Brodkorb e7383dee0c gcc: fix cross-native for Xtensa gcc 7 years ago
  Waldemar Brodkorb b9d9e97e51 musl: pass TARGET_CFLAGS for simple test app 7 years ago
  Waldemar Brodkorb 2c2ddcb9d6 use Linux 4.4 for ARMv6 emulation 7 years ago
  Waldemar Brodkorb a8de6415b2 ppc: add more cpu types, add mpc8544ds qemu sample 7 years ago
  Waldemar Brodkorb 7ad9bd33ec linux: bump kernel versions 7 years ago
  Waldemar Brodkorb 0821102d2a gdb: update to 8.0.1 7 years ago
  Waldemar Brodkorb 58cd3e8fc6 arc: update toolchain to 2017.09 7 years ago
  Waldemar Brodkorb bd3220a87b musl: update to 1.1.18 7 years ago
  Waldemar Brodkorb ad7af36dc7 talloc: add PKG_OPTS 7 years ago
  Waldemar Brodkorb 9f3a6943f7 wget: update to 1.19.2 7 years ago
  Waldemar Brodkorb e64b433915 socat: update to 1.7.3.2 7 years ago
  Waldemar Brodkorb 505f3c9a82 samba: update to 4.6.9 7 years ago
  Waldemar Brodkorb b97af154ac php: update to 7.0.25 7 years ago
  Waldemar Brodkorb 64a9c4be82 libnfs: update to 2.0.0 7 years ago
  Waldemar Brodkorb ada547d216 libdrm: update to 2.4.86 7 years ago
  Waldemar Brodkorb 333ca56054 ffmpeg: update to 3.3.5 7 years ago
  Waldemar Brodkorb 280de35d43 curl: update to 7.56.1 7 years ago
  Waldemar Brodkorb 0b3ec5f159 apr: update to 1.6.3 7 years ago
  Waldemar Brodkorb d18bec72c4 apr-util: update to 1.6.1 7 years ago
  Waldemar Brodkorb f9fb9efc5f musl: patch required for ld.so 7 years ago
100 changed files with 7550 additions and 1183 deletions
  1. 2 3
      docs/common-usage.txt
  2. 1 3
      docs/using.txt
  3. 0 1
      mk/fetch.mk
  4. 2 7
      mk/image.mk
  5. 18 12
      mk/kernel-ver.mk
  6. 1 1
      mk/vars.mk
  7. 0 44
      package/ajstarks-openvg/Makefile
  8. 0 64
      package/ajstarks-openvg/patches/patch-DejaVuSansMono_inc
  9. 0 40
      package/ajstarks-openvg/patches/patch-DejaVuSans_inc
  10. 0 357
      package/ajstarks-openvg/patches/patch-DejaVuSerif_inc
  11. 0 55
      package/ajstarks-openvg/patches/patch-Makefile
  12. 4 4
      package/apr-util/Makefile
  13. 4 4
      package/apr/Makefile
  14. 4 12
      package/barebox/Makefile
  15. 2 2
      package/curl/Makefile
  16. 0 33
      package/dhcpcd/Makefile
  17. 2 2
      package/ffmpeg/Makefile
  18. 5 12
      package/gcc/Makefile
  19. 2 4
      package/gdb/Makefile
  20. 2 2
      package/gdbserver/Makefile
  21. 2 2
      package/jupp/Makefile
  22. 3 3
      package/kodi/Makefile
  23. 2 2
      package/libdrm/Makefile
  24. 2 2
      package/libnfs/Makefile
  25. 3 3
      package/libressl/Makefile
  26. 1 1
      package/ltp/Makefile
  27. 1 1
      package/musl/Makefile
  28. 2 2
      package/openssh/Makefile
  29. 11 0
      package/openssh/patches/patch-openbsd-compat_port-tun_c
  30. 2 2
      package/php/Makefile
  31. 0 40
      package/pigpio/Makefile
  32. 0 20
      package/pigpio/patches/patch-Makefile
  33. 3 4
      package/samba/Makefile
  34. 47 0
      package/sash/files/rc
  35. 5 0
      package/sash/src/Makefile
  36. 3 0
      package/sash/src/README
  37. 21 20
      package/sash/src/cmd_uclinux.c
  38. 20 4
      package/sash/src/cmds.c
  39. 1 0
      package/sash/src/cp.c
  40. 11 8
      package/sash/src/date.c
  41. 3 2
      package/sash/src/df.c
  42. 4 3
      package/sash/src/free.c
  43. 20 19
      package/sash/src/hexdump.c
  44. 1 1
      package/sash/src/hostname.c
  45. 0 1
      package/sash/src/libsash/Makefile
  46. 2 2
      package/sash/src/ls.c
  47. 47 46
      package/sash/src/ps.c
  48. 16 1
      package/sash/src/reboot.c
  49. 416 130
      package/sash/src/sash.c
  50. 9 7
      package/sash/src/sash.h
  51. 4 3
      package/sash/src/shutdown.c
  52. 2 2
      package/socat/Makefile
  53. 52 0
      package/socat/patches/patch-sslcls_c
  54. 11 0
      package/socat/patches/patch-sslcls_h
  55. 49 0
      package/socat/patches/patch-xio-openssl_c
  56. 20 0
      package/socat/patches/patch-xioopts_c
  57. 0 1
      package/talloc/Makefile
  58. 0 1
      package/toybox/Makefile
  59. 2 4
      package/wget/Makefile
  60. 2 9
      scripts/create-menu
  61. 14 49
      scripts/install.sh
  62. 1 1
      scripts/prereq.sh
  63. 5 0
      target/config/Config.in.binutils
  64. 5 0
      target/config/Config.in.compiler
  65. 4 81
      target/config/Config.in.cpu
  66. 0 1
      target/config/Config.in.endian
  67. 0 11
      target/config/Config.in.fpu
  68. 3 3
      target/config/Config.in.gdb
  69. 32 13
      target/config/Config.in.kernelversion
  70. 6 8
      target/config/Config.in.libc
  71. 1 2
      target/config/Config.in.rootfs
  72. 1 1
      target/config/Config.in.toolchain
  73. 4094 0
      target/cris/qemu-cris/patches/4.1.35/crisv32_ethernet_driver.patch
  74. 0 2
      target/linux/config/Config.in.ethernet
  75. 1 3
      target/linux/config/Config.in.serial
  76. 0 0
      target/linux/patches/3.16.48/bsd-compatibility.patch
  77. 0 0
      target/linux/patches/3.16.48/cleankernel.patch
  78. 0 0
      target/linux/patches/3.16.48/cris-header.patch
  79. 0 0
      target/linux/patches/3.16.48/cris-initramfs.patch
  80. 0 0
      target/linux/patches/3.16.48/defaults.patch
  81. 0 0
      target/linux/patches/3.16.48/export-symbol-for-exmap.patch
  82. 0 0
      target/linux/patches/3.16.48/fblogo.patch
  83. 0 0
      target/linux/patches/3.16.48/gemalto.patch
  84. 0 0
      target/linux/patches/3.16.48/initramfs-nosizelimit.patch
  85. 0 0
      target/linux/patches/3.16.48/lemote-rfkill.patch
  86. 0 0
      target/linux/patches/3.16.48/microblaze-ethernet.patch
  87. 0 0
      target/linux/patches/3.16.48/mkpiggy.patch
  88. 0 0
      target/linux/patches/3.16.48/mtd-rootfs.patch
  89. 0 0
      target/linux/patches/3.16.48/nfsv3-tcp.patch
  90. 0 0
      target/linux/patches/3.16.48/non-static.patch
  91. 0 0
      target/linux/patches/3.16.48/ppc64-missing-zlib.patch
  92. 0 0
      target/linux/patches/3.16.48/relocs.patch
  93. 0 0
      target/linux/patches/3.16.48/sgidefs.patch
  94. 0 0
      target/linux/patches/3.16.48/sortext.patch
  95. 0 0
      target/linux/patches/3.16.48/startup.patch
  96. 0 0
      target/linux/patches/3.16.48/wlan-cf.patch
  97. 0 0
      target/linux/patches/3.16.48/xargs.patch
  98. 0 0
      target/linux/patches/3.2.93/sparc-aout.patch
  99. 2512 0
      target/linux/patches/3.4.113/bsd-compatibility.patch
  100. 22 0
      target/linux/patches/3.4.113/defaults.patch

+ 2 - 3
docs/common-usage.txt

@@ -69,14 +69,12 @@ Environment variables
 OpenADK also honors some environment variables, when they are passed
 OpenADK also honors some environment variables, when they are passed
 to +make+.
 to +make+.
 
 
-* +ADK_APPLIANCE+, the appliance task you want to build
-* +ADK_CUSTOM_TASKS_DIR+, extra directory to fetch tasks from
+* +ADK_APPLIANCE+, the appliance task you want to build 
 * +ADK_TARGET_ARCH+, the architecture of the target system
 * +ADK_TARGET_ARCH+, the architecture of the target system
 * +ADK_TARGET_SYSTEM+, the embedded target system name
 * +ADK_TARGET_SYSTEM+, the embedded target system name
 * +ADK_TARGET_LIBC+, the C library for the target system
 * +ADK_TARGET_LIBC+, the C library for the target system
 * +ADK_VERBOSE+, verbose build, when set to 1
 * +ADK_VERBOSE+, verbose build, when set to 1
 
 
-
 An example that creates a configuration file for Raspberry PI with all
 An example that creates a configuration file for Raspberry PI with all
 software packages enabled, but not included in the resulting firmware image:
 software packages enabled, but not included in the resulting firmware image:
 
 
@@ -86,3 +84,4 @@ software packages enabled, but not included in the resulting firmware image:
 
 
 This is often used in the development process of a target system, to verify that
 This is often used in the development process of a target system, to verify that
 all packages are compilable.
 all packages are compilable.
+

+ 1 - 3
docs/using.txt

@@ -35,9 +35,7 @@ image::openadk-task.png[]
 
 
 If you want to compile some predefined appliance tasks, you can select it in +Tasks+.
 If you want to compile some predefined appliance tasks, you can select it in +Tasks+.
 You can later simply add your own tasks, which is a collection of options, packages,
 You can later simply add your own tasks, which is a collection of options, packages,
-kernel modules or features, runtime configuration and more. They can either be placed
-inside the +tasks+ directory or in your own custom directory that you pass via
-+ADK_CUSTOM_TASKS_DIR+ to make.
+kernel modules or features, runtime configuration and more.
 
 
 When you are ready exit and save. You can always redefine the
 When you are ready exit and save. You can always redefine the
 configuration using +make menuconfig+.
 configuration using +make menuconfig+.

+ 0 - 1
mk/fetch.mk

@@ -81,7 +81,6 @@ $(1):
 			git clone --progress $${PKG_SITES} $${PKG_NAME}-$${PKG_VERSION} $(DL_TRACE); \
 			git clone --progress $${PKG_SITES} $${PKG_NAME}-$${PKG_VERSION} $(DL_TRACE); \
 			if [ $$$$? -ne 0 ]; then echo "git clone error"; exit 1; fi; \
 			if [ $$$$? -ne 0 ]; then echo "git clone error"; exit 1; fi; \
 			(cd $${PKG_NAME}-$${PKG_VERSION}; git checkout $${PKG_VERSION}) $(DL_TRACE); \
 			(cd $${PKG_NAME}-$${PKG_VERSION}; git checkout $${PKG_VERSION}) $(DL_TRACE); \
-			if [ $$$$? -ne 0 ]; then echo "git checkout error"; exit 1; fi; \
 			;; \
 			;; \
 		  esac ;\
 		  esac ;\
 		else \
 		else \

+ 2 - 7
mk/image.mk

@@ -53,13 +53,8 @@ extra-install:
 	@-if [ -h ${TARGET_DIR}/etc/resolv.conf -a -f $(ADK_TOPDIR)/extra/etc/resolv.conf ];then \
 	@-if [ -h ${TARGET_DIR}/etc/resolv.conf -a -f $(ADK_TOPDIR)/extra/etc/resolv.conf ];then \
 		rm ${TARGET_DIR}/etc/resolv.conf;\
 		rm ${TARGET_DIR}/etc/resolv.conf;\
 	fi
 	fi
-	@if test -d '${ADK_TOPDIR}/extra'; then \
-		(cd '${ADK_TOPDIR}/extra' && tar -cf - .) | \
-		    (cd ${TARGET_DIR}; tar -xf -); \
-	fi
-ifneq (,$(strip ${extra}))
-	@(cd '${extra}' && tar -cf - .) | (cd ${TARGET_DIR}; tar -xf -)
-endif
+	@if [ -d $(ADK_TOPDIR)/extra ];then $(CP) $(ADK_TOPDIR)/extra/* ${TARGET_DIR};fi
+	@if [ ! -z $(extra) ];then $(CP) $(extra)/* ${TARGET_DIR};fi
 
 
 image-prepare-post:
 image-prepare-post:
 	$(BASH) $(ADK_TOPDIR)/scripts/update-rcconf
 	$(BASH) $(ADK_TOPDIR)/scripts/update-rcconf

+ 18 - 12
mk/kernel-ver.mk

@@ -16,34 +16,34 @@ KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(ADK_TARGET_KERNEL_GIT_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(ADK_TARGET_KERNEL_GIT_VER)-$(KERNEL_RELEASE)
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_13),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_13),y)
-KERNEL_FILE_VER:=	4.13.13
+KERNEL_FILE_VER:=	4.13.2
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		15bc883ca8bdde8820c9dbc536ade46be21f920d095e00ae8304aeb482aafe47
+KERNEL_HASH:=		064adc177a384a7aee6b18ef5d47c1cea3a43fae1aaa6aa95fdc97eb137ffcd1
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_9),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_9),y)
-KERNEL_FILE_VER:=	4.9.60
+KERNEL_FILE_VER:=	4.9.50
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		0e326c5c5152c41265d1c681b41b52afce1925f4a382dfd41cb93605f3fcad04
+KERNEL_HASH:=		2c0914c8ba3606e34c68b086ad0f470a04072d59816452c4c51e06850f2f1536
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_4),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_4),y)
-KERNEL_FILE_VER:=	4.4.96
+KERNEL_FILE_VER:=	4.4.88
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		241d3d5d15cdf26fee89cc587cb865294efdbc5c94cac2c89b36f17223665bab
+KERNEL_HASH:=		144fe8dd773ec317fa06109b8d7bd04141bf1941daa03799fb4f437bbbb919b4
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_1),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_1),y)
-KERNEL_FILE_VER:=	4.1.45
+KERNEL_FILE_VER:=	4.1.43
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		76700a6a788c5750e3421eba004190cdc5b63f62726fce3b5fa27bd1c2cd5912
+KERNEL_HASH:=		2c018c3f499fab25f8854734665dd44c56adcfba4291999f0aa31ca83110398a
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_3_16),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_3_16),y)
-KERNEL_FILE_VER:=	3.16.49
+KERNEL_FILE_VER:=	3.16.48
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		7ab9ab2efb584b36685bae83f8005a699186ad0d70e6b659de58c89d0ec55f96
+KERNEL_HASH:=		21a405a5f72602ab66ea2cae2a57540874de2181eca36720a59398b7a6a2f25a
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_3_10),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_3_10),y)
 KERNEL_FILE_VER:=	3.10.107
 KERNEL_FILE_VER:=	3.10.107
@@ -51,11 +51,17 @@ KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_HASH:=		948ae756ba90b3b981fb8245789ea1426d43c351921df566dd5463171883edc3
 KERNEL_HASH:=		948ae756ba90b3b981fb8245789ea1426d43c351921df566dd5463171883edc3
 endif
 endif
+ifeq ($(ADK_TARGET_KERNEL_VERSION_3_4),y)
+KERNEL_FILE_VER:=	3.4.113
+KERNEL_RELEASE:=	1
+KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
+KERNEL_HASH:=		c474a1d630357e64ae89f374a2575fa9623e87ea1a97128c4d83f08d4e7a0b4f
+endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_3_2),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_3_2),y)
-KERNEL_FILE_VER:=	3.2.94
+KERNEL_FILE_VER:=	3.2.93
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		0bc5856e6de4ad1a941c6d2b0014493c31800dcd51db3e561c38a19b99621f60
+KERNEL_HASH:=		7da5a25573500ae98a3bb76a92ac4dfca7f3f56395206365046e10de920c458f
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_2_6_32),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_2_6_32),y)
 KERNEL_FILE_VER:=	2.6.32.70
 KERNEL_FILE_VER:=	2.6.32.70

+ 1 - 1
mk/vars.mk

@@ -76,7 +76,7 @@ ifeq ($(ADK_TARGET_ARCH_C6X),y)
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_LINUXTYPE)
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_LINUXTYPE)
 endif
 endif
 ifeq ($(ADK_TARGET_ARCH_CSKY),y)
 ifeq ($(ADK_TARGET_ARCH_CSKY),y)
-ifeq ($(ADK_TARGET_CPU_CSKY_CK610),y)
+ifeq ($(ADK_TARGET_CPU_CSKY_CK610F),y)
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-unknown-$(ADK_TARGET_LINUXTYPE)
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-unknown-$(ADK_TARGET_LINUXTYPE)
 else
 else
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-abiv2-$(ADK_TARGET_LINUXTYPE)
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-abiv2-$(ADK_TARGET_LINUXTYPE)

+ 0 - 44
package/ajstarks-openvg/Makefile

@@ -1,44 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-include $(ADK_TOPDIR)/rules.mk
-
-# always use tab spaces as separator, no spaces
-PKG_NAME:=		ajstarks-openvg
-PKG_VERSION:=		a236978e8009c948083bd15b201d8f4ceb3c035d
-PKG_GIT:=		hash
-PKG_RELEASE:=		2
-PKG_DESCR:=		openvg utility library
-PKG_BUILDDEP:=		bcm28xx-vc freetype libjpeg-turbo
-PKG_SECTION:=		libs/video
-PKG_DEPENDS:=		bcm28xx-vc bcm28xx-vc-libs libfreetype libjpeg-turbo
-PKG_URL:=		https://github.com/ajstarks/openvg
-PKG_SITES:=		https://github.com/ajstarks/openvg.git
-
-PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 raspberry-pi3 raspberry-pi3-64
-
-include $(ADK_TOPDIR)/mk/package.mk
-
-$(eval $(call PKG_template,AJSTARKS_OPENVG,ajstarks-openvg,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
-
-CONFIG_STYLE:=		manual
-BUILD_STYLE:=		manual
-INSTALL_STYLE:=		manual
-
-do-build:
-	${MAKE} -C ${WRKBUILD} library
-
-# please install all files and directories to the package dir
-
-
-ajstarks-openvg-install:
-	$(INSTALL_DIR) $(IDIR_AJSTARKS_OPENVG)/usr/lib
-	$(INSTALL_BIN) $(WRKBUILD)/lib*.so \
-		$(IDIR_AJSTARKS_OPENVG)/usr/lib
-
-	${INSTALL_DIR} $(STAGING_TARGET_DIR)/usr/include
-	$(CP) $(WRKBUILD)/shapes.h $(STAGING_TARGET_DIR)/usr/include
-	$(CP) $(WRKBUILD)/fontinfo.h $(STAGING_TARGET_DIR)/usr/include
-
-# please remove ALL above comments, before commiting
-include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 0 - 64
package/ajstarks-openvg/patches/patch-DejaVuSansMono_inc

@@ -1,64 +0,0 @@
---- ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d.orig/DejaVuSansMono.inc	2017-07-26 14:27:15.000000000 +0200
-+++ ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d/DejaVuSansMono.inc	2017-07-26 16:45:47.000000000 +0200
-@@ -1,6 +1,6 @@
- /* Generated by font2openvg. See http://developer.hybrid.fi for more information. */
- 
--/* converted from font file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf */
-+/* converted from font file dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf */
- /* font family name: DejaVu Sans Mono */
- /* font style name: Book */
- 
-@@ -933,8 +933,8 @@ static const int DejaVuSansMono_glyphPoi
-     43088,56480,9312,56480,9312,-10544,4416,-15392,4416,61376,47936,61376,47936,-15392,4416,-15392,9312,-10544,43088,-10544,
-     43088,56480,9312,56480,9312,-10544,4416,-15392,4416,61376,47936,61376,47936,-15392,4416,-15392,9312,-10544,43088,-10544,
-     43088,56480,9312,56480,9312,-10544,4416,-15392,4416,61376,47936,61376,47936,-15392,4416,-15392,9312,-10544,43088,-10544,
--    43088,56480,9312,56480,9312,-10544,21936,52656,21936,63456,30560,63456,30560,52656,21936,52656,21936,0,21936,27840,
--    22816,43008,29664,43008,30560,27840,30560,0,21936,0,45088,45776,45088,38464,42240,40160,39480,41096,36720,42032,
-+    43088,56480,9312,56480,9312,-10544,21936,36800,21936,47600,30560,47600,30560,36800,21936,36800,21936,-15856,21936,11984,
-+    22816,27152,29664,27152,30560,11984,30560,-15856,21936,-15856,45088,45776,45088,38464,42240,40160,39480,41096,36720,42032,
-     34048,42208,34048,5232,36720,5440,39504,6400,42288,7360,45088,9056,45088,1744,41984,432,39224,-296,36464,-1024,
-     34048,-1152,34048,-13296,29664,-13296,29664,-1152,20096,-208,14576,6440,9056,13088,9056,23760,9056,34384,14640,41120,
-     20224,47856,29664,48656,29664,60864,34048,60864,34048,48656,36464,48528,39224,47808,41984,47088,45088,45776,29664,5392,
-@@ -1036,12 +1036,12 @@ static const int DejaVuSansMono_glyphPoi
-     23600,48000,21256,49616,18912,51232,14288,51232,11488,51232,11488,55824,14624,55824,18576,55824,20664,57168,22752,58512,
-     22752,61056,22752,63440,20712,64776,18672,66112,14960,66112,13104,66112,10720,65600,8336,65088,5824,64112,5824,69264,
-     8768,69984,11248,70368,13728,70752,15856,70752,22016,70752,25592,68240,29168,65728,29168,61520,29168,58512,27296,56528,
--    25424,54544,21856,53744,2160,21424,1152,26016,46192,37152,47344,32560,2160,21424,23328,46416,31408,46416,31408,39872,
--    31408,35696,30112,32784,28816,29872,25248,26400,21424,22608,18784,20096,17784,18232,16784,16368,16784,14288,16784,10496,
--    19568,8160,22352,5824,26992,5824,30304,5824,34088,7288,37872,8752,42032,11648,42032,3648,38032,1232,33976,40,
--    29920,-1152,25504,-1152,17600,-1152,12904,2928,8208,7008,8208,13856,8208,17088,9632,19872,11056,22656,15040,26560,
--    18784,30224,21632,32944,22440,34728,23248,36512,23248,39184,23248,39232,23248,39392,23328,40368,23328,41184,23328,46416,
--    31664,52656,23072,52656,23072,63456,31664,63456,31664,52656,26176,55888,17120,23424,35232,23424,26176,55888,20992,63456,
-+    25424,54544,21856,53744,2160,21424,1152,26016,46192,37152,47344,32560,2160,21424,23328,30560,31408,30560,31408,24016,
-+    31408,19840,30112,16936,28816,14032,25248,10544,21424,6752,18784,4256,17784,2384,16784,512,16784,-1568,16784,-5360,
-+    19568,-7696,22352,-10032,26992,-10032,30304,-10032,34088,-8568,37872,-7104,42032,-4208,42032,-12192,38032,-14624,33976,-15816,
-+    29920,-17008,25504,-17008,17600,-17008,12904,-12928,8208,-8848,8208,-2000,8208,1232,9632,4016,11056,6800,15040,10704,
-+    18784,14368,21632,17088,22440,18872,23248,20656,23248,23328,23248,23376,23248,23552,23328,24528,23328,25328,23328,30560,
-+    31664,36800,23072,36800,23072,47600,31664,47600,31664,36800,26176,55888,17120,23424,35232,23424,26176,55888,20992,63456,
-     31408,63456,50832,0,41952,0,37280,16528,15040,16528,10448,0,1568,0,20992,63456,23840,80208,32208,68992,
-     25664,68992,16016,80208,23840,80208,26176,55888,17120,23424,35232,23424,26176,55888,20992,63456,31408,63456,50832,0,
-     41952,0,37280,16528,15040,16528,10448,0,1568,0,20992,63456,28560,80208,36464,80208,26736,68992,20192,68992,
-@@ -1731,10 +1731,10 @@ static const int DejaVuSansMono_glyphPoi
-     19952,7016,22528,5744,26176,5744,29872,5744,32424,7016,34976,8288,36384,10800,37024,11856,37272,13808,37520,15760,
-     37520,20352,37520,63456,46112,63456,46112,24352,46112,14624,44904,10520,43696,6416,40720,3744,37904,1232,34296,0,
-     30688,-1232,26176,-1232,21712,-1232,18104,0,14496,1232,11648,3744,8720,6368,7480,10560,6240,14752,6240,24352,
--    37872,79104,37872,74224,34488,70824,31104,67424,26176,67424,21296,67424,17912,70824,14528,74224,14528,79104,14528,84000,
--    17912,87376,21296,90752,26176,90752,31104,90752,34488,87376,37872,84000,37872,79104,32640,79104,32640,81776,30768,83648,
--    28896,85520,26176,85520,23456,85520,21608,83672,19760,81824,19760,79104,19760,76336,21608,74488,23456,72640,26176,72640,
--    28896,72640,30768,74512,32640,76384,32640,79104,8288,18016,8288,47520,16112,47520,16112,18016,16112,11600,18384,8584,
-+    37872,68864,37872,63984,34488,60584,31104,57184,26176,57184,21296,57184,17912,60584,14528,63984,14528,68864,14528,73760,
-+    17912,77136,21296,80512,26176,80512,31104,80512,34488,77136,37872,73760,37872,68864,32640,68864,32640,71536,30768,73408,
-+    28896,75280,26176,75280,23456,75280,21608,73432,19760,71584,19760,68864,19760,66096,21608,64248,23456,62400,26176,62400,
-+    28896,62400,30768,64272,32640,66144,32640,68864,8288,18016,8288,47520,16112,47520,16112,18016,16112,11600,18384,8584,
-     20656,5568,25408,5568,30944,5568,33872,9456,36800,13344,36800,20608,36800,47520,44672,47520,44672,0,36800,0,
-     36800,7136,34720,3024,31128,896,27536,-1232,22736,-1232,15424,-1232,11856,3552,8288,8336,8288,18016,38896,62720,
-     38896,57840,35512,54440,32128,51040,27200,51040,22320,51040,18936,54440,15552,57840,15552,62720,15552,67616,18936,70992,
-@@ -2211,7 +2211,7 @@ static const int DejaVuSansMono_glyphAdv
-     52400,52400,52400,52400,52400,52400,52400,52400 };
- 
- static const int DejaVuSansMono_descender_height = -24064;
--static const int DejaVuSansMono_font_height = 90752;
-+static const int DejaVuSansMono_font_height = 86448;
- static const int DejaVuSansMono_glyphCount = 468;
- static const short DejaVuSansMono_characterMap[500] = {
-     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,

+ 0 - 40
package/ajstarks-openvg/patches/patch-DejaVuSans_inc

@@ -1,40 +0,0 @@
---- ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d.orig/DejaVuSans.inc	2017-07-26 14:27:15.000000000 +0200
-+++ ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d/DejaVuSans.inc	2017-07-26 16:44:58.000000000 +0200
-@@ -1,6 +1,6 @@
- /* Generated by font2openvg. See http://developer.hybrid.fi for more information. */
- 
--/* converted from font file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf */
-+/* converted from font file dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf */
- /* font family name: DejaVu Sans */
- /* font style name: Book */
- 
-@@ -922,8 +922,8 @@ static const int DejaVuSans_glyphPoints[
-     43008,-10544,43008,56480,9216,56480,9216,-10544,4336,-15392,4336,61376,47856,61376,47856,-15392,4336,-15392,9216,-10544,
-     43008,-10544,43008,56480,9216,56480,9216,-10544,4336,-15392,4336,61376,47856,61376,47856,-15392,4336,-15392,9216,-10544,
-     43008,-10544,43008,56480,9216,56480,9216,-10544,4336,-15392,4336,61376,47856,61376,47856,-15392,4336,-15392,9216,-10544,
--    43008,-10544,43008,56480,9216,56480,9216,-10544,21760,52656,13136,52656,13136,63456,21760,63456,21760,52656,21760,0,
--    13136,0,13136,27840,14032,43008,20912,43008,21760,27840,21760,0,28816,5568,28816,41952,22560,41184,19080,36384,
-+    43008,-10544,43008,56480,9216,56480,9216,-10544,21760,36800,13136,36800,13136,47600,21760,47600,21760,36800,21760,-15856,
-+    13136,-15856,13136,11984,14032,27152,20912,27152,21760,11984,21760,-15856,28816,5568,28816,41952,22560,41184,19080,36384,
-     15600,31584,15600,23760,15600,15888,19080,11088,22560,6288,28816,5568,45008,45776,45008,38464,41856,40208,38968,41096,
-     36080,41984,33200,42112,33152,5392,36128,5616,39040,6504,41952,7392,45008,9056,45008,1824,42240,560,39328,-184,
-     36416,-928,33152,-1232,33152,-13296,28816,-13296,28816,-1056,18576,-208,12944,6312,7312,12832,7312,23760,7312,34720,
-@@ -1025,12 +1025,12 @@ static const int DejaVuSans_glyphPoints[
-     5392,63120,8496,63840,11216,64224,13936,64608,16272,64608,22400,64608,25992,62096,29584,59584,29584,55376,29584,52448,
-     27672,50408,25760,48368,22272,47600,69424,30064,56288,12256,69424,12256,69424,30064,68496,35200,75552,35200,75552,12256,
-     81280,12256,81280,7616,75552,7616,75552,-288,69424,-288,69424,7616,51824,7616,51824,12768,68496,35200,58496,64608,
--    65296,64608,25680,-1232,18880,-1232,58496,64608,21248,46416,29328,46416,29328,39776,29328,35488,28160,32728,26992,29968,
--    23168,26272,19344,22528,16880,20272,15792,18272,14704,16272,14704,14192,14704,10416,17488,8080,20272,5744,24912,5744,
--    28224,5744,32048,7232,35872,8720,39952,11568,39952,3568,35952,1152,31872,-40,27792,-1232,23424,-1232,15600,-1232,
--    10840,2888,6080,7008,6080,13776,6080,17008,7632,19912,9184,22816,12960,26480,16704,30128,18736,32128,19544,33256,
--    20352,34384,20704,35440,20992,36336,21120,37608,21248,38880,21248,41184,21248,46416,29584,52656,20992,52656,20992,63456,
--    29584,63456,29584,52656,29744,54992,18112,23424,41440,23424,29744,54992,24912,63456,34640,63456,58816,0,49888,0,
-+    65296,64608,25680,-1232,18880,-1232,58496,64608,21248,30560,29328,30560,29328,23920,29328,19632,28160,16872,26992,14112,
-+    23168,10416,19344,6672,16880,4416,15792,2424,14704,432,14704,-1664,14704,-5440,17488,-7776,20272,-10112,24912,-10112,
-+    28224,-10112,32048,-8624,35872,-7136,39952,-4288,39952,-12288,35952,-14704,31872,-15896,27792,-17088,23424,-17088,15600,-17088,
-+    10840,-12968,6080,-8848,6080,-2080,6080,1152,7632,4064,9184,6976,12960,10624,16704,14288,18736,16272,19544,17400,
-+    20352,18528,20704,19600,20992,20480,21120,21760,21248,23040,21248,25328,21248,30560,29584,36800,20992,36800,20992,47600,
-+    29584,47600,29584,36800,29744,54992,18112,23424,41440,23424,29744,54992,24912,63456,34640,63456,58816,0,49888,0,
-     44112,16272,15520,16272,9728,0,688,0,24912,63456,27024,80208,35344,68992,28848,68992,19072,80208,27024,80208,
-     29744,54992,18112,23424,41440,23424,29744,54992,24912,63456,34640,63456,58816,0,49888,0,44112,16272,15520,16272,
-     9728,0,688,0,24912,63456,31776,80208,39632,80208,29952,68992,23440,68992,31776,80208,29744,54992,18112,23424,

+ 0 - 357
package/ajstarks-openvg/patches/patch-DejaVuSerif_inc

@@ -1,357 +0,0 @@
---- ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d.orig/DejaVuSerif.inc	2017-07-26 14:27:15.000000000 +0200
-+++ ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d/DejaVuSerif.inc	2017-07-26 16:45:32.000000000 +0200
-@@ -1,10 +1,10 @@
- /* Generated by font2openvg. See http://developer.hybrid.fi for more information. */
- 
--/* converted from font file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf */
-+/* converted from font file dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf */
- /* font family name: DejaVu Serif */
- /* font style name: Book */
- 
--static const unsigned char DejaVuSerif_glyphInstructions[13960] = {
-+static const unsigned char DejaVuSerif_glyphInstructions[13964] = {
-     2,10,10,10,10,10,10,10,10,0,2,4,4,4,4,4,4,0,2,4,
-     4,4,4,0,2,4,4,4,4,0,2,4,4,4,4,0,2,4,4,4,
-     4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
-@@ -673,36 +673,37 @@ static const unsigned char DejaVuSerif_g
-     0,2,10,10,10,10,10,10,4,4,10,10,10,10,4,4,10,10,10,10,
-     10,10,10,10,4,4,10,10,10,10,4,10,10,10,10,0,2,10,10,10,
-     10,4,0,2,10,10,10,10,10,10,10,10,4,4,4,4,4,4,4,4,
--    4,4,4,4,4,10,10,10,10,10,10,10,10,4,4,0,2,4,4,4,
--    10,10,10,10,10,10,10,10,0,2,4,10,10,10,10,4,4,10,10,10,
--    10,4,10,10,10,10,10,10,10,10,4,4,4,4,4,4,4,4,0,2,
--    4,4,4,4,4,4,4,0,2,10,10,10,10,10,10,10,10,4,4,4,
--    4,4,10,10,10,10,10,10,10,10,4,4,0,2,4,4,4,4,4,4,
--    4,0,2,4,10,10,10,10,4,4,10,10,10,10,4,10,10,10,10,10,
--    10,10,10,4,4,4,4,0,2,10,10,10,10,10,10,10,10,4,0,2,
-+    4,4,4,4,4,10,10,10,10,10,10,10,10,4,4,0,2,10,10,10,
-+    10,10,10,10,10,4,0,2,10,10,10,10,10,10,10,10,4,4,4,4,
-+    4,10,4,4,4,10,10,10,10,4,4,4,4,10,4,0,2,10,10,10,
-+    10,4,0,2,4,4,4,4,4,4,4,0,2,10,10,10,10,10,10,10,
-+    10,4,4,4,4,4,10,10,10,10,10,10,10,10,4,4,0,2,4,4,
-+    4,4,4,4,4,0,2,4,10,10,10,10,4,4,10,10,10,10,4,10,
-+    10,10,10,10,10,10,10,4,4,4,4,0,2,10,10,10,10,10,10,10,
-+    10,4,0,2,4,4,4,4,4,4,4,0,2,4,4,4,4,4,4,4,
-+    4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,
-     4,4,4,4,4,4,4,0,2,4,4,4,4,4,4,4,4,4,4,4,
--    4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,4,4,4,4,
--    4,4,4,0,2,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
--    4,4,4,4,4,4,4,4,4,4,4,0,2,4,4,10,10,10,10,10,
--    4,10,10,10,10,10,10,0,2,10,10,10,10,10,10,10,10,0,2,10,
--    10,10,10,10,10,10,10,10,10,10,10,10,10,0,2,4,4,10,10,10,
--    10,10,4,10,10,10,10,10,10,0,2,10,10,10,10,10,10,10,10,0,
--    2,10,10,10,10,10,10,10,10,0,2,4,4,4,4,0,2,4,4,10,
-+    4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,4,4,10,
-     10,10,10,10,4,10,10,10,10,10,10,0,2,10,10,10,10,10,10,10,
-     10,0,2,10,10,10,10,10,10,10,10,10,10,10,10,10,10,0,2,4,
--    4,4,4,0,2,4,4,10,10,10,10,10,4,10,10,10,10,10,10,0,
--    2,10,10,10,10,10,10,10,10,0,2,10,10,10,10,10,10,10,10,0,
-+    4,10,10,10,10,10,4,10,10,10,10,10,10,0,2,10,10,10,10,10,
-+    10,10,10,0,2,10,10,10,10,10,10,10,10,0,2,4,4,4,4,0,
-+    2,4,4,10,10,10,10,10,4,10,10,10,10,10,10,0,2,10,10,10,
-+    10,10,10,10,10,0,2,10,10,10,10,10,10,10,10,10,10,10,10,10,
-+    10,0,2,4,4,4,4,0,2,4,4,10,10,10,10,10,4,10,10,10,
-+    10,10,10,0,2,10,10,10,10,10,10,10,10,0,2,10,10,10,10,10,
-+    10,10,10,0,2,4,4,4,4,4,4,4,0,2,4,4,4,4,4,4,
-+    4,4,4,4,4,10,10,10,10,10,10,4,4,10,10,10,10,10,10,0,
-     2,4,4,4,4,4,4,4,0,2,4,4,4,4,4,4,4,4,4,4,
-     4,10,10,10,10,10,10,4,4,10,10,10,10,10,10,0,2,4,4,4,
--    4,4,4,4,0,2,4,4,4,4,4,4,4,4,4,4,4,10,10,10,
--    10,10,10,4,4,10,10,10,10,10,10,0,2,4,4,4,4,10,10,10,
--    10,4,4,10,10,10,10,4,0,2,4,4,4,4,4,4,4,0,2,4,
--    4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,4,10,10,10,10,
--    4,4,0,2,4,4,4,4,4,4,10,10,10,10,4,0,2,4,4,4,
--    4,4,4,4,4,4,4,4,4,4,4,0,2,4,10,10,10,10,4,4,
--    0,2,4,4,4,4,4,4,10,10,10,10,4,0,2,4,4,4,4,4,
--    4,4,4,4,4,4,4,4,4,0,2,4,4,4,4,10,10,10,10,10,
--    10,10,10,4,4,4,4,4,0,2,4,10,10,10,10,10,10,10,10,0 };
-+    4,10,10,10,10,4,4,10,10,10,10,4,0,2,4,4,4,4,4,4,
-+    4,0,2,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,4,
-+    10,10,10,10,4,4,0,2,4,4,4,4,4,4,10,10,10,10,4,0,
-+    2,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,4,10,10,
-+    10,10,4,4,0,2,4,4,4,4,4,4,10,10,10,10,4,0,2,4,
-+    4,4,4,4,4,4,4,4,4,4,4,4,4,0,2,4,4,4,4,10,
-+    10,10,10,10,10,10,10,4,4,4,4,4,0,2,4,10,10,10,10,10,
-+    10,10,10,0 };
- static const int DejaVuSerif_glyphInstructionIndices[468] = {
-     0,0,18,30,66,110,156,202,208,220,232,252,266,275,281,291,297,317,330,354,
-     387,409,435,465,476,514,544,564,583,592,604,613,642,700,723,758,781,803,829,853,
-@@ -726,8 +727,8 @@ static const int DejaVuSerif_glyphInstru
-     10803,10846,10873,10901,10931,10973,11009,11050,11085,11115,11154,11193,11225,11257,11273,11304,11337,11357,11388,11411,
-     11451,11491,11521,11546,11572,11604,11628,11652,11679,11706,11733,11757,11788,11816,11844,11872,11896,11902,11914,11936,
-     11948,11995,12042,12097,12132,12175,12214,12255,12304,12359,12391,12435,12458,12479,12514,12543,12576,12609,12659,12709,
--    12759,12809,12862,12915,12965,13015,13039,13088,13149,13188,13239,13285,13343,13376,13419,13453,13499,13535,13572,13614,
--    13650,13698,13740,13776,13812,13838,13876,13914 };
-+    12759,12809,12862,12915,12965,13015,13039,13088,13149,13188,13239,13285,13343,13376,13423,13457,13503,13539,13576,13618,
-+    13654,13702,13744,13780,13816,13842,13880,13918 };
- static const int DejaVuSerif_glyphInstructionCounts[468] = {
-     0,18,12,36,44,46,46,6,12,12,20,14,9,6,10,6,20,13,24,33,
-     22,26,30,11,38,30,20,19,9,12,9,29,58,23,35,23,22,26,24,25,
-@@ -751,7 +752,7 @@ static const int DejaVuSerif_glyphInstru
-     43,27,28,30,42,36,41,35,30,39,39,32,32,16,31,33,20,31,23,40,
-     40,30,25,26,32,24,24,27,27,27,24,31,28,28,28,24,6,12,22,12,
-     47,47,55,35,43,39,41,49,55,32,44,23,21,35,29,33,33,50,50,50,
--    50,53,53,50,50,24,49,61,39,51,46,58,33,43,34,46,36,37,42,36,
-+    50,53,53,50,50,24,49,61,39,51,46,58,33,47,34,46,36,37,42,36,
-     48,42,36,36,26,38,38,46 };
- 
- static const int DejaVuSerif_glyphPointIndices[468] = {
-@@ -777,9 +778,9 @@ static const int DejaVuSerif_glyphPointI
-     14289,14347,14381,14416,14465,14537,14597,14666,14722,14762,14823,14872,14927,14982,14997,15048,15095,15118,15164,15194,
-     15251,15308,15357,15395,15426,15473,15496,15519,15557,15595,15633,15666,15708,15748,15787,15826,15856,15861,15871,15892,
-     15902,15953,16004,16071,16112,16168,16220,16267,16329,16405,16434,16495,16516,16535,16589,16631,16670,16709,16779,16849,
--    16919,16989,17062,17135,17205,17275,17313,17373,17465,17508,17583,17626,17716,17764,17829,17877,17944,17978,18013,18085,
--    18145,18222,18287,18333,18379,18411,18454,18497 };
--static const int DejaVuSerif_glyphPoints[18556*2] = {
-+    16919,16989,17062,17135,17205,17275,17313,17373,17465,17508,17583,17626,17716,17764,17834,17882,17949,17983,18018,18090,
-+    18150,18227,18292,18338,18384,18416,18459,18502 };
-+static const int DejaVuSerif_glyphPoints[18561*2] = {
-     11856,4416,11856,6800,13472,8456,15088,10112,17504,10112,19840,10112,21504,8456,23168,6800,23168,4416,23168,2080,
-     21504,424,19840,-1232,17504,-1232,15088,-1232,13472,408,11856,2048,11856,4416,12032,63456,22992,63456,20096,28560,
-     20096,17856,14880,17856,14880,28560,12032,63456,15296,63456,15296,39872,8544,39872,8544,63456,15296,63456,31488,63456,
-@@ -1100,9 +1101,9 @@ static const int DejaVuSerif_glyphPoints
-     9216,-10544,4336,-15392,4336,61376,47856,61376,47856,-15392,4336,-15392,9216,-10544,43008,-10544,43008,56480,9216,56480,
-     9216,-10544,4336,-15392,4336,61376,47856,61376,47856,-15392,4336,-15392,9216,-10544,43008,-10544,43008,56480,9216,56480,
-     9216,-10544,4336,-15392,4336,61376,47856,61376,47856,-15392,4336,-15392,9216,-10544,43008,-10544,43008,56480,9216,56480,
--    9216,-10544,11856,59040,11856,61408,13472,63048,15088,64688,17504,64688,19840,64688,21504,63032,23168,61376,23168,59040,
--    23168,56656,21504,55000,19840,53344,17504,53344,15088,53344,13472,55000,11856,56656,11856,59040,12032,0,14880,34896,
--    14880,45600,20096,45600,20096,34896,22992,0,12032,0,26736,42112,21248,41488,18504,36600,15760,31712,15760,22608,
-+    9216,-10544,11856,43184,11856,45568,13472,47200,15088,48832,17504,48832,19840,48832,21504,47176,23168,45520,23168,43184,
-+    23168,40800,21504,39144,19840,37488,17504,37488,15088,37488,13472,39144,11856,40800,11856,43184,12032,-15856,14880,19040,
-+    14880,29744,20096,29744,20096,19040,22992,-15856,12032,-15856,26736,42112,21248,41488,18504,36600,15760,31712,15760,22608,
-     15760,13472,18504,8584,21248,3696,26736,3056,26736,42112,46928,13552,45440,7008,41440,3336,37440,-336,30976,-1152,
-     30976,-12624,26736,-12624,26736,-1152,17376,-336,11960,6040,6544,12416,6544,22608,6544,32896,11960,39248,17376,45600,
-     26736,46320,26736,57632,30976,57632,30976,46320,34896,45984,38464,45008,42032,44032,45440,42368,45440,30816,40928,30816,
-@@ -1212,12 +1213,12 @@ static const int DejaVuSerif_glyphPoints
-     4256,37360,7232,37312,7440,34176,9520,32536,11600,30896,15520,30896,19504,30896,21672,32768,23840,34640,23840,38128,
-     23840,42080,21672,44096,19504,46112,15216,46112,12960,46112,12960,49264,14112,49264,18240,49264,20344,50832,22448,52400,
-     22448,55552,22448,58400,20720,59928,18992,61456,15760,61456,12288,61456,10440,60096,8592,58736,8288,55968,5312,55968,
--    5312,62384,58912,64608,65296,64608,25248,-1232,18880,-1232,58912,64608,33072,59040,33072,56656,31432,55000,29792,53344,
--    27408,53344,25072,53344,23416,55000,21760,56656,21760,59040,21760,61376,23416,63032,25072,64688,27408,64688,29840,64688,
--    31456,63048,33072,61408,33072,59040,42464,2800,37952,800,33912,-176,29872,-1152,26272,-1152,16880,-1152,11392,3400,
--    5904,7952,5904,15680,5904,23584,10624,28600,15344,33616,24816,35792,24816,46576,30048,46576,30048,32640,22528,30816,
--    18704,26520,14880,22224,14880,15600,14880,9776,18000,6416,21120,3056,26480,3056,31280,3056,34384,5840,37488,8624,
--    38384,13856,42464,13856,42464,2800,17424,22992,40720,22992,29072,53168,17424,22992,-512,0,-512,4512,5056,4512,
-+    5312,62384,58912,64608,65296,64608,25248,-1232,18880,-1232,58912,64608,33072,43184,33072,40800,31432,39144,29792,37488,
-+    27408,37488,25072,37488,23416,39144,21760,40800,21760,43184,21760,45520,23416,47176,25072,48832,27408,48832,29840,48832,
-+    31456,47200,33072,45568,33072,43184,42464,-13040,37952,-15040,33912,-16024,29872,-17008,26272,-17008,16880,-17008,11392,-12456,
-+    5904,-7904,5904,-176,5904,7728,10624,12744,15344,17760,24816,19936,24816,30720,30048,30720,30048,16784,22528,14960,
-+    18704,10664,14880,6368,14880,-256,14880,-6080,18000,-9440,21120,-12800,26480,-12800,31280,-12800,34384,-10016,37488,-7232,
-+    38384,-2000,42464,-2000,42464,-13040,17424,22992,40720,22992,29072,53168,17424,22992,-512,0,-512,4512,5056,4512,
-     27664,63456,34800,63456,57456,4512,63712,4512,63712,0,40624,0,40624,4512,47680,4512,42368,18448,15680,18448,
-     10368,4512,17344,4512,17344,0,-512,0,28512,80208,36288,68992,31312,68992,20176,80208,28512,80208,17424,22992,
-     40720,22992,29072,53168,17424,22992,-512,0,-512,4512,5056,4512,27664,63456,34800,63456,57456,4512,63712,4512,
-@@ -2024,13 +2025,13 @@ static const int DejaVuSerif_glyphPoints
-     52832,4512,52832,0,37616,0,37616,7984,35440,3488,32000,1128,28560,-1232,24016,-1232,16496,-1232,12944,3040,
-     9392,7312,9392,16448,9392,40624,2336,40624,2336,45184,17248,45184,17248,18864,17248,10624,19272,7568,21296,4512,
-     26480,4512,31920,4512,34768,8504,37616,12496,37616,20096,37616,40624,30816,40624,30816,45184,12192,58912,4080,58912,
--    4080,63456,28896,63456,28896,58912,20784,58912,20784,26096,20784,13936,24760,9136,28736,4336,38464,4336,48192,4336,
--    52168,9136,56144,13936,56144,26096,56144,58912,48032,58912,48032,63456,69440,63456,69440,58912,61376,58912,61376,25248,
--    61376,10752,55808,4760,50240,-1232,36896,-1232,23552,-1232,17872,4800,12192,10832,12192,25248,12192,58912,48768,80128,
--    48768,75248,45384,71848,42000,68448,37120,68448,32240,68448,28856,71848,25472,75248,25472,80128,25472,85024,28856,88400,
--    32240,91776,37120,91776,42000,91776,45384,88400,48768,85024,48768,80128,43584,80128,43584,82800,41712,84672,39840,86544,
--    37120,86544,34352,86544,32504,84696,30656,82848,30656,80128,30656,77360,32504,75512,34352,73664,37120,73664,39840,73664,
--    41712,75536,43584,77408,43584,80128,30816,45184,45440,45184,45440,4512,52832,4512,52832,0,37616,0,37616,7984,
-+    4080,63456,26016,63456,26016,58912,20784,58912,20784,26096,20784,13936,24760,9136,28736,4336,38464,4336,48192,4336,
-+    52168,9136,56144,13936,56144,26096,56144,58912,48528,58912,48528,63456,69440,63456,69440,58912,61376,58912,61376,25248,
-+    61376,10752,55808,4760,50240,-1232,36896,-1232,23552,-1232,17872,4800,12192,10832,12192,25248,12192,58912,48768,68864,
-+    48768,63984,45384,60584,42000,57184,37120,57184,32240,57184,28856,60584,25472,63984,25472,68864,25472,73760,28856,77136,
-+    32240,80512,37120,80512,42000,80512,45384,77136,48768,73760,48768,68864,43584,68864,43584,71536,41712,73408,39840,75280,
-+    37120,75280,34352,75280,32504,73432,30656,71584,30656,68864,30656,66096,32504,64248,34352,62400,37120,62400,39840,62400,
-+    41712,64272,43584,66144,43584,68864,30816,45184,45440,45184,45440,4512,52832,4512,52832,0,37616,0,37616,7984,
-     35440,3488,32000,1128,28560,-1232,24016,-1232,16496,-1232,12944,3040,9392,7312,9392,16448,9392,40624,2336,40624,
-     2336,45184,17248,45184,17248,18864,17248,10624,19272,7568,21296,4512,26480,4512,31920,4512,34768,8504,37616,12496,
-     37616,20096,37616,40624,30816,40624,30816,45184,37504,63744,37504,58864,34120,55464,30736,52064,25856,52064,20976,52064,
-@@ -2079,8 +2080,8 @@ static const int DejaVuSerif_glyphPoints
-     10624,58224,10624,48752,5392,48752,5392,63456,55552,63456,55552,60400,16016,5232,51888,5232,51888,14112,57072,14112,
-     57072,0,3904,0,30736,67568,39200,67568,24752,51584,19776,51584,30736,67568,3488,0,3488,3648,31792,40624,
-     9392,40624,9392,32816,4880,32816,4880,45184,41856,45184,41856,41520,13552,4512,38128,4512,38128,12704,42672,12704,
--    42672,0,3488,0,30464,80688,32464,80688,33952,79200,35440,77712,35440,75760,35440,73632,34016,72208,32592,70784,
--    30464,70784,28336,70784,26912,72208,25488,73632,25488,75760,25488,77712,26976,79200,28464,80688,30464,80688,3904,0,
-+    42672,0,3488,0,30464,79664,32464,79664,33952,78176,35440,76688,35440,74736,35440,72608,34016,71184,32592,69760,
-+    30464,69760,28336,69760,26912,71184,25488,72608,25488,74736,25488,76688,26976,78176,28464,79664,30464,79664,3904,0,
-     3904,3056,43440,58224,10624,58224,10624,48752,5392,48752,5392,63456,55552,63456,55552,60400,16016,5232,51888,5232,
-     51888,14112,57072,14112,57072,0,3904,0,23808,63616,25856,63616,27320,62144,28784,60672,28784,58640,28784,56464,
-     27376,55064,25968,53664,23808,53664,21648,53664,20240,55064,18832,56464,18832,58640,18832,60672,20304,62144,21776,63616,
-@@ -2553,89 +2554,90 @@ static const int DejaVuSerif_glyphPoints
-     64720,-1232,56560,-1232,51376,-1232,46984,704,42592,2640,39264,6368,68256,26272,68000,34176,64920,38192,61840,42208,
-     56064,42208,50656,42208,47536,38168,44416,34128,43776,26272,68256,26272,55712,44496,54224,52448,49512,56248,44800,60048,
-     36384,60048,25408,60048,20016,52992,14624,45936,14624,31664,14624,17680,20192,10496,25760,3312,36544,3312,41360,3312,
--    45736,4504,50112,5696,54064,8080,54064,13600,35184,13600,35184,18144,54064,18144,54064,24432,42112,24432,42112,28992,
--    62688,28992,62688,18144,71232,18144,71232,13600,62688,13600,62688,5312,57040,2048,50512,408,43984,-1232,36544,-1232,
-+    45736,4504,50112,5696,54064,8080,54064,13168,35184,13168,35184,17728,54064,17728,54064,26560,42112,26560,42112,31104,
-+    62688,31104,62688,17728,71232,17728,71232,13168,62688,13168,62688,5312,57040,2048,50512,408,43984,-1232,36544,-1232,
-     22192,-1232,13536,7760,4880,16752,4880,31664,4880,46704,13552,55656,22224,64608,36896,64608,42336,64608,48136,63352,
--    53936,62096,60480,59536,60480,44496,55712,44496,37872,20352,27632,20352,27632,24912,37872,24912,37872,32976,34768,37232,
--    31616,41520,25664,41520,19632,41520,16552,36760,13472,32000,13472,22608,13472,13264,16552,8456,19632,3648,25664,3648,
--    31616,3648,34744,7920,37872,12192,37872,20352,45680,20352,45680,976,45680,-8752,40328,-14048,34976,-19344,25072,-19344,
--    20608,-19344,16528,-18536,12448,-17728,8720,-16112,8720,-6624,12800,-6624,13552,-11056,16400,-13096,19248,-15136,24560,-15136,
--    31456,-15136,34664,-11248,37872,-7360,37872,976,37872,7056,35568,2800,32024,784,28480,-1232,23248,-1232,14912,-1232,
--    9624,5376,4336,11984,4336,22608,4336,33232,9608,39824,14880,46416,23248,46416,28480,46416,32024,44392,35568,42368,
--    37872,38128,37872,45184,53168,45184,53168,40624,45680,40624,45680,24912,53168,24912,53168,20352,45680,20352,32864,68992,
--    23056,80208,27984,80208,36608,73328,45232,80208,50160,80208,40352,68992,32864,68992,55712,44496,54224,52448,49512,56248,
--    44800,60048,36384,60048,25408,60048,20016,52992,14624,45936,14624,31664,14624,17680,20192,10496,25760,3312,36544,3312,
--    41360,3312,45736,4504,50112,5696,54064,8080,54064,24432,42112,24432,42112,28992,62688,28992,62688,5312,57040,2048,
--    50512,408,43984,-1232,36544,-1232,22192,-1232,13536,7760,4880,16752,4880,31664,4880,46704,13552,55656,22224,64608,
--    36896,64608,42336,64608,48136,63352,53936,62096,60480,59536,60480,44496,55712,44496,22288,53632,12304,69616,17232,69616,
--    25856,58560,34480,69616,39408,69616,29424,53632,22288,53632,45680,40624,45680,976,45680,-8752,40328,-14048,34976,-19344,
--    25072,-19344,20608,-19344,16528,-18536,12448,-17728,8720,-16112,8720,-6624,12800,-6624,13552,-11056,16400,-13096,19248,-15136,
--    24560,-15136,31456,-15136,34664,-11248,37872,-7360,37872,976,37872,7056,35568,2800,32024,784,28480,-1232,23248,-1232,
--    14912,-1232,9624,5376,4336,11984,4336,22608,4336,33232,9608,39824,14880,46416,23248,46416,28480,46416,32024,44392,
--    35568,42368,37872,38128,37872,45184,53168,45184,53168,40624,45680,40624,37872,24816,37872,32944,34744,37232,31616,41520,
--    25664,41520,19632,41520,16552,36760,13472,32000,13472,22608,13472,13264,16552,8456,19632,3648,25664,3648,31616,3648,
--    34744,7920,37872,12192,37872,20352,37872,24816,31840,68992,22032,80208,26960,80208,35584,73328,44208,80208,49136,80208,
--    39328,68992,31840,68992,4800,0,4800,4512,12880,4512,12880,58912,4800,58912,4800,63456,29584,63456,29584,58912,
--    21504,58912,21504,34896,48832,58912,41952,58912,41952,63456,63024,63456,63024,58912,55888,58912,28640,34976,59120,4512,
--    66336,4512,66336,0,51600,0,21504,30128,21504,4512,29584,4512,29584,0,4800,0,10336,72064,528,83280,
--    5456,83280,14080,76400,22704,83280,27632,83280,17824,72064,10336,72064,24912,0,2976,0,2976,4512,10032,4512,
--    10032,61632,2512,61632,2512,66128,17856,66128,17856,23072,36896,40624,30384,40624,30384,45184,50832,45184,50832,40624,
--    43088,40624,29664,28224,46832,4512,53344,4512,53344,0,31072,0,31072,4512,37520,4512,24016,23072,17856,17344,
--    17856,4512,24912,4512,24912,0,33936,-1024,37920,-1024,37888,-1104,34176,-6336,34176,-8336,34176,-10288,35600,-11480,
--    37024,-12672,39408,-12672,40560,-12672,41792,-12392,43024,-12112,44304,-11568,44256,-16960,42720,-17344,41296,-17536,39872,-17728,
--    38512,-17728,33712,-17728,31080,-15840,28448,-13952,28448,-10496,28448,-8416,29720,-6184,30992,-3952,33936,-1024,35696,3312,
--    46112,3312,51424,10472,56736,17632,56736,31664,56736,45728,51424,52888,46112,60048,35696,60048,25248,60048,19936,52888,
--    14624,45728,14624,31664,14624,17632,19936,10472,25248,3312,35696,3312,35696,-1232,29248,-1232,23824,896,18400,3024,
--    14288,7136,9520,11904,7200,17936,4880,23968,4880,31664,4880,39360,7200,45416,9520,51472,14288,56224,18448,60400,
--    23800,62504,29152,64608,35696,64608,49520,64608,58016,55552,66512,46496,66512,31664,66512,24048,64176,17952,61840,11856,
--    57072,7136,52912,2976,47560,872,42208,-1232,35696,-1232,23696,-1024,27680,-1024,27648,-1104,23936,-6336,23936,-8336,
--    23936,-10288,25360,-11480,26784,-12672,29168,-12672,30320,-12672,31552,-12392,32784,-12112,34064,-11568,34016,-16960,32480,-17344,
--    31056,-17536,29632,-17728,28272,-17728,23472,-17728,20840,-15840,18208,-13952,18208,-10496,18208,-8416,19480,-6184,20752,-3952,
--    23696,-1024,26176,2976,32464,2976,35672,7952,38880,12928,38880,22608,38880,32304,35672,37256,32464,42208,26176,42208,
--    19888,42208,16680,37256,13472,32304,13472,22608,13472,12928,16704,7952,19936,2976,26176,2976,26176,-1232,16320,-1232,
--    10328,5288,4336,11808,4336,22608,4336,33408,10304,39912,16272,46416,26176,46416,36080,46416,42056,39912,48032,33408,
--    48032,22608,48032,11808,42056,5288,36080,-1232,26176,-1232,23392,78160,48800,78160,48800,71872,23392,71872,23392,78160,
--    33936,-1024,37920,-1024,37888,-1104,34176,-6336,34176,-8336,34176,-10288,35600,-11480,37024,-12672,39408,-12672,40560,-12672,
--    41792,-12392,43024,-12112,44304,-11568,44256,-16960,42720,-17344,41296,-17536,39872,-17728,38512,-17728,33712,-17728,31080,-15840,
--    28448,-13952,28448,-10496,28448,-8416,29720,-6184,30992,-3952,33936,-1024,35696,3312,46112,3312,51424,10472,56736,17632,
--    56736,31664,56736,45728,51424,52888,46112,60048,35696,60048,25248,60048,19936,52888,14624,45728,14624,31664,14624,17632,
--    19936,10472,25248,3312,35696,3312,35696,-1232,29248,-1232,23824,896,18400,3024,14288,7136,9520,11904,7200,17936,
--    4880,23968,4880,31664,4880,39360,7200,45416,9520,51472,14288,56224,18448,60400,23800,62504,29152,64608,35696,64608,
--    49520,64608,58016,55552,66512,46496,66512,31664,66512,24048,64176,17952,61840,11856,57072,7136,52912,2976,47560,872,
--    42208,-1232,35696,-1232,13152,64848,38560,64848,38560,58560,13152,58560,13152,64848,23696,-1024,27680,-1024,27648,-1104,
--    23936,-6336,23936,-8336,23936,-10288,25360,-11480,26784,-12672,29168,-12672,30320,-12672,31552,-12392,32784,-12112,34064,-11568,
--    34016,-16960,32480,-17344,31056,-17536,29632,-17728,28272,-17728,23472,-17728,20840,-15840,18208,-13952,18208,-10496,18208,-8416,
--    19480,-6184,20752,-3952,23696,-1024,26176,2976,32464,2976,35672,7952,38880,12928,38880,22608,38880,32304,35672,37256,
--    32464,42208,26176,42208,19888,42208,16680,37256,13472,32304,13472,22608,13472,12928,16704,7952,19936,2976,26176,2976,
--    26176,-1232,16320,-1232,10328,5288,4336,11808,4336,22608,4336,33408,10304,39912,16272,46416,26176,46416,36080,46416,
--    42056,39912,48032,33408,48032,22608,48032,11808,42056,5288,36080,-1232,26176,-1232,21600,68992,11792,80208,16720,80208,
--    25344,73328,33968,80208,38896,80208,29088,68992,21600,68992,22448,36208,18400,36208,18400,40544,33024,58224,10624,58224,
--    10624,48752,5392,48752,5392,63456,42496,63456,42496,58144,26816,39232,30176,38928,38000,37696,42336,32560,46624,27456,
--    46624,19296,46624,9344,40624,4032,34688,-1232,23456,-1232,18480,-1232,13776,-48,9008,1152,4336,3568,4336,17344,
--    9088,17344,9520,10496,13216,6968,16912,3440,23632,3440,30128,3440,33920,7696,37648,11904,37648,19216,37648,27584,
--    33792,31920,29920,36208,22448,36208,19216,53632,9232,69616,14160,69616,22784,58560,31408,69616,36336,69616,26352,53632,
--    19216,53632,22448,17984,18400,17984,18400,22320,32432,40624,10032,40624,10032,32816,5520,32816,5520,45184,42496,45184,
--    42496,41520,26816,20992,30176,20704,38000,19472,42336,14320,46624,9216,46624,1056,46624,-8880,40624,-14192,34688,-19472,
--    23456,-19472,18480,-19472,13776,-18272,9008,-17088,4336,-14656,4336,-896,9088,-896,9520,-7728,13216,-11256,16912,-14784,
--    23632,-14784,30128,-14784,33920,-10544,37648,-6336,37648,976,37648,9344,33792,13680,29920,17984,22448,17984,10624,40624,
--    3232,40624,3232,45184,18448,45184,18448,-4416,18448,-11392,14304,-15368,10160,-19344,2896,-19344,-176,-19344,-2960,-18640,
--    -5744,-17936,-8368,-16528,-8368,-7232,-4336,-7232,-4032,-11312,-2232,-13224,-432,-15136,3056,-15136,6928,-15136,8776,-12520,
--    10624,-9904,10624,-4416,10624,40624,10000,53632,16,69616,4944,69616,13568,58560,22192,69616,27120,69616,17136,53632,
--    10000,53632,73536,0,73536,3056,113072,58224,80256,58224,80256,48752,75024,48752,75024,63456,125184,63456,125184,60400,
--    85648,5232,121520,5232,121520,14112,126704,14112,126704,0,73536,0,21504,4512,29408,4512,41776,4512,48384,11560,
--    54992,18608,54992,31792,54992,44960,48408,51936,41824,58912,29408,58912,21504,58912,21504,4512,4800,0,4800,4512,
--    12880,4512,12880,58912,4800,58912,4800,63456,30048,63456,46448,63456,55608,55080,64768,46704,64768,31792,64768,16832,
--    55592,8416,46416,0,30048,0,4800,0,73120,0,73120,3648,101424,40624,79024,40624,79024,32816,74512,32816,
--    74512,45184,111488,45184,111488,41520,83184,4512,107760,4512,107760,12704,112304,12704,112304,0,73120,0,21504,4512,
--    29408,4512,41776,4512,48384,11560,54992,18608,54992,31792,54992,44960,48408,51936,41824,58912,29408,58912,21504,58912,
--    21504,4512,4800,0,4800,4512,12880,4512,12880,58912,4800,58912,4800,63456,30048,63456,46448,63456,55608,55080,
--    64768,46704,64768,31792,64768,16832,55592,8416,46416,0,30048,0,4800,0,58784,0,58784,3648,87088,40624,
--    64688,40624,64688,32816,60176,32816,60176,45184,97152,45184,97152,41520,68848,4512,93424,4512,93424,12704,97968,12704,
--    97968,0,58784,0,45680,4512,53168,4512,53168,0,37872,0,37872,7056,35568,2800,32024,784,28480,-1232,
--    23248,-1232,14912,-1232,9624,5376,4336,11984,4336,22608,4336,33232,9608,39824,14880,46416,23248,46416,28480,46416,
--    32024,44392,35568,42368,37872,38128,37872,61632,30480,61632,30480,66128,45680,66128,45680,4512,37872,20352,37872,24816,
--    37872,32944,34744,37232,31616,41520,25664,41520,19632,41520,16552,36760,13472,32000,13472,22608,13472,13264,16552,8456,
--    19632,3648,25664,3648,31616,3648,34744,7920,37872,12192,37872,20352 };
-+    53936,62096,60480,59536,60480,44496,55712,44496,37872,26096,37872,33200,34744,36960,31616,40720,25664,40720,19632,40720,
-+    16552,36552,13472,32384,13472,24176,13472,16016,16552,11808,19632,7600,25664,7600,31616,7600,34744,11344,37872,15088,
-+    37872,22224,37872,26096,37872,10208,35568,6368,32024,4544,28480,2720,23248,2720,14912,2720,9624,8688,4336,14656,
-+    4336,24176,4336,33744,9608,40080,14880,46416,23248,46416,28480,46416,32024,44184,35568,41952,37872,38128,37872,45184,
-+    53168,45184,53168,40624,45680,40624,45680,976,45680,-592,45568,-2080,53168,-2080,53168,-6624,44672,-6624,43344,-11056,
-+    40336,-14032,34976,-19296,25072,-19344,20608,-19344,16528,-18536,12448,-17728,8720,-16112,8720,-6624,-800,-6624,-800,-2080,
-+    37744,-2080,37872,-640,37872,976,37872,10208,12800,-6624,13552,-11056,16400,-13096,19248,-15136,24560,-15136,31456,-15136,
-+    34688,-11216,36160,-9392,36976,-6624,12800,-6624,32864,68992,23056,80208,27984,80208,36608,73328,45232,80208,50160,80208,
-+    40352,68992,32864,68992,55712,44496,54224,52448,49512,56248,44800,60048,36384,60048,25408,60048,20016,52992,14624,45936,
-+    14624,31664,14624,17680,20192,10496,25760,3312,36544,3312,41360,3312,45736,4504,50112,5696,54064,8080,54064,24432,
-+    42112,24432,42112,28992,62688,28992,62688,5312,57040,2048,50512,408,43984,-1232,36544,-1232,22192,-1232,13536,7760,
-+    4880,16752,4880,31664,4880,46704,13552,55656,22224,64608,36896,64608,42336,64608,48136,63352,53936,62096,60480,59536,
-+    60480,44496,55712,44496,22288,53632,12304,69616,17232,69616,25856,58560,34480,69616,39408,69616,29424,53632,22288,53632,
-+    45680,40624,45680,976,45680,-8752,40328,-14048,34976,-19344,25072,-19344,20608,-19344,16528,-18536,12448,-17728,8720,-16112,
-+    8720,-6624,12800,-6624,13552,-11056,16400,-13096,19248,-15136,24560,-15136,31456,-15136,34664,-11248,37872,-7360,37872,976,
-+    37872,7056,35568,2800,32024,784,28480,-1232,23248,-1232,14912,-1232,9624,5376,4336,11984,4336,22608,4336,33232,
-+    9608,39824,14880,46416,23248,46416,28480,46416,32024,44392,35568,42368,37872,38128,37872,45184,53168,45184,53168,40624,
-+    45680,40624,37872,24816,37872,32944,34744,37232,31616,41520,25664,41520,19632,41520,16552,36760,13472,32000,13472,22608,
-+    13472,13264,16552,8456,19632,3648,25664,3648,31616,3648,34744,7920,37872,12192,37872,20352,37872,24816,31840,68992,
-+    22032,80208,26960,80208,35584,73328,44208,80208,49136,80208,39328,68992,31840,68992,4800,0,4800,4512,12880,4512,
-+    12880,58912,4800,58912,4800,63456,29584,63456,29584,58912,21504,58912,21504,34896,48832,58912,41952,58912,41952,63456,
-+    63024,63456,63024,58912,55888,58912,28640,34976,59120,4512,66336,4512,66336,0,51600,0,21504,30128,21504,4512,
-+    29584,4512,29584,0,4800,0,10336,72064,528,83280,5456,83280,14080,76400,22704,83280,27632,83280,17824,72064,
-+    10336,72064,24912,0,2976,0,2976,4512,10032,4512,10032,61632,2512,61632,2512,66128,17856,66128,17856,23072,
-+    36896,40624,30384,40624,30384,45184,50832,45184,50832,40624,43088,40624,29664,28224,46832,4512,53344,4512,53344,0,
-+    31072,0,31072,4512,37520,4512,24016,23072,17856,17344,17856,4512,24912,4512,24912,0,33936,-1024,37920,-1024,
-+    37888,-1104,34176,-6336,34176,-8336,34176,-10288,35600,-11480,37024,-12672,39408,-12672,40560,-12672,41792,-12392,43024,-12112,
-+    44304,-11568,44256,-16960,42720,-17344,41296,-17536,39872,-17728,38512,-17728,33712,-17728,31080,-15840,28448,-13952,28448,-10496,
-+    28448,-8416,29720,-6184,30992,-3952,33936,-1024,35696,3312,46112,3312,51424,10472,56736,17632,56736,31664,56736,45728,
-+    51424,52888,46112,60048,35696,60048,25248,60048,19936,52888,14624,45728,14624,31664,14624,17632,19936,10472,25248,3312,
-+    35696,3312,35696,-1232,29248,-1232,23824,896,18400,3024,14288,7136,9520,11904,7200,17936,4880,23968,4880,31664,
-+    4880,39360,7200,45416,9520,51472,14288,56224,18448,60400,23800,62504,29152,64608,35696,64608,49520,64608,58016,55552,
-+    66512,46496,66512,31664,66512,24048,64176,17952,61840,11856,57072,7136,52912,2976,47560,872,42208,-1232,35696,-1232,
-+    23696,-1024,27680,-1024,27648,-1104,23936,-6336,23936,-8336,23936,-10288,25360,-11480,26784,-12672,29168,-12672,30320,-12672,
-+    31552,-12392,32784,-12112,34064,-11568,34016,-16960,32480,-17344,31056,-17536,29632,-17728,28272,-17728,23472,-17728,20840,-15840,
-+    18208,-13952,18208,-10496,18208,-8416,19480,-6184,20752,-3952,23696,-1024,26176,2976,32464,2976,35672,7952,38880,12928,
-+    38880,22608,38880,32304,35672,37256,32464,42208,26176,42208,19888,42208,16680,37256,13472,32304,13472,22608,13472,12928,
-+    16704,7952,19936,2976,26176,2976,26176,-1232,16320,-1232,10328,5288,4336,11808,4336,22608,4336,33408,10304,39912,
-+    16272,46416,26176,46416,36080,46416,42056,39912,48032,33408,48032,22608,48032,11808,42056,5288,36080,-1232,26176,-1232,
-+    23392,78160,48800,78160,48800,71872,23392,71872,23392,78160,33936,-1024,37920,-1024,37888,-1104,34176,-6336,34176,-8336,
-+    34176,-10288,35600,-11480,37024,-12672,39408,-12672,40560,-12672,41792,-12392,43024,-12112,44304,-11568,44256,-16960,42720,-17344,
-+    41296,-17536,39872,-17728,38512,-17728,33712,-17728,31080,-15840,28448,-13952,28448,-10496,28448,-8416,29720,-6184,30992,-3952,
-+    33936,-1024,35696,3312,46112,3312,51424,10472,56736,17632,56736,31664,56736,45728,51424,52888,46112,60048,35696,60048,
-+    25248,60048,19936,52888,14624,45728,14624,31664,14624,17632,19936,10472,25248,3312,35696,3312,35696,-1232,29248,-1232,
-+    23824,896,18400,3024,14288,7136,9520,11904,7200,17936,4880,23968,4880,31664,4880,39360,7200,45416,9520,51472,
-+    14288,56224,18448,60400,23800,62504,29152,64608,35696,64608,49520,64608,58016,55552,66512,46496,66512,31664,66512,24048,
-+    64176,17952,61840,11856,57072,7136,52912,2976,47560,872,42208,-1232,35696,-1232,13152,64848,38560,64848,38560,58560,
-+    13152,58560,13152,64848,23696,-1024,27680,-1024,27648,-1104,23936,-6336,23936,-8336,23936,-10288,25360,-11480,26784,-12672,
-+    29168,-12672,30320,-12672,31552,-12392,32784,-12112,34064,-11568,34016,-16960,32480,-17344,31056,-17536,29632,-17728,28272,-17728,
-+    23472,-17728,20840,-15840,18208,-13952,18208,-10496,18208,-8416,19480,-6184,20752,-3952,23696,-1024,26176,2976,32464,2976,
-+    35672,7952,38880,12928,38880,22608,38880,32304,35672,37256,32464,42208,26176,42208,19888,42208,16680,37256,13472,32304,
-+    13472,22608,13472,12928,16704,7952,19936,2976,26176,2976,26176,-1232,16320,-1232,10328,5288,4336,11808,4336,22608,
-+    4336,33408,10304,39912,16272,46416,26176,46416,36080,46416,42056,39912,48032,33408,48032,22608,48032,11808,42056,5288,
-+    36080,-1232,26176,-1232,21600,68992,11792,80208,16720,80208,25344,73328,33968,80208,38896,80208,29088,68992,21600,68992,
-+    22448,36208,18400,36208,18400,40544,33024,58224,10624,58224,10624,48752,5392,48752,5392,63456,42496,63456,42496,58144,
-+    26816,39232,30176,38928,38000,37696,42336,32560,46624,27456,46624,19296,46624,9344,40624,4032,34688,-1232,23456,-1232,
-+    18480,-1232,13776,-48,9008,1152,4336,3568,4336,17344,9088,17344,9520,10496,13216,6968,16912,3440,23632,3440,
-+    30128,3440,33920,7696,37648,11904,37648,19216,37648,27584,33792,31920,29920,36208,22448,36208,19216,53632,9232,69616,
-+    14160,69616,22784,58560,31408,69616,36336,69616,26352,53632,19216,53632,22448,17984,18400,17984,18400,22320,32432,40624,
-+    10032,40624,10032,32816,5520,32816,5520,45184,42496,45184,42496,41520,26816,20992,30176,20704,38000,19472,42336,14320,
-+    46624,9216,46624,1056,46624,-8880,40624,-14192,34688,-19472,23456,-19472,18480,-19472,13776,-18272,9008,-17088,4336,-14656,
-+    4336,-896,9088,-896,9520,-7728,13216,-11256,16912,-14784,23632,-14784,30128,-14784,33920,-10544,37648,-6336,37648,976,
-+    37648,9344,33792,13680,29920,17984,22448,17984,10624,40624,3232,40624,3232,45184,18448,45184,18448,-4416,18448,-11392,
-+    14304,-15368,10160,-19344,2896,-19344,-176,-19344,-2960,-18640,-5744,-17936,-8368,-16528,-8368,-7232,-4336,-7232,-4032,-11312,
-+    -2232,-13224,-432,-15136,3056,-15136,6928,-15136,8776,-12520,10624,-9904,10624,-4416,10624,40624,10000,53632,16,69616,
-+    4944,69616,13568,58560,22192,69616,27120,69616,17136,53632,10000,53632,73536,0,73536,3056,113072,58224,80256,58224,
-+    80256,48752,75024,48752,75024,63456,125184,63456,125184,60400,85648,5232,121520,5232,121520,14112,126704,14112,126704,0,
-+    73536,0,21504,4512,29408,4512,41776,4512,48384,11560,54992,18608,54992,31792,54992,44960,48408,51936,41824,58912,
-+    29408,58912,21504,58912,21504,4512,4800,0,4800,4512,12880,4512,12880,58912,4800,58912,4800,63456,30048,63456,
-+    46448,63456,55608,55080,64768,46704,64768,31792,64768,16832,55592,8416,46416,0,30048,0,4800,0,73120,0,
-+    73120,3648,101424,40624,79024,40624,79024,32816,74512,32816,74512,45184,111488,45184,111488,41520,83184,4512,107760,4512,
-+    107760,12704,112304,12704,112304,0,73120,0,21504,4512,29408,4512,41776,4512,48384,11560,54992,18608,54992,31792,
-+    54992,44960,48408,51936,41824,58912,29408,58912,21504,58912,21504,4512,4800,0,4800,4512,12880,4512,12880,58912,
-+    4800,58912,4800,63456,30048,63456,46448,63456,55608,55080,64768,46704,64768,31792,64768,16832,55592,8416,46416,0,
-+    30048,0,4800,0,58784,0,58784,3648,87088,40624,64688,40624,64688,32816,60176,32816,60176,45184,97152,45184,
-+    97152,41520,68848,4512,93424,4512,93424,12704,97968,12704,97968,0,58784,0,45680,4512,53168,4512,53168,0,
-+    37872,0,37872,7056,35568,2800,32024,784,28480,-1232,23248,-1232,14912,-1232,9624,5376,4336,11984,4336,22608,
-+    4336,33232,9608,39824,14880,46416,23248,46416,28480,46416,32024,44392,35568,42368,37872,38128,37872,61632,30480,61632,
-+    30480,66128,45680,66128,45680,4512,37872,20352,37872,24816,37872,32944,34744,37232,31616,41520,25664,41520,19632,41520,
-+    16552,36760,13472,32000,13472,22608,13472,13264,16552,8456,19632,3648,25664,3648,31616,3648,34744,7920,37872,12192,
-+    37872,20352 };
- static const int DejaVuSerif_glyphAdvances[468] = {
-     27664,34976,40032,72928,55376,82704,77472,23920,33952,33952,43520,72928,27664,29408,27664,29328,55376,55376,55376,55376,
-     55376,55376,55376,55376,55376,55376,29328,29328,72928,72928,72928,46672,87040,62864,63968,66592,69792,63536,60400,69536,
-@@ -2663,7 +2665,7 @@ static const int DejaVuSerif_glyphAdvanc
-     71360,52400,49136,49136,27840,130256,115648,101568 };
- 
- static const int DejaVuSerif_descender_height = -21424;
--static const int DejaVuSerif_font_height = 91776;
-+static const int DejaVuSerif_font_height = 90448;
- static const int DejaVuSerif_glyphCount = 468;
- static const short DejaVuSerif_characterMap[500] = {
-     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,

+ 0 - 55
package/ajstarks-openvg/patches/patch-Makefile

@@ -1,55 +0,0 @@
---- ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d.orig/Makefile	2017-07-26 14:27:15.000000000 +0200
-+++ ajstarks-openvg-a236978e8009c948083bd15b201d8f4ceb3c035d/Makefile	2017-07-26 17:07:46.000000000 +0200
-@@ -1,38 +1,38 @@
--INCLUDEFLAGS=-I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -fPIC
--LIBFLAGS=-L/opt/vc/lib -lEGL -lGLESv2 -ljpeg
--FONTLIB=/usr/share/fonts/truetype/ttf-dejavu
-+INCLUDEFLAGS=-I=/opt/vc/include -I=/opt/vc/include/interface/vmcs_host/linux -I=/opt/vc/include/interface/vcos/pthreads -fPIC
-+LIBFLAGS=-L=/opt/vc/lib -lEGL -lGLESv2 -ljpeg
- FONTFILES=DejaVuSans.inc  DejaVuSansMono.inc DejaVuSerif.inc
-+
- all:	font2openvg fonts library	
- 
--libshapes.o:	libshapes.c shapes.h fontinfo.h fonts
--	gcc -O2 -Wall $(INCLUDEFLAGS) -c libshapes.c
-+libshapes.o:	libshapes.c shapes.h fontinfo.h
-+	$(CC) -O2 -Wall $(INCLUDEFLAGS) -c libshapes.c
- 
- gopenvg:	openvg.go
- 	go install .
- 
- oglinit.o:	oglinit.c
--	gcc -O2 -Wall $(INCLUDEFLAGS) -c oglinit.c
-+	$(CC) -O2 -Wall $(INCLUDEFLAGS) -c oglinit.c
- 
- font2openvg:	fontutil/font2openvg.cpp
--	g++ -I/usr/include/freetype2 fontutil/font2openvg.cpp -o font2openvg -lfreetype
-+	$(CXX) -I=/usr/include/freetype2 fontutil/font2openvg.cpp -o font2openvg -lfreetype
- 
- fonts:	$(FONTFILES)
- 
--DejaVuSans.inc: font2openvg $(FONTLIB)/DejaVuSans.ttf
--	./font2openvg $(FONTLIB)/DejaVuSans.ttf DejaVuSans.inc DejaVuSans
-+DejaVuSans.inc: font2openvg DejaVuSans.ttf
-+	./font2openvg DejaVuSans.ttf DejaVuSans.inc DejaVuSans
- 
--DejaVuSerif.inc: font2openvg $(FONTLIB)/DejaVuSerif.ttf
--	./font2openvg $(FONTLIB)/DejaVuSerif.ttf DejaVuSerif.inc DejaVuSerif
-+DejaVuSerif.inc: font2openvg DejaVuSerif.ttf
-+	./font2openvg DejaVuSerif.ttf DejaVuSerif.inc DejaVuSerif
- 
--DejaVuSansMono.inc: font2openvg $(FONTLIB)/DejaVuSansMono.ttf
--	./font2openvg $(FONTLIB)/DejaVuSansMono.ttf DejaVuSansMono.inc DejaVuSansMono
-+DejaVuSansMono.inc: font2openvg DejaVuSansMono.ttf
-+	./font2openvg DejaVuSansMono.ttf DejaVuSansMono.inc DejaVuSansMono
- 
- clean:
- 	rm -f *.o *.inc *.so font2openvg *.c~ *.h~
- 	indent -linux -c 60 -brf -l 132  libshapes.c oglinit.c shapes.h fontinfo.h
- 
- library: oglinit.o libshapes.o
--	gcc $(LIBFLAGS) -shared -o libshapes.so oglinit.o libshapes.o
-+	$(CC) -v $(LIBFLAGS) -shared -o libshapes.so oglinit.o libshapes.o
- 
- install:
- 	install -m 755 -p font2openvg /usr/bin/

+ 4 - 4
package/apr-util/Makefile

@@ -4,18 +4,18 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		apr-util
 PKG_NAME:=		apr-util
-PKG_VERSION:=		1.6.1
+PKG_VERSION:=		1.5.4
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b
+PKG_HASH:=		976a12a59bc286d634a21d7be0841cc74289ea9077aa1af46be19d1a6e844c19
 PKG_DESCR:=		apache portable runtime utility library
 PKG_DESCR:=		apache portable runtime utility library
 PKG_SECTION:=		libs/misc
 PKG_SECTION:=		libs/misc
 PKG_DEPENDS:=		libexpat apr
 PKG_DEPENDS:=		libexpat apr
 PKG_BUILDDEP:=		expat apr
 PKG_BUILDDEP:=		expat apr
 PKG_URL:=		http://apr.apache.org/
 PKG_URL:=		http://apr.apache.org/
-PKG_SITES:=		http://www.apache.org/dist/apr/
+PKG_SITES:=		http://mirrors.ibiblio.org/apache//apr/
 PKG_OPTS:=		dev
 PKG_OPTS:=		dev
 
 
-DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.bz2
+DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.gz
 
 
 include ${ADK_TOPDIR}/mk/package.mk
 include ${ADK_TOPDIR}/mk/package.mk
 
 

+ 4 - 4
package/apr/Makefile

@@ -4,17 +4,17 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		apr
 PKG_NAME:=		apr
-PKG_VERSION:=		1.6.3
+PKG_VERSION:=		1.5.2
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172
+PKG_HASH:=		1af06e1720a58851d90694a984af18355b65bb0d047be03ec7d659c746d6dbdb
 PKG_DESCR:=		apache portable runtime library
 PKG_DESCR:=		apache portable runtime library
 PKG_SECTION:=		libs/misc
 PKG_SECTION:=		libs/misc
 PKG_NEEDS:=		threads
 PKG_NEEDS:=		threads
 PKG_URL:=		http://apr.apache.org/
 PKG_URL:=		http://apr.apache.org/
-PKG_SITES:=		http://www.apache.org/dist/apr/
+PKG_SITES:=		http://mirrors.ibiblio.org/apache//apr/
 PKG_OPTS:=		dev
 PKG_OPTS:=		dev
 
 
-DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.bz2
+DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.gz
 
 
 PKG_FLAVOURS_APR:=	WITH_IPV6
 PKG_FLAVOURS_APR:=	WITH_IPV6
 PKGFD_WITH_IPV6:=	enable IPv6 support
 PKGFD_WITH_IPV6:=	enable IPv6 support

+ 4 - 12
package/barebox/Makefile

@@ -4,9 +4,9 @@
 include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/rules.mk
 
 
 PKG_NAME:=		barebox
 PKG_NAME:=		barebox
-PKG_VERSION:=		2017.11.0
+PKG_VERSION:=		2017.02.0
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		7dff97dd94807fd7c0012fd9ddb8bc799a220e2b65e46dcc56724105a56feecc
+PKG_HASH:=		d65d864fe598d61ed9c6712e32d50742e6996aae02acaae5955c3b22166344cb
 PKG_DESCR:=		portable bootloader
 PKG_DESCR:=		portable bootloader
 PKG_SECTION:=		base/boot
 PKG_SECTION:=		base/boot
 PKG_BUILDDEP:=		lzop-host
 PKG_BUILDDEP:=		lzop-host
@@ -24,14 +24,6 @@ CONFIG_STYLE:=		manual
 BUILD_STYLE:=		manual
 BUILD_STYLE:=		manual
 INSTALL_STYLE:=		manual
 INSTALL_STYLE:=		manual
 
 
-BAREBOX_ARCH:=		$(ADK_TARGET_ARCH)
-ifeq ($(ADK_TARGET_ARCH_X86),y)
-CONFIG:=		efi_defconfig
-endif
-ifeq ($(ADK_TARGET_ARCH_X86_64),y)
-CONFIG:=		efi_defconfig
-BAREBOX_ARCH:=		x86
-endif
 ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS),y)
 ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS),y)
 CONFIG:=		qemu-malta_defconfig
 CONFIG:=		qemu-malta_defconfig
 endif
 endif
@@ -40,12 +32,12 @@ CONFIG:=		vexpress_ca9_defconfig
 endif
 endif
 
 
 do-configure:
 do-configure:
-	(cd $(WRKBUILD) && $(MAKE) ARCH=$(BAREBOX_ARCH) $(CONFIG))
+	(cd $(WRKBUILD) && $(MAKE) ARCH='$(ADK_TARGET_ARCH)' $(CONFIG))
 
 
 do-build:
 do-build:
 	(cd $(WRKBUILD) && env \
 	(cd $(WRKBUILD) && env \
 		PATH='$(HOST_PATH)' \
 		PATH='$(HOST_PATH)' \
-		ARCH=$(BAREBOX_ARCH) \
+		ARCH='$(ADK_TARGET_ARCH)' \
 		CROSS_COMPILE='$(TARGET_CROSS)' \
 		CROSS_COMPILE='$(TARGET_CROSS)' \
 		$(MAKE))
 		$(MAKE))
 
 

+ 2 - 2
package/curl/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		curl
 PKG_NAME:=		curl
-PKG_VERSION:=		7.56.1
+PKG_VERSION:=		7.56.0
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		8eed282cf3a0158d567a0feaa3c4619e8e847970597b5a2c81879e8f0d1a39d1
+PKG_HASH:=		32437bcca0e9434384329fdc733547879d25ba70335b3cf9e3d9cbc3e71fd172
 PKG_DESCR:=		client-side url transfer tool
 PKG_DESCR:=		client-side url transfer tool
 PKG_SECTION:=		net/http
 PKG_SECTION:=		net/http
 PKG_DEPENDS:=		libcurl
 PKG_DEPENDS:=		libcurl

+ 0 - 33
package/dhcpcd/Makefile

@@ -1,33 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-include $(ADK_TOPDIR)/rules.mk
-
-PKG_NAME:=		dhcpcd
-PKG_VERSION:=		6.11.5
-PKG_RELEASE:=		1
-PKG_HASH:=		6f9674dc7e27e936cc787175404a6171618675ecfb6903ab9887b1b66a87d69e
-PKG_DESCR:=		dhcp client
-PKG_SECTION:=		net/dns
-PKG_URL:=		https://roy.marples.name/projects/dhcpcd
-PKG_SITES:=		https://roy.marples.name/downloads/dhcpcd/
-
-include $(ADK_TOPDIR)/mk/package.mk
-
-$(eval $(call PKG_template,DHCPCD,dhcpcd,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
-
-dhcpcd-install:
-	$(INSTALL_DIR) $(IDIR_DHCPCD)/etc
-	$(CP) $(WRKINST)/etc/dhcpcd.conf \
-		$(IDIR_DHCPCD)/etc
-	$(INSTALL_DIR) $(IDIR_DHCPCD)/usr/share/dhcpcd
-	$(CP) $(WRKINST)/usr/share/dhcpcd/* \
-		$(IDIR_DHCPCD)/usr/share/dhcpcd
-	$(INSTALL_DIR) $(IDIR_DHCPCD)/usr/libexec
-	$(CP) $(WRKINST)/usr/libexec/* \
-		$(IDIR_DHCPCD)/usr/libexec
-	$(INSTALL_DIR) $(IDIR_DHCPCD)/usr/bin
-	$(INSTALL_BIN) $(WRKINST)/usr/bin/dhcpcd \
-		$(IDIR_DHCPCD)/usr/bin
-
-include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 2 - 2
package/ffmpeg/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		ffmpeg
 PKG_NAME:=		ffmpeg
-PKG_VERSION:=		3.3.5
+PKG_VERSION:=		3.3.2
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		1b434cff8a327e54fd0f611420996e3419c58b795d51a5b588ace2a674f1060a
+PKG_HASH:=		216900d5c0af9017bb8f76b0ad23f0ac53cf7fc618cf04b40d989bd99b088e6a
 PKG_DESCR:=		record, convert and stream audio & video
 PKG_DESCR:=		record, convert and stream audio & video
 PKG_SECTION:=		libs/video
 PKG_SECTION:=		libs/video
 PKG_NEEDS:=		threads
 PKG_NEEDS:=		threads

+ 5 - 12
package/gcc/Makefile

@@ -28,17 +28,8 @@ CFLAGS_FOR_BUILD:=
 LDFLAGS_FOR_BUILD:=
 LDFLAGS_FOR_BUILD:=
 TARGET_CPPFLAGS:=
 TARGET_CPPFLAGS:=
 TARGET_CFLAGS:=
 TARGET_CFLAGS:=
-TARGET_CXXFLAGS:=
 TARGET_LDFLAGS:=
 TARGET_LDFLAGS:=
-
-ifeq ($(ADK_TARGET_LINUX_ARCH_XTENSA),y)
-GCC_EXTRA_CFLAGS:=	-mtext-section-literals
-GCC_EXTRA_CXXFLAGS:=	-mtext-section-literals
-endif
-
-# some targets need extra CFLAGS/CXXFLAGS
-CONFIGURE_ENV+=		CC="${TARGET_CC} ${GCC_EXTRA_CFLAGS}"
-CONFIGURE_ENV+=		CXX="${TARGET_CXX} ${GCC_EXTRA_CXXFLAGS}"
+TARGET_CXXFLAGS:=
 
 
 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
 CONFIGURE_ARGS+=       --with-abi=$(ADK_TARGET_MIPS_ABI)
 CONFIGURE_ARGS+=       --with-abi=$(ADK_TARGET_MIPS_ABI)
@@ -55,8 +46,9 @@ CONFIGURE_ARGS+=	--enable-languages=c,c++
 else
 else
 CONFIGURE_ARGS+=	--enable-languages=c
 CONFIGURE_ARGS+=	--enable-languages=c
 endif
 endif
-ifeq ($(ADK_TARGET_LINUX_ARCH_PPC),y)
+ifeq ($(ADK_TARGET_CPU_ARCH),ppc)
 CONFIGURE_ARGS+=	--disable-target-optspace --with-long-double-64 --enable-secureplt
 CONFIGURE_ARGS+=	--disable-target-optspace --with-long-double-64 --enable-secureplt
+TARGET_CFLAGS+=		'-Wl,--secure-plt'
 else
 else
 CONFIGURE_ARGS+=	--enable-target-optspace
 CONFIGURE_ARGS+=	--enable-target-optspace
 endif
 endif
@@ -79,7 +71,8 @@ CONFIGURE_ARGS+=	--host=$(GNU_TARGET_NAME) \
 			--disable-libsanitizer \
 			--disable-libsanitizer \
 			--disable-libitm \
 			--disable-libitm \
 			--disable-install-libiberty \
 			--disable-install-libiberty \
-			--enable-dependency-tracking
+			--enable-dependency-tracking \
+			--enable-cxx-flags="${TARGET_LDFLAGS}"
 
 
 pre-configure:
 pre-configure:
 	$(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
 	$(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in

+ 2 - 4
package/gdb/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		gdb
 PKG_NAME:=		gdb
-PKG_VERSION:=		8.0.1
+PKG_VERSION:=		8.0
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3
+PKG_HASH:=		f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee
 PKG_DESCR:=		programm debugger
 PKG_DESCR:=		programm debugger
 PKG_SECTION:=		app/debug
 PKG_SECTION:=		app/debug
 PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
 PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
@@ -20,8 +20,6 @@ include ${ADK_TOPDIR}/mk/package.mk
 
 
 $(eval $(call PKG_template,GDB,gdb,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 $(eval $(call PKG_template,GDB,gdb,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 
 
-XAKE_FLAGS+=		MAKEINFO=true
-
 # --enable-static is required to build libbfd.a
 # --enable-static is required to build libbfd.a
 CONFIGURE_ARGS+=	--enable-static \
 CONFIGURE_ARGS+=	--enable-static \
 			--without-uiout \
 			--without-uiout \

+ 2 - 2
package/gdbserver/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		gdbserver
 PKG_NAME:=		gdbserver
-PKG_VERSION:=		8.0.1
+PKG_VERSION:=		8.0
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3
+PKG_HASH:=		f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee
 PKG_DESCR:=		remote programm debugger utility
 PKG_DESCR:=		remote programm debugger utility
 PKG_SECTION:=		app/debug
 PKG_SECTION:=		app/debug
 PKG_NEEDS:=		c++
 PKG_NEEDS:=		c++

+ 2 - 2
package/jupp/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		jupp
 PKG_NAME:=		jupp
-PKG_VERSION:=		31
+PKG_VERSION:=		28
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		1a50607b0417cf230f7b3609c091e71e8d8e91185a4a3897f7925cd3b44cceba
+PKG_HASH:=		be4d16cb44f002a3f6f5069471096c53d9c184b7366ef1a055422d2f0006851f
 PKG_DESCR:=		wordstar-inspired text editor
 PKG_DESCR:=		wordstar-inspired text editor
 PKG_SECTION:=		app/editor
 PKG_SECTION:=		app/editor
 PKG_URL:=		https://www.mirbsd.org/jupp.htm
 PKG_URL:=		https://www.mirbsd.org/jupp.htm

+ 3 - 3
package/kodi/Makefile

@@ -6,11 +6,11 @@ include $(ADK_TOPDIR)/rules.mk
 PKG_NAME:=		kodi
 PKG_NAME:=		kodi
 PKG_VERSION:=		17.3
 PKG_VERSION:=		17.3
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		ca97d044dc544568f34f067688b783d29f180b5e504814d5d947143b2f7e6d7b
+PKG_HASH:=		1de8653a3729cefd1baaf09ecde5ace01a1e3a58fbf29d48c1363f2503d331a1
 PKG_DESCR:=		software media player
 PKG_DESCR:=		software media player
 PKG_SECTION:=		mm/video
 PKG_SECTION:=		mm/video
 PKG_DEPENDS:=		python2 libsquish libressl libxz
 PKG_DEPENDS:=		python2 libsquish libressl libxz
-PKG_DEPENDS+=		libass libmpeg2 libmad libiconv
+PKG_DEPENDS+=		libass libmpeg2 libmad
 PKG_DEPENDS+=		libogg libvorbis libmodplug libcurl
 PKG_DEPENDS+=		libogg libvorbis libmodplug libcurl
 PKG_DEPENDS+=		libflac libbz2 libtiff libnettle librtmp liblzo
 PKG_DEPENDS+=		libflac libbz2 libtiff libnettle librtmp liblzo
 PKG_DEPENDS+=		yajl tinyxml libsqlite libpcrecpp libncurses
 PKG_DEPENDS+=		yajl tinyxml libsqlite libpcrecpp libncurses
@@ -28,7 +28,7 @@ PKG_BUILDDEP+=		libgpg-error libvorbis
 PKG_BUILDDEP+=		swig-host liblzo-host libpng-host libjpeg-turbo-host
 PKG_BUILDDEP+=		swig-host liblzo-host libpng-host libjpeg-turbo-host
 PKG_BUILDDEP+=		zip-host unzip-host giflib-host libsquish libdcadec
 PKG_BUILDDEP+=		zip-host unzip-host giflib-host libsquish libdcadec
 PKG_BUILDDEP+=		libcrossguid libressl xz bzip2 liblzo
 PKG_BUILDDEP+=		libcrossguid libressl xz bzip2 liblzo
-PKG_NEEDS:=		threads c++ data
+PKG_NEEDS:=		threads c++ iconv data
 PKG_URL:=		http://kodi.tv/
 PKG_URL:=		http://kodi.tv/
 PKG_SITES:=		https://github.com/xbmc/xbmc/archive/
 PKG_SITES:=		https://github.com/xbmc/xbmc/archive/
 
 

+ 2 - 2
package/libdrm/Makefile

@@ -4,9 +4,9 @@
 include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/rules.mk
 
 
 PKG_NAME:=		libdrm
 PKG_NAME:=		libdrm
-PKG_VERSION:=		2.4.86
+PKG_VERSION:=		2.4.82
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		90fca042dd5c619fff2771ab634c69010f25c582071519aa284860758fac2963
+PKG_HASH:=		473997e1fa6f73f75f99bdeb8aa140f7efc3e774988b005c470343ee3cbeb97a
 PKG_DESCR:=		direct rendering manager library
 PKG_DESCR:=		direct rendering manager library
 PKG_SECTION:=		libs/video
 PKG_SECTION:=		libs/video
 PKG_BUILDDEP:=		libpthread-stubs cairo libpciaccess
 PKG_BUILDDEP:=		libpthread-stubs cairo libpciaccess

+ 2 - 2
package/libnfs/Makefile

@@ -4,9 +4,9 @@
 include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/rules.mk
 
 
 PKG_NAME:=		libnfs
 PKG_NAME:=		libnfs
-PKG_VERSION:=		2.0.0
+PKG_VERSION:=		1.9.8
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		6eaeb85559bb3e378284688f06fc56b018d324a5fc69f3f5259d24593ad113cf
+PKG_HASH:=		4d403fe5adc1f0d75fa2cd260a907834617f2ba81fd46f438b16e0a0fc8bff81
 PKG_DESCR:=		nfs client library
 PKG_DESCR:=		nfs client library
 PKG_SECTION:=		libs/net
 PKG_SECTION:=		libs/net
 PKG_URL:=		https://github.com/sahlberg/libnfs
 PKG_URL:=		https://github.com/sahlberg/libnfs

+ 3 - 3
package/libressl/Makefile

@@ -4,9 +4,9 @@
 include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/rules.mk
 
 
 PKG_NAME:=		libressl
 PKG_NAME:=		libressl
-PKG_VERSION:=		2.6.3
-PKG_RELEASE:=		1
-PKG_HASH:=		aead6598263171b96970da0d881e616d0813b69b35ebdc5991f87ff2ea7f5c98
+PKG_VERSION:=		2.5.5
+PKG_RELEASE:=		2
+PKG_HASH:=		e57f5e3d5842a81fe9351b6e817fcaf0a749ca4ef35a91465edba9e071dce7c4
 PKG_DESCR:=		ssl/tls library
 PKG_DESCR:=		ssl/tls library
 PKG_SECTION:=		libs/crypto
 PKG_SECTION:=		libs/crypto
 PKG_URL:=		http://www.libressl.org
 PKG_URL:=		http://www.libressl.org

+ 1 - 1
package/ltp/Makefile

@@ -34,7 +34,7 @@ CONFIGURE_ARGS+=	--with-open-posix-testsuite \
 			--without-expect
 			--without-expect
 
 
 pre-configure:
 pre-configure:
-	PATH="$(HOST_PATH)" $(MAKE) -C $(WRKBUILD) autotools
+	$(MAKE) -C $(WRKBUILD) autotools
 
 
 # bessel float and mallopt not implemented in uClibc-ng
 # bessel float and mallopt not implemented in uClibc-ng
 pre-build:
 pre-build:

+ 1 - 1
package/musl/Makefile

@@ -26,7 +26,7 @@ CONFIG_STYLE:=          manual
 BUILD_STYLE:=           manual
 BUILD_STYLE:=           manual
 INSTALL_STYLE:=         manual
 INSTALL_STYLE:=         manual
 
 
-MUSL_LD_SO:=		"`echo 'void main(void) {}' |${TARGET_CC} ${TARGET_CFLAGS} -x c -o \
+MUSL_LD_SO:=		"`echo 'void main(void) {}' |${TARGET_CC} -x c -o \
 			$(BUILD_DIR)/.musl.tmp - >/dev/null 2>&1 ;\
 			$(BUILD_DIR)/.musl.tmp - >/dev/null 2>&1 ;\
 			${TARGET_COMPILER_PREFIX}readelf -l $(BUILD_DIR)/.musl.tmp 2>/dev/null \
 			${TARGET_COMPILER_PREFIX}readelf -l $(BUILD_DIR)/.musl.tmp 2>/dev/null \
 			| grep 'program interpreter: /lib/ld-musl' | sed -e 's|.*lib/||'|sed -e 's|]||' ;\
 			| grep 'program interpreter: /lib/ld-musl' | sed -e 's|.*lib/||'|sed -e 's|]||' ;\

+ 2 - 2
package/openssh/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		openssh
 PKG_NAME:=		openssh
-PKG_VERSION:=		7.6p1
+PKG_VERSION:=		7.5p1
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		a323caeeddfe145baaa0db16e98d784b1fbc7dd436a6bf1f479dfd5cd1d21723
+PKG_HASH:=		9846e3c5fab9f0547400b4d2c017992f914222b3fd1f8eee6c7dc6bc5e59f9f0
 PKG_DESCR:=		secure shell implementation
 PKG_DESCR:=		secure shell implementation
 PKG_SECTION:=		net/security
 PKG_SECTION:=		net/security
 PKG_BUILDDEP:=		zlib libressl
 PKG_BUILDDEP:=		zlib libressl

+ 11 - 0
package/openssh/patches/patch-openbsd-compat_port-tun_c

@@ -0,0 +1,11 @@
+--- openssh-5.6p1.orig/openbsd-compat/port-tun.c	2010-08-10 04:47:42.000000000 +0200
++++ openssh-5.6p1/openbsd-compat/port-tun.c	2011-01-27 18:16:39.000000000 +0100
+@@ -215,7 +215,7 @@ sys_tun_infilter(struct Channel *c, char
+ 	if (len <= 0 || len > (int)(sizeof(rbuf) - sizeof(*af)))
+ 		return (-1);
+ 	ptr = (char *)&rbuf[0];
+-	bcopy(buf, ptr + sizeof(u_int32_t), len);
++	memcpy(ptr + sizeof(u_int32_t), buf, len);
+ 	len += sizeof(u_int32_t);
+ 	af = (u_int32_t *)ptr;
+ 

+ 2 - 2
package/php/Makefile

@@ -4,9 +4,9 @@
 include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/rules.mk
 
 
 PKG_NAME:=		php
 PKG_NAME:=		php
-PKG_VERSION:=		7.0.25
+PKG_VERSION:=		7.0.19
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		5cc14bd20fb2226f6d34465662425cd100441bde9042ea1cef2e4506d6ded8cc
+PKG_HASH:=		640e5e3377d15a6d19adce2b94a9d876eeddabdb862d154a5e347987f4225ef6
 PKG_DESCR:=		php language interpreter
 PKG_DESCR:=		php language interpreter
 PKG_SECTION:=		dev/lang
 PKG_SECTION:=		dev/lang
 PKG_NEEDS:=		threads
 PKG_NEEDS:=		threads

+ 0 - 40
package/pigpio/Makefile

@@ -1,40 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-include ${ADK_TOPDIR}/rules.mk
-
-PKG_NAME:=		pigpio
-PKG_VERSION:=		1aa4cca8a69d4f8f8ce198178dbd7f436b4f503c
-PKG_GIT:=		hash
-PKG_RELEASE:=		1
-PKG_HASH:=		9d48aa27bb8c9721f5e78f234834ee447934d9a21aeb0a58f123c7be0bb90126
-PKG_DESCR:=		IO library for the raspberry PI
-PKG_SECTION:=		libs/misc
-PKG_NEEDS:=		c++
-PKG_URL:=		http://joan2937.github.io/pigpio/
-PKG_SITES:=		https://github.com/joan2937/pigpio.git
-
-include ${ADK_TOPDIR}/mk/package.mk
-
-$(eval $(call PKG_template,PIGPIO,pigpio,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
-
-CONFIG_STYLE:=		manual
-BUILD_STYLE:=		manual
-INSTALL_STYLE:=		manual
-
-post-build:
-	$(INSTALL_DIR) ${WRKINST}/usr/include/pigpio
-	$(CP) ${WRKBUILD}/pigpio.h \
-		${WRKINST}/usr/include/pigpio
-	$(INSTALL_DIR) ${WRKINST}/usr/lib
-	$(CP) ${WRKBUILD}/libpigpio.so \
-		${WRKINST}/usr/lib
-
-do-build:
-	cd $(WRKBUILD) && CROSS_PREFIX=${TARGET_CROSS} DESTDIR=$(WRKINST) prefix=${WRKINST}/usr ${MAKE}
-	
-do-install:
-	${INSTALL_DIR} ${IDIR_PIGPIO}/usr/lib
-	${CP} ${WRKINST}/usr/lib/libpigpio.so ${IDIR_PIGPIO}/usr/lib/
-
-include ${ADK_TOPDIR}/mk/pkg-bottom.mk

+ 0 - 20
package/pigpio/patches/patch-Makefile

@@ -1,20 +0,0 @@
-Remove empty cross_prefix variable and prefix
-
---- pigpio-1aa4cca8a69d4f8f8ce198178dbd7f436b4f503c.orig/Makefile	2017-06-29 18:30:31.000000000 +0200
-+++ pigpio-1aa4cca8a69d4f8f8ce198178dbd7f436b4f503c/Makefile	2017-06-29 18:45:16.000000000 +0200
-@@ -1,7 +1,6 @@
- #
- # Set CROSS_PREFIX to prepend to all compiler tools at once for easier
- # cross-compilation.
--CROSS_PREFIX =
- CC           = $(CROSS_PREFIX)gcc
- AR           = $(CROSS_PREFIX)ar
- RANLIB       = $(CROSS_PREFIX)ranlib
-@@ -31,7 +30,6 @@ LL2      = -L. -lpigpiod_if -pthread -lr
- 
- LL3      = -L. -lpigpiod_if2 -pthread -lrt
- 
--prefix = /usr/local
- exec_prefix = $(prefix)
- bindir = $(exec_prefix)/bin
- includedir = $(prefix)/include

+ 3 - 4
package/samba/Makefile

@@ -4,13 +4,12 @@
 include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/rules.mk
 
 
 PKG_NAME:=		samba
 PKG_NAME:=		samba
-PKG_VERSION:=		4.6.9
-PKG_RELEASE:=		1
-PKG_HASH:=		c31db4aad82f0b9588ef6c4b4dab5dce3fa1787bd298e62d953c2628bb1af21a
+PKG_VERSION:=		4.6.6
+PKG_RELEASE:=		2
+PKG_HASH:=		fc31c809f7d85ae30f2b7dcddcb8404201b626047458cb5f2b743d4f6f3f1a8e
 PKG_DESCR:=		file and print server
 PKG_DESCR:=		file and print server
 PKG_SECTION:=		net/fs
 PKG_SECTION:=		net/fs
 PKG_DEPENDS:=		libuuid libpopt libgnutls libtirpc
 PKG_DEPENDS:=		libuuid libpopt libgnutls libtirpc
-PKG_DEPENDS+=		libtalloc
 PKG_BUILDDEP:=		util-linux popt python2 gnutls talloc
 PKG_BUILDDEP:=		util-linux popt python2 gnutls talloc
 PKG_BUILDDEP+=		heimdal-host python2-host libtirpc
 PKG_BUILDDEP+=		heimdal-host python2-host libtirpc
 PKG_NEEDS:=		threads intl
 PKG_NEEDS:=		threads intl

+ 47 - 0
package/sash/files/rc

@@ -0,0 +1,47 @@
+#!/bin/sh
+set -x
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+ln -s /proc/self/fd/2 /dev/stderr
+: ${rcquiet=0}
+if [ $rcquiet -ne 1 ];then
+	echo "System initialization ..."
+fi
+
+# remount /dev with smaller size
+mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev
+
+# start mdev dynamic device node management
+echo >/dev/mdev.seq
+if [ -f /proc/sys/kernel/hotplug ];then
+	echo "/sbin/mdev" >/proc/sys/kernel/hotplug
+fi
+# creates f.e. /dev/root
+mdev -s
+
+# seed some random
+cat /etc/.rnd >/dev/urandom 2>&1
+
+# setup cfgfs
+[ -x /sbin/cfgfs ] && {
+	cfgfs setup
+	mount -o remount,ro /
+}
+
+# remount /tmp with smaller size
+size=$(cat /etc/tmpfs 2>/dev/null)
+[ -z $size ] && size=2048
+mount -o remount,nosuid,nodev,mode=1777,size=${size}k -t tmpfs tmpfs /tmp
+
+# create some useful directories in tmpfs
+mkdir -p /var/log
+mkdir -p /var/run
+mkdir -p /var/tmp
+touch /var/log/lastlog
+touch /var/log/wtmp
+
+HOSTNAME=
+[[ -s /etc/hostname ]] && HOSTNAME=$(cat /etc/hostname)
+HOSTNAME=${HOSTNAME%%.*}
+echo ${HOSTNAME:=openadk} >/proc/sys/kernel/hostname
+
+chown 0:0 /tmp; chmod 1777 /tmp

+ 5 - 0
package/sash/src/Makefile

@@ -1,3 +1,4 @@
+
 SH = sh
 SH = sh
 SHOBJS = sash.o cmds.o cmd_uclinux.o ls.o hexdump.o df.o free.o \
 SHOBJS = sash.o cmds.o cmd_uclinux.o ls.o hexdump.o df.o free.o \
 	hostname.o date.o
 	hostname.o date.o
@@ -9,9 +10,12 @@ REBOOT = reboot
 REBOOTOBJS = reboot.o
 REBOOTOBJS = reboot.o
 
 
 SHOBJS += ps.o
 SHOBJS += ps.o
+CFLAGS += -DCONFIG_USER_SASH_PS
 
 
 LIBSASH = libsash/libsash.a
 LIBSASH = libsash/libsash.a
 
 
+CFLAGS += -DCOMMAND_HISTORY
+
 all: $(SH) $(SHUTDOWN) $(REBOOT)
 all: $(SH) $(SHUTDOWN) $(REBOOT)
 
 
 $(SH): $(SHOBJS) $(LIBSASH)
 $(SH): $(SHOBJS) $(LIBSASH)
@@ -31,3 +35,4 @@ $(LIBSASH): dummy_target
 clean:
 clean:
 	-rm -f $(SH) $(SHUTDOWN) $(REBOOT) *.elf *.gdb *.o
 	-rm -f $(SH) $(SHUTDOWN) $(REBOOT) *.elf *.gdb *.o
 	$(MAKE) -C libsash clean
 	$(MAKE) -C libsash clean
+

+ 3 - 0
package/sash/src/README

@@ -1,3 +1,6 @@
+
+
   This shell is an adaption of David Bell's "sash", the stand-along shell,
   This shell is an adaption of David Bell's "sash", the stand-along shell,
 with some adaptions (and truncations) for our environment. It also includes
 with some adaptions (and truncations) for our environment. It also includes
 a few utilities (like reboot and ps) that weren't part of the original sash.
 a few utilities (like reboot and ps) that weren't part of the original sash.
+

+ 21 - 20
package/sash/src/cmd_uclinux.c

@@ -1,3 +1,4 @@
+
 #include "sash.h"
 #include "sash.h"
 
 
 #include <fcntl.h>
 #include <fcntl.h>
@@ -28,37 +29,37 @@ do_ps(argc, argv)
 	DIR * d;
 	DIR * d;
 	struct dirent * de;
 	struct dirent * de;
 	int l;
 	int l;
-
+	
 	printf("  PID TTY STAT  TIME COMMAND\n");
 	printf("  PID TTY STAT  TIME COMMAND\n");
-
-
+	
+	
 	d = opendir("/proc");
 	d = opendir("/proc");
 	if (!d)
 	if (!d)
 		return;
 		return;
-
+	
 	while (de = readdir(d)) {
 	while (de = readdir(d)) {
 		for(i=0;i<strlen(de->d_name);i++)
 		for(i=0;i<strlen(de->d_name);i++)
 			if (!isdigit(de->d_name[i]))
 			if (!isdigit(de->d_name[i]))
 				goto next;
 				goto next;
-
+		
 		sprintf(psbuf, "/proc/%s/stat", de->d_name);
 		sprintf(psbuf, "/proc/%s/stat", de->d_name);
 		h = open(psbuf, O_RDONLY);
 		h = open(psbuf, O_RDONLY);
-
+		
 		if (h==-1)
 		if (h==-1)
 			continue;
 			continue;
-
+			
 		l = read(h, psbuf, 255);
 		l = read(h, psbuf, 255);
 		if (l<=0) {
 		if (l<=0) {
 			perror("Unable to read status");
 			perror("Unable to read status");
 			close(h);
 			close(h);
 			continue;
 			continue;
 		}
 		}
-
+		
 		psbuf[l] = '\0';
 		psbuf[l] = '\0';
 		psbuf[255] = '\0';
 		psbuf[255] = '\0';
-
-
-		if (sscanf(psbuf,
+		
+		
+		if (sscanf(psbuf, 
 			"%d %s %c",
 			"%d %s %c",
 			&pid, name, &statec)<3)
 			&pid, name, &statec)<3)
 			{
 			{
@@ -66,34 +67,34 @@ do_ps(argc, argv)
 			close(h);
 			close(h);
 			continue;
 			continue;
 		}
 		}
-
+		
 		state = statec;
 		state = statec;
-
+		
 		close(h);
 		close(h);
-
+		
 		sprintf(psbuf, "/proc/%s/cmdline", de->d_name);
 		sprintf(psbuf, "/proc/%s/cmdline", de->d_name);
 		h = open(psbuf, O_RDONLY);
 		h = open(psbuf, O_RDONLY);
-
+		
 		if (h == -1) {
 		if (h == -1) {
 			perror("Unable to open cmdline");
 			perror("Unable to open cmdline");
 			continue;
 			continue;
 		}
 		}
-
+		
 		l = read(h, psbuf, 255);
 		l = read(h, psbuf, 255);
 		if (l < 0) {
 		if (l < 0) {
 			perror("Unable to read cmdline");
 			perror("Unable to read cmdline");
 			close(h);
 			close(h);
 			continue;
 			continue;
 		}
 		}
-
+		
 		close(h);
 		close(h);
-
+		
 		psbuf[255] = psbuf[l] = '\0';
 		psbuf[255] = psbuf[l] = '\0';
-
+		
 		printf("%5d %3s %c     --:-- %s\n", pid, "", state, psbuf);
 		printf("%5d %3s %c     --:-- %s\n", pid, "", state, psbuf);
 	next:
 	next:
 	}
 	}
-
+	
 	closedir(d);
 	closedir(d);
 }
 }
 #endif
 #endif

+ 20 - 4
package/sash/src/cmds.c

@@ -24,6 +24,9 @@
 #include <grp.h>
 #include <grp.h>
 #include <utime.h>
 #include <utime.h>
 #include <errno.h>
 #include <errno.h>
+#ifdef EMBED
+#include <config/autoconf.h>
+#endif
 
 
 void
 void
 do_echo(argc, argv)
 do_echo(argc, argv)
@@ -58,6 +61,16 @@ do_pwd(argc, argv)
 	printf("%s\n", buf);
 	printf("%s\n", buf);
 }
 }
 
 
+void
+do_time(argc, argv)
+	int	argc;
+	char ** argv;
+{
+	struct timeval tv;
+	gettimeofday(&tv, 0);
+	printf("Time of day = %d.%6.6d seconds\n", tv.tv_sec, tv.tv_usec);
+}
+
 void
 void
 do_cd(argc, argv)
 do_cd(argc, argv)
 	int	argc;
 	int	argc;
@@ -104,7 +117,7 @@ do_mkdir(argc, argv)
 }
 }
 
 
 void
 void
-do_sleep(argc, argv)
+do_sleep(argc, argv) 
 	int	argc;
 	int	argc;
 	char	**argv;
 	char	**argv;
 {
 {
@@ -176,6 +189,9 @@ do_sync(argc, argv)
 	int	argc;
 	int	argc;
 	char	**argv;
 	char	**argv;
 {
 {
+#ifdef CONFIG_USER_FLATFSD_FLATFSD
+	system("exec flatfsd -s");
+#endif
 	sync();
 	sync();
 }
 }
 
 
@@ -543,7 +559,7 @@ do_cmp(argc, argv)
 	char		*buf2;
 	char		*buf2;
 	struct	stat	statbuf1;
 	struct	stat	statbuf1;
 	struct	stat	statbuf2;
 	struct	stat	statbuf2;
-
+	
 	if (stat(argv[1], &statbuf1) < 0) {
 	if (stat(argv[1], &statbuf1) < 0) {
 		perror(argv[1]);
 		perror(argv[1]);
 		return;
 		return;
@@ -565,7 +581,7 @@ do_cmp(argc, argv)
 		printf("Files are different sizes\n");
 		printf("Files are different sizes\n");
 		return;
 		return;
 	}
 	}
-
+	
 	fd1 = open(argv[1], 0);
 	fd1 = open(argv[1], 0);
 	if (fd1 < 0) {
 	if (fd1 < 0) {
 		perror(argv[1]);
 		perror(argv[1]);
@@ -578,7 +594,7 @@ do_cmp(argc, argv)
 		close(fd1);
 		close(fd1);
 		return;
 		return;
 	}
 	}
-
+	
 	buf1 = malloc(8192-16);
 	buf1 = malloc(8192-16);
 	buf2 = malloc(8192-16);
 	buf2 = malloc(8192-16);
 
 

+ 1 - 0
package/sash/src/cp.c

@@ -1,3 +1,4 @@
+
 void
 void
 do_cp(argc, argv)
 do_cp(argc, argv)
 	char	**argv;
 	char	**argv;

+ 11 - 8
package/sash/src/date.c

@@ -12,41 +12,44 @@ int do_date(int argc, char * argv[])
     struct tm tm_time;
     struct tm tm_time;
     time(&tm);
     time(&tm);
     memcpy(&tm_time, localtime(&tm), sizeof(tm_time));
     memcpy(&tm_time, localtime(&tm), sizeof(tm_time));
-
+    
     if (argc > 1) {
     if (argc > 1) {
 	int nr;
 	int nr;
-
+        
 	nr = sscanf(argv[1], "%2d%2d%2d%2d%d",
 	nr = sscanf(argv[1], "%2d%2d%2d%2d%d",
                     &(tm_time.tm_mon),
                     &(tm_time.tm_mon),
                     &(tm_time.tm_mday),
                     &(tm_time.tm_mday),
                     &(tm_time.tm_hour),
                     &(tm_time.tm_hour),
                     &(tm_time.tm_min), &(tm_time.tm_year));
                     &(tm_time.tm_min), &(tm_time.tm_year));
-
+        
 	if (nr < 4 || nr > 5) {
 	if (nr < 4 || nr > 5) {
             fprintf(stderr, invalid_date, argv[1]);
             fprintf(stderr, invalid_date, argv[1]);
             return(0);
             return(0);
 	}
 	}
-
+        
 	/* correct for century  - minor Y2K problem here? */
 	/* correct for century  - minor Y2K problem here? */
 	if (tm_time.tm_year >= 1900)
 	if (tm_time.tm_year >= 1900)
             tm_time.tm_year -= 1900;
             tm_time.tm_year -= 1900;
 	/* adjust date */
 	/* adjust date */
 	tm_time.tm_mon -= 1;
 	tm_time.tm_mon -= 1;
-
+        
         if((tm = mktime(&tm_time)) < 0) {
         if((tm = mktime(&tm_time)) < 0) {
             fprintf(stderr, invalid_date, argv[1]);
             fprintf(stderr, invalid_date, argv[1]);
             return(0);
             return(0);
         }
         }
-
+        
         if(stime(&tm) < 0) {
         if(stime(&tm) < 0) {
             fprintf(stderr, "Unable to set date\n");
             fprintf(stderr, "Unable to set date\n");
             return(0);
             return(0);
         }
         }
-
+            
         return (0);
         return (0);
-
+        
     }
     }
     printf("%s\n",asctime(&tm_time));
     printf("%s\n",asctime(&tm_time));
 
 
     return(0);
     return(0);
 }
 }
+
+
+

+ 3 - 2
package/sash/src/df.c

@@ -41,14 +41,15 @@ do_df(int argc, char * argv[])
 		name = "/";
 		name = "/";
 	else
 	else
 		name = argv[1];
 		name = argv[1];
-
+	
 	if (statfs(name, &stbuf) == -1) {
 	if (statfs(name, &stbuf) == -1) {
 		printf("Unable to get disk space of %s: %s\n", name, strerror(errno));
 		printf("Unable to get disk space of %s: %s\n", name, strerror(errno));
 		return;
 		return;
 	}
 	}
-
+	
 	printf("Total Kbytes: %ld\n", (stbuf.f_bsize / 256) * (stbuf.f_blocks / 4));
 	printf("Total Kbytes: %ld\n", (stbuf.f_bsize / 256) * (stbuf.f_blocks / 4));
 	printf("Free  Kbytes: %ld\n", (stbuf.f_bsize / 256) * (stbuf.f_bfree / 4));
 	printf("Free  Kbytes: %ld\n", (stbuf.f_bsize / 256) * (stbuf.f_bfree / 4));
 	printf("Total  nodes: %ld\n", stbuf.f_files);
 	printf("Total  nodes: %ld\n", stbuf.f_files);
 	printf("Free   nodes: %ld\n", stbuf.f_ffree);
 	printf("Free   nodes: %ld\n", stbuf.f_ffree);
 }
 }
+

+ 4 - 3
package/sash/src/free.c

@@ -29,16 +29,17 @@ do_free(argc, argv)
 	char buf[256];
 	char buf[256];
 
 
 	f = fopen("/proc/meminfo", "r");
 	f = fopen("/proc/meminfo", "r");
-
+	
 	if (!f) {
 	if (!f) {
 		perror("Unable to open /proc/meminfo: ");
 		perror("Unable to open /proc/meminfo: ");
 		return;
 		return;
 	}
 	}
-
+	
 	for(i=0;i<3;i++) {
 	for(i=0;i<3;i++) {
 		fgets(buf, 250, f);
 		fgets(buf, 250, f);
 		fputs(buf, stdout);
 		fputs(buf, stdout);
 	}
 	}
-
+	
 	fclose(f);
 	fclose(f);
 }
 }
+

+ 20 - 19
package/sash/src/hexdump.c

@@ -32,13 +32,13 @@ do_hexdump(argc, argv)
 	char	*name = 0;
 	char	*name = 0;
 	unsigned long pos = 0;
 	unsigned long pos = 0;
 	char	*myname = argv[0];
 	char	*myname = argv[0];
-
+ 
 	if ( (argc > 2) && !strcmp(argv[1],"-s") ) {
 	if ( (argc > 2) && !strcmp(argv[1],"-s") ) {
 		pos = strtoul(argv[2], 0, 0);
 		pos = strtoul(argv[2], 0, 0);
 		argc -= 2;
 		argc -= 2;
 		argv += 2;
 		argv += 2;
 	}
 	}
-
+	
 	if (argc <= 1) {
 	if (argc <= 1) {
 		fprintf(stderr, "No filename provided\n");
 		fprintf(stderr, "No filename provided\n");
 		return;
 		return;
@@ -54,15 +54,15 @@ do_hexdump(argc, argv)
 
 
 	if (pos)
 	if (pos)
 		fseek(fp, pos, SEEK_SET);
 		fseek(fp, pos, SEEK_SET);
-
+	
 	c = 0;
 	c = 0;
-
+	
 	text[16] = 0;
 	text[16] = 0;
-
+	
 	while(!feof(fp)) {
 	while(!feof(fp)) {
-
+	
 	  strcmp(text, "                ");
 	  strcmp(text, "                ");
-
+	
 	  while (c < (pos & 0xf)) {
 	  while (c < (pos & 0xf)) {
 	    if (c == 0)
 	    if (c == 0)
 	      printf("%4X:", pos & 0xfffffff0);
 	      printf("%4X:", pos & 0xfffffff0);
@@ -70,35 +70,35 @@ do_hexdump(argc, argv)
 	    text[c] = ' ';
 	    text[c] = ' ';
 	    c++;
 	    c++;
 	  }
 	  }
-
+	
 	  {
 	  {
 	    int p = 0;
 	    int p = 0;
             count = fread(buf, 1, 128 - (pos % 16), fp);
             count = fread(buf, 1, 128 - (pos % 16), fp);
-
+          
             if (count <= 0)
             if (count <= 0)
               break;
               break;
 
 
             while (p < count) {
             while (p < count) {
               c = (pos & 0xf);
               c = (pos & 0xf);
-
+            
               if (c == 0)
               if (c == 0)
                 printf("%4X:", pos & 0xfffffff0);
                 printf("%4X:", pos & 0xfffffff0);
-
+              
               if ((buf[p] < 32) || (buf[p]>126))
               if ((buf[p] < 32) || (buf[p]>126))
                 text[c] = '.';
                 text[c] = '.';
               else
               else
                 text[c] = buf[p];
                 text[c] = buf[p];
-
+            
 	      printf( (c==15) ? " %02.2X" : (c == 8) ? "-%02.2X" : " %02.2X", buf[p]);
 	      printf( (c==15) ? " %02.2X" : (c == 8) ? "-%02.2X" : " %02.2X", buf[p]);
-
+	      
 	      if (c == 15)
 	      if (c == 15)
 	        printf(" %s\n", text);
 	        printf(" %s\n", text);
-
+	    
               pos++;
               pos++;
               p++;
               p++;
             }
             }
 	  }
 	  }
-
+	  
 	  if (c = (pos & 0x0f)) {
 	  if (c = (pos & 0x0f)) {
 
 
 	    while (c < 16) {
 	    while (c < 16) {
@@ -106,16 +106,16 @@ do_hexdump(argc, argv)
 	      text[c] = ' ';
 	      text[c] = ' ';
 	      c++;
 	      c++;
 	    }
 	    }
-
+	  
 	    printf(" %s\n", text);
 	    printf(" %s\n", text);
 	  }
 	  }
-
+	    
 	  if (feof(fp))
 	  if (feof(fp))
 	    break;
 	    break;
-
+	  
 	  printf("--more--");
 	  printf("--more--");
 	  fflush(stdout);
 	  fflush(stdout);
-
+	  
 	  fgets(buf, 80, stdin);
 	  fgets(buf, 80, stdin);
 	  if (toupper(buf[0]) == 'Q')
 	  if (toupper(buf[0]) == 'Q')
 	    break;
 	    break;
@@ -124,3 +124,4 @@ do_hexdump(argc, argv)
 	if (fp != stdin)
 	if (fp != stdin)
 		fclose(fp);
 		fclose(fp);
 }
 }
+

+ 1 - 1
package/sash/src/hostname.c

@@ -10,7 +10,7 @@
 void do_hostname(int argc, char **argv)
 void do_hostname(int argc, char **argv)
 {
 {
 	char hn[PATHLEN + 1];
 	char hn[PATHLEN + 1];
-
+	
 	if(argc >= 2) {
 	if(argc >= 2) {
 		if(strlen(argv[1]) > PATHLEN) {
 		if(strlen(argv[1]) > PATHLEN) {
 			printf("That name is too long.\n");
 			printf("That name is too long.\n");

+ 0 - 1
package/sash/src/libsash/Makefile

@@ -1,6 +1,5 @@
 
 
 LIB = libsash.a
 LIB = libsash.a
-RANLIB ?= ranlib
 CHOPSRC = utils.c
 CHOPSRC = utils.c
 LIBOBJS = intflag.o modestring.o timestring.o isadir.o copyfile.o \
 LIBOBJS = intflag.o modestring.o timestring.o isadir.o copyfile.o \
 	buildname.o expandwildcards.o namesort.o match.o makeargs.o \
 	buildname.o expandwildcards.o namesort.o match.o makeargs.o \

+ 2 - 2
package/sash/src/ls.c

@@ -74,7 +74,7 @@ do_ls(argc, argv)
 		listsize = LISTSIZE;
 		listsize = LISTSIZE;
 	}
 	}
 	listused = 0;
 	listused = 0;
-
+	
 	flags = 0;
 	flags = 0;
 	if ((argc > 1) && (argv[1][0] == '-'))
 	if ((argc > 1) && (argv[1][0] == '-'))
 	{
 	{
@@ -135,7 +135,7 @@ do_ls(argc, argv)
 			printf("\n%s:\n", name);
 			printf("\n%s:\n", name);
 
 
 		while ((dp = readdir(dirp)) != NULL) {
 		while ((dp = readdir(dirp)) != NULL) {
-
+		
 			if ((dp->d_name[0] == '.') && !(flags & LSF_ALL))
 			if ((dp->d_name[0] == '.') && !(flags & LSF_ALL))
 				continue;
 				continue;
 
 

+ 47 - 46
package/sash/src/ps.c

@@ -75,20 +75,20 @@ do_ps(argc, argv)
 
 
 #if 0
 #if 0
 	fclose(stdin);
 	fclose(stdin);
-#endif
+#endif 
 
 
 	printf("  PID PORT STAT  SIZE SHARED %%CPU COMMAND\n"/*, _vfprintf_fp_ref, _vfscanf_fp_ref*/);
 	printf("  PID PORT STAT  SIZE SHARED %%CPU COMMAND\n"/*, _vfprintf_fp_ref, _vfscanf_fp_ref*/);
 
 
 	h = open("/proc/uptime", O_RDONLY);
 	h = open("/proc/uptime", O_RDONLY);
-
+		
 	if (h==-1) {
 	if (h==-1) {
 		perror("Unable to open /proc/uptime\n");
 		perror("Unable to open /proc/uptime\n");
 		return;
 		return;
 	}
 	}
-
+	
 	l = read(h, psbuf, 255);
 	l = read(h, psbuf, 255);
 
 
-	close(h);
+	close(h);  
 
 
 
 
 	if (l<=0) {
 	if (l<=0) {
@@ -99,56 +99,56 @@ do_ps(argc, argv)
 
 
 	psbuf[l] = '\0';
 	psbuf[l] = '\0';
 	psbuf[255] = '\0';
 	psbuf[255] = '\0';
-
+		
 	ext = psbuf;
 	ext = psbuf;
 
 
 
 
 	uptime_secs = atol(ext);
 	uptime_secs = atol(ext);
 
 
-
+	
 	time_now = time(0);
 	time_now = time(0);
-
+	
 	d = opendir("/proc");
 	d = opendir("/proc");
 	if (!d)
 	if (!d)
 		return;
 		return;
-
+	
 	while (de = readdir(d)) {
 	while (de = readdir(d)) {
-
-
+	
+	
 		for(i=0;i<strlen(de->d_name);i++)
 		for(i=0;i<strlen(de->d_name);i++)
 			if (!isdigit(de->d_name[i]))
 			if (!isdigit(de->d_name[i]))
 				goto next;
 				goto next;
 
 
 		sprintf(psbuf, "/proc/%s/stat", de->d_name);
 		sprintf(psbuf, "/proc/%s/stat", de->d_name);
-
+		
 		h = open(psbuf, O_RDONLY);
 		h = open(psbuf, O_RDONLY);
-
+		
 		if (h==-1)
 		if (h==-1)
 			continue;
 			continue;
-
+			
 		l = read(h, psbuf, 255);
 		l = read(h, psbuf, 255);
 		if (l<=0) {
 		if (l<=0) {
 			perror("Unable to read status");
 			perror("Unable to read status");
 			close(h);
 			close(h);
 			continue;
 			continue;
 		}
 		}
-
+		
 		psbuf[l] = '\0';
 		psbuf[l] = '\0';
 		psbuf[255] = '\0';
 		psbuf[255] = '\0';
-
+		
 		ext = strrchr(psbuf, ')');
 		ext = strrchr(psbuf, ')');
 		ext[0] = '\0';
 		ext[0] = '\0';
 
 
 		statec = ext[2];
 		statec = ext[2];
 
 
 		ext += 4;
 		ext += 4;
-
+		
 		ppid = atoi(ext);
 		ppid = atoi(ext);
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
 
 
 		pgrp = atoi(ext);
 		pgrp = atoi(ext);
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
-
+		
 		session = atoi(ext);
 		session = atoi(ext);
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
 
 
@@ -158,7 +158,7 @@ do_ps(argc, argv)
 		//printf("1|%s\n", ext);
 		//printf("1|%s\n", ext);
 		//tpgid
 		//tpgid
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
-
+		
 		//printf("2|%s\n", ext);
 		//printf("2|%s\n", ext);
 		//flags
 		//flags
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
@@ -186,7 +186,7 @@ do_ps(argc, argv)
 		//printf("8|%s\n", ext);
 		//printf("8|%s\n", ext);
 		stime = atoi(ext);
 		stime = atoi(ext);
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
-
+		
 		//printf("9|%s\n", ext);
 		//printf("9|%s\n", ext);
 		//cutime
 		//cutime
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
@@ -194,13 +194,13 @@ do_ps(argc, argv)
 		//printf("10|%s\n", ext);
 		//printf("10|%s\n", ext);
 		//cstime
 		//cstime
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
-
+		
 		//priority
 		//priority
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
-
+		
 		//nice
 		//nice
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
-
+		
 		//timeout
 		//timeout
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
 
 
@@ -208,26 +208,26 @@ do_ps(argc, argv)
 		ext = strchr(ext, ' ')+1;
 		ext = strchr(ext, ' ')+1;
 
 
 		start_time = atoi(ext);
 		start_time = atoi(ext);
-
+		
 		ext = strchr(psbuf, '(');
 		ext = strchr(psbuf, '(');
 		ext++;
 		ext++;
 		strcpy(name, ext);
 		strcpy(name, ext);
-
+		
 		pid = atoi(psbuf);
 		pid = atoi(psbuf);
-
-
+		
+		
 		state = statec;
 		state = statec;
-
+		
 		close(h);
 		close(h);
-
+		
 		dev_to_name(tty, tty_name);
 		dev_to_name(tty, tty_name);
-
+		
 		bytes = 0;
 		bytes = 0;
 		sbytes = 0;
 		sbytes = 0;
 		sprintf(psbuf, "/proc/%s/status", de->d_name);
 		sprintf(psbuf, "/proc/%s/status", de->d_name);
 
 
 		f = fopen(psbuf, "r");
 		f = fopen(psbuf, "r");
-
+		
 		if (f) {
 		if (f) {
 			while (fgets(psbuf, 250, f)) {
 			while (fgets(psbuf, 250, f)) {
 				if (strncmp(psbuf, "Mem:", 4) == 0) {
 				if (strncmp(psbuf, "Mem:", 4) == 0) {
@@ -242,53 +242,53 @@ do_ps(argc, argv)
 			}
 			}
 			fclose(f);
 			fclose(f);
 		}
 		}
-
+		
 
 
 		seconds = ((uptime_secs * (long)HZ) - start_time) / HZ;
 		seconds = ((uptime_secs * (long)HZ) - start_time) / HZ;
-
+		
 		/*printf("seconds=%s\n", gcvt(seconds, 15, psbuf));*/
 		/*printf("seconds=%s\n", gcvt(seconds, 15, psbuf));*/
-
+		
 		start = time_now - seconds;
 		start = time_now - seconds;
-
+		
 		/*
 		/*
 		printf("1\n");
 		printf("1\n");
 
 
 		gcvt(start, 15, psbuf);
 		gcvt(start, 15, psbuf);
 
 
 		printf("2\n");
 		printf("2\n");
-
+		
 		printf("start=%s\n", psbuf);
 		printf("start=%s\n", psbuf);
-
+		
 		printf("utime=%d, stime=%d. start_time=%d\n", utime, stime, start_time);
 		printf("utime=%d, stime=%d. start_time=%d\n", utime, stime, start_time);
 		*/
 		*/
-
+		
 		total_time = (utime + stime);
 		total_time = (utime + stime);
 
 
 		/*printf("total_time=%s\n", gcvt(total_time, 15, psbuf));*/
 		/*printf("total_time=%s\n", gcvt(total_time, 15, psbuf));*/
 
 
-		pcpu = 	seconds ?
+		pcpu = 	seconds ? 
 			(total_time * 10.0f * 100.0f / (float)HZ) / seconds :
 			(total_time * 10.0f * 100.0f / (float)HZ) / seconds :
-			0;
+			0; 
 		if (pcpu > 999) pcpu = 999;
 		if (pcpu > 999) pcpu = 999;
 
 
 
 
 		sprintf(psbuf, "/proc/%s/cmdline", de->d_name);
 		sprintf(psbuf, "/proc/%s/cmdline", de->d_name);
 		h = open(psbuf, O_RDONLY);
 		h = open(psbuf, O_RDONLY);
-
+		
 		if (h == -1) {
 		if (h == -1) {
 			perror("Unable to open cmdline");
 			perror("Unable to open cmdline");
 			continue;
 			continue;
 		}
 		}
-
+		
 		l = read(h, psbuf, 255);
 		l = read(h, psbuf, 255);
 		if (l < 0) {
 		if (l < 0) {
 			perror("Unable to read cmdline");
 			perror("Unable to read cmdline");
 			close(h);
 			close(h);
 			continue;
 			continue;
 		}
 		}
-
+		
 		close(h);
 		close(h);
-
+		
 		/*
 		/*
 		 * the args are NUL separated, substitute spaces instead
 		 * the args are NUL separated, substitute spaces instead
 		 */
 		 */
@@ -301,13 +301,14 @@ do_ps(argc, argv)
 				psbuf[i] = ' ';
 				psbuf[i] = ' ';
 
 
 		printf("%5d %4s %c    %4ldK   %3ldK %2u.%u %s\n", pid, tty_name, state,
 		printf("%5d %4s %c    %4ldK   %3ldK %2u.%u %s\n", pid, tty_name, state,
-			bytes, sbytes,
-			 pcpu / 10, pcpu % 10,
+			bytes, sbytes, 
+			 pcpu / 10, pcpu % 10, 
 			 /*(int)seconds / 60, (int)seconds % 60,*/
 			 /*(int)seconds / 60, (int)seconds % 60,*/
 			 l ? psbuf : name);
 			 l ? psbuf : name);
 	next:
 	next:
 		;
 		;
 	}
 	}
-
+	
 	closedir(d);
 	closedir(d);
 }
 }
+

+ 16 - 1
package/sash/src/reboot.c

@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
 	int delay = 0; /* delay in seconds before rebooting */
 	int delay = 0; /* delay in seconds before rebooting */
 	int rc;
 	int rc;
 	int force = 0;
 	int force = 0;
-
+  
 	while ((rc = getopt(argc, argv, "h?d:f")) > 0) {
 	while ((rc = getopt(argc, argv, "h?d:f")) > 0) {
 		switch (rc) {
 		switch (rc) {
 		case 'd':
 		case 'd':
@@ -54,6 +54,20 @@ int main(int argc, char *argv[])
 
 
 	if(delay > 0)
 	if(delay > 0)
 		sleep(delay);
 		sleep(delay);
+#ifdef CONFIG_DISKtel
+	printf("unmounting /home\n");
+	if(umount("/home") != 0){
+		printf("unmounting failed!!!\n");
+	}
+#endif
+
+#ifdef CONFIG_USER_FLATFSD_FLATFSD
+	if (!force) {
+		/* Ask flatfsd to reboot us safely */
+		execlp("flatfsd", "flatfsd", "-b", NULL);
+		/* if this returns,  then force a reboot */
+	}
+#endif
 
 
 	kill(1, SIGTSTP);
 	kill(1, SIGTSTP);
 	sync();
 	sync();
@@ -69,3 +83,4 @@ int main(int argc, char *argv[])
 	reboot(0x01234567);
 	reboot(0x01234567);
 	exit(0); /* Shrug */
 	exit(0); /* Shrug */
 }
 }
+

+ 416 - 130
package/sash/src/sash.c

@@ -12,6 +12,12 @@
 
 
 #include "sash.h"
 #include "sash.h"
 
 
+#ifndef CMD_HELP
+#define	CMD_HELP
+#endif
+#undef INTERNAL_PATH_EXPANSION
+#define FAVOUR_EXTERNAL_COMMANDS
+
 #include <stdlib.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <signal.h>
 #include <errno.h>
 #include <errno.h>
@@ -20,8 +26,7 @@
 #include <sys/time.h>
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 
 
-static const char enoent_msg[] = "Bad command or file name";
-static const char unkerr_msg[] = "Unknown error!";
+static char version[] = "1.1.1";
 
 
 extern int intflag;
 extern int intflag;
 
 
@@ -37,119 +42,155 @@ typedef struct {
 
 
 
 
 CMDTAB	cmdtab[] = {
 CMDTAB	cmdtab[] = {
-	"cat",		"filename ...",
-	do_cat,		2,	MAXARGS,
-
-	"cd",		"[dirname]",
-	do_cd,		1,	2,
+/*
+	"alias",	"[name [command]]", 	do_alias,
+	1,		MAXARGS,
+*/
+	"cd",		"[dirname]",		do_cd,
+	1,		2,
+			
+	"sleep",		"seconds",		do_sleep,
+	1,		2,
 
 
-	"chgrp",	"gid filename ...",
-	do_chgrp,	3,	MAXARGS,
+	"chgrp",	"gid filename ...",	do_chgrp,
+	3,		MAXARGS,
 
 
-	"chmod",	"mode filename ...",
-	do_chmod,	3,	MAXARGS,
+	"chmod",	"mode filename ...",	do_chmod,
+	3,		MAXARGS,
 
 
-	"chown",	"uid filename ...",
-	do_chown,	3,	MAXARGS,
+	"chown",	"uid filename ...",	do_chown,
+	3,		MAXARGS,
 
 
-	"cmp",		"filename1 filename2",
-	do_cmp,		3,	3,
+	"cmp",		"filename1 filename2",	do_cmp,
+	3,		3,
 
 
-	"cp",		"srcname ... destname",
-	do_cp,		3,	MAXARGS,
+	"cp",		"srcname ... destname",	do_cp,
+	3,		MAXARGS,
 
 
-	"date",		"date [MMDDhhmm[YYYY]]",
-	do_date,	1,	2,
+/*
+	"dd",		"if=name of=name [bs=n] [count=n] [skip=n] [seek=n]", do_dd,
+	3,		MAXARGS,
+*/
+	"df",		"[file-system]",	do_df,
+	1,		2,
 
 
-	"df",		"[file-system]",
-	do_df,		1,	2,
+	"echo",	"[args] ...",			do_echo,
+	1,		MAXARGS,
 
 
-	"echo",		"[args] ...",
-	do_echo,	1,	MAXARGS,
+/*
+	"ed",		"[filename]",		do_ed,
+	1,		2,
+*/
 
 
-	"exec",		"filename [args]",
-	do_exec,	2,	MAXARGS,
+	"exec",		"filename [args]",	do_exec,
+	2,		MAXARGS,
 
 
-	"exit",		"",
-	do_exit,	1,	1,
+	"exit",		"",			do_exit,
+	1,		1,
 
 
-	"free",		"",
-	do_free,	1,	1,
+	"free",		"",			do_free,
+	1,		1,
 
 
-	"help",		"",
-	do_help,	1,	MAXARGS,
+/*
+	"-grep",	"[-in] word filename ...",	do_grep,
+	3,		MAXARGS,
+*/
 
 
-	"hexdump",	"[-s pos] filename",
-	do_hexdump,	1,	4,
+#ifdef CMD_HELP
+	"help",		"",			do_help,
+	1,		MAXARGS,
+#endif
 
 
-	"hostname",	"[hostname]",
-	do_hostname,	1,	2,
+	"hexdump",	"[-s pos] filename",	do_hexdump,
+	1,		4,
 
 
-	"kill",		"[-sig] pid ...",
-	do_kill,	2,	MAXARGS,
+	"hostname",	"[hostname]",		do_hostname,
+	1,		2,
 
 
-	"ln",		"[-s] srcname ... destname",
-	do_ln,		3,	MAXARGS,
+	"kill",		"[-sig] pid ...",	do_kill,
+	2,		MAXARGS,
 
 
-	"ls",		"[-lidC] filename ...",
-	do_ls,		1,	MAXARGS,
+	"ln",		"[-s] srcname ... destname",	do_ln,
+	3,		MAXARGS,
 
 
-	"mkdir",	"dirname ...",
-	do_mkdir,	2,	MAXARGS,
+	"ls",		"[-lidC] filename ...",	do_ls,
+	1,		MAXARGS,
 
 
-	"mknod",	"filename type major minor",
-	do_mknod,	5,	5,
+	"mkdir",	"dirname ...",		do_mkdir,
+	2,		MAXARGS,
 
 
-	"more",		"filename ...",
-	do_more,	2,	MAXARGS,
+	"mknod",	"filename type major minor",	do_mknod,
+	5,		5,
 
 
-	"mount",	"[-t type] devname dirname",
-	do_mount,	3,	MAXARGS,
+	"more",	"filename ...",		do_more,
+	2,		MAXARGS,
 
 
-	"mv",		"srcname ... destname",
-	do_mv,		3,	MAXARGS,
+	"mount",	"[-t type] devname dirname",	do_mount,
+	3,		MAXARGS,
 
 
-	"pid",		"",
-	do_pid,		1,	1,
+	"mv",		"srcname ... destname",	do_mv,
+	3,		MAXARGS,
 
 
-	"printenv",	"[name]",
-	do_printenv,	1,	2,
+	"printenv",	"[name]",		do_printenv,
+	1,		2,
 
 
-	"ps",		"",
-	do_ps,		1,	MAXARGS,
+	"pwd",		"",			do_pwd,
+	1,		1,
 
 
-	"pwd",		"",
-	do_pwd,		1,	1,
+	"pid",		"",			do_pid,
+	1,		1,
 
 
-	"quit",		"",
-	do_exit,	1,	1,
+	"quit",		"",			do_exit,
+	1,		1,
 
 
-	"rm",		"filename ...",
-	do_rm,		2,	MAXARGS,
+	"rm",		"filename ...",		do_rm,
+	2,		MAXARGS,
 
 
-	"rmdir",	"dirname ...",
-	do_rmdir,	2,	MAXARGS,
+	"rmdir",	"dirname ...",		do_rmdir,
+	2,		MAXARGS,
 
 
-	"setenv",	"name value",
-	do_setenv,	3,	3,
+	"setenv",	"name value",		do_setenv,
+	3,		3,
 
 
-	"sleep",	"seconds",
-	do_sleep,	1,	2,
+	"source",	"filename",		do_source,
+	2,		2,
 
 
-	"source",	"filename",
-	do_source,	2,	2,
+	"sync",	"",			do_sync,
+	1,		1,
 
 
-	"sync",		"",
-	do_sync,	1,	1,
+/*	"time",	"",			do_time,
+	1,		1,
+*/
+/*
+	"tar",		"[xtv]f devname filename ...",	do_tar,
+	2,		MAXARGS,
+*/
+	"touch",	"filename ...",		do_touch,
+	2,		MAXARGS,
 
 
-	"touch",	"filename ...",
-	do_touch,	2,	MAXARGS,
+	"umask",	"[mask]",		do_umask,
+	1,		2,
 
 
-	"umask",	"[mask]",
-	do_umask,	1,	2,
+	"umount",	"filename",		do_umount,
+	2,		2,
 
 
-	"umount",	"filename",
-	do_umount,	2,	2,
+/*
+	"unalias",	"name",			do_unalias,
+	2,		2,
+*/
+#ifdef CONFIG_USER_SASH_PS
+	"ps",		"",			do_ps,
+	1,		MAXARGS,
+#endif
+
+/*	"reboot",	"",			do_reboot,
+	1,		MAXARGS,
+*/
+	"cat",		"filename ...",		do_cat,
+	2,		MAXARGS,
+
+	"date",		"date [MMDDhhmm[YYYY]]",	do_date,
+	1,		2,
 
 
 	0,		0,			0,
 	0,		0,			0,
 	0,		0
 	0,		0
@@ -176,6 +217,11 @@ static	void	catchquit();
 static	void	catchchild();
 static	void	catchchild();
 static	void	readfile();
 static	void	readfile();
 static	void	command();
 static	void	command();
+#ifdef COMMAND_HISTORY
+#define do_command(c,h)	command(c,h)
+#else
+#define do_command(c,h)	command(c)
+#endif
 static	void	runcmd();
 static	void	runcmd();
 static	void	showprompt();
 static	void	showprompt();
 static	BOOL	trybuiltin();
 static	BOOL	trybuiltin();
@@ -184,6 +230,12 @@ static	ALIAS	*findalias();
 
 
 extern char ** environ;
 extern char ** environ;
 
 
+/* 
+char text1[] = "Text";
+char * text2 = text1;
+char ** text3 = &text2;
+*/
+
 char	buf[CMDLEN];
 char	buf[CMDLEN];
 int exit_code = 0;
 int exit_code = 0;
 
 
@@ -194,8 +246,9 @@ int main(argc, argv, env)
 {
 {
 	struct sigaction act;
 	struct sigaction act;
 	char	*cp;
 	char	*cp;
+/*	char	buf[PATHLEN];*/
 	int dofile = 0;
 	int dofile = 0;
-
+	
 	if ((argc > 1) && !strcmp(argv[1], "-c")) {
 	if ((argc > 1) && !strcmp(argv[1], "-c")) {
 		/* We are that fancy a shell */
 		/* We are that fancy a shell */
 		buf[0] = '\0';
 		buf[0] = '\0';
@@ -204,17 +257,18 @@ int main(argc, argv, env)
 			if (dofile + 1 < argc)
 			if (dofile + 1 < argc)
 				strncat(buf, " ", sizeof(buf));
 				strncat(buf, " ", sizeof(buf));
 		}
 		}
-		command(buf, FALSE);
+		do_command(buf, FALSE);
 		exit(exit_code);
 		exit(exit_code);
 	}
 	}
 
 
+	//;'pa990523 +
 	if ((argc > 1) && strcmp(argv[1], "-t"))
 	if ((argc > 1) && strcmp(argv[1], "-t"))
 		{
 		{
 		dofile++;
 		dofile++;
 		printf("Shell invoked to run file: %s\n",argv[1]);
 		printf("Shell invoked to run file: %s\n",argv[1]);
 		}
 		}
 	else
 	else
-		printf("\nSash command shell (OpenADK edition)\n");
+		printf("\nSash command shell (version %s)\n", version);
 	fflush(stdout);
 	fflush(stdout);
 
 
 	signal(SIGINT, catchint);
 	signal(SIGINT, catchint);
@@ -226,9 +280,29 @@ int main(argc, argv, env)
 	sigaction(SIGCHLD, &act, NULL);
 	sigaction(SIGCHLD, &act, NULL);
 
 
 	if (getenv("PATH") == NULL)
 	if (getenv("PATH") == NULL)
-		putenv("PATH=/bin:/usr/bin:/sbin:/usr/sbin");
+		putenv("PATH=/bin:/usr/bin:/etc:/sbin:/usr/sbin");
+
+/*	cp = getenv("HOME");
+	if (cp) {
+		strcpy(buf, cp);
+		strcat(buf, "/");
+		strcat(buf, ".aliasrc");
 
 
-	readfile(dofile ? argv[1] : NULL);
+		if ((access(buf, 0) == 0) || (errno != ENOENT))
+			readfile(buf);
+	}
+*/	
+	//;'pa990523 -1/+
+	//readfile(NULL);
+	if (dofile)
+		{
+		//open the file for reading!
+		readfile(argv[1]);
+		}
+	   else
+		{
+		readfile(NULL); //no arguments!
+		} //end if arguments supplied
 	exit(exit_code);
 	exit(exit_code);
 }
 }
 
 
@@ -265,6 +339,8 @@ readfile(name)
 
 
 	while (TRUE) {
 	while (TRUE) {
 		fflush(stdout);
 		fflush(stdout);
+		//;'pa990523 -1/+1
+		//if (1)
 		if (fp == stdin) //using terminal, so show prompt
 		if (fp == stdin) //using terminal, so show prompt
 			showprompt();
 			showprompt();
 
 
@@ -293,12 +369,13 @@ readfile(name)
 			ptr++;
 			ptr++;
 		}
 		}
 		if (*ptr != '#') {
 		if (*ptr != '#') {
+			//;'pa990523 +
 			if (fp != stdin) {
 			if (fp != stdin) {
 				//taking commands from file - echo
 				//taking commands from file - echo
 				printf("Command: %s\n",buf);
 				printf("Command: %s\n",buf);
 			} //end if (fp != stdin)
 			} //end if (fp != stdin)
 
 
-			command(buf, fp == stdin);
+			do_command(buf, fp == stdin);
 		}
 		}
 	}
 	}
 
 
@@ -311,10 +388,11 @@ readfile(name)
 	}
 	}
 
 
 	clearerr(fp);
 	clearerr(fp);
-	if (fp != stdin) {
+	if (fp != stdin)
+		{//;'pa990523 added braces and printf
 		fclose(fp);
 		fclose(fp);
 		printf("Execution Finished, Exiting\n");
 		printf("Execution Finished, Exiting\n");
-	}
+		} //end if (fp != stdin)
 
 
 	sourcecount--;
 	sourcecount--;
 }
 }
@@ -326,8 +404,12 @@ readfile(name)
  * command is an alias, and expands wildcards.
  * command is an alias, and expands wildcards.
  */
  */
 static void
 static void
+#ifdef COMMAND_HISTORY
 command(cmd, do_history)
 command(cmd, do_history)
 	int do_history;
 	int do_history;
+#else
+command(cmd)
+#endif
 	char	*cmd;
 	char	*cmd;
 {
 {
 	ALIAS	*alias;
 	ALIAS	*alias;
@@ -348,6 +430,7 @@ command(cmd, do_history)
 	while (isblank(*cmd))
 	while (isblank(*cmd))
 		cmd++;
 		cmd++;
 
 
+#ifdef COMMAND_HISTORY
 	if (do_history) {
 	if (do_history) {
 		int i;
 		int i;
 		static char *history[HISTORY_SIZE];
 		static char *history[HISTORY_SIZE];
@@ -381,6 +464,7 @@ command(cmd, do_history)
 			history[0] = strdup(cmd);
 			history[0] = strdup(cmd);
 		}
 		}
 	}
 	}
+#endif
 	if (c = strchr(cmd, '&')) {
 	if (c = strchr(cmd, '&')) {
 		*c = '\0';
 		*c = '\0';
 		bg = 1;
 		bg = 1;
@@ -389,7 +473,7 @@ command(cmd, do_history)
 
 
 	/* Set the last exit code */
 	/* Set the last exit code */
 	setenv("?", last_exit_code, 1);
 	setenv("?", last_exit_code, 1);
-
+	
 	if ((cmd = expandenvvar(cmd)) == NULL)
 	if ((cmd = expandenvvar(cmd)) == NULL)
 		return;
 		return;
 
 
@@ -426,18 +510,15 @@ command(cmd, do_history)
 			return;
 			return;
 		}
 		}
 	}
 	}
-
+		
 	/*
 	/*
 	 * Now look for the command in the builtin table, and execute
 	 * Now look for the command in the builtin table, and execute
 	 * the command if found.
 	 * the command if found.
 	 */
 	 */
-	if (!strcmp(argv[0], "builtin")) {
-		--argc;
-		++argv;
-		if (!*argv || !trybuiltin(argc, argv))
-			fprintf(stderr, "%s: %s\n", argv[-1], enoent_msg);
-		return;
-	} else if (!command_in_path(argv[0]) && trybuiltin(argc, argv))
+#ifdef FAVOUR_EXTERNAL_COMMANDS
+	if (!command_in_path(argv[0]))
+#endif
+	if (trybuiltin(argc, argv))
 		return;
 		return;
 
 
 	/*
 	/*
@@ -447,6 +528,7 @@ command(cmd, do_history)
 }
 }
 
 
 
 
+#ifdef FAVOUR_EXTERNAL_COMMANDS
 /*
 /*
  * return true if we find this command in our
  * return true if we find this command in our
  * path.
  * path.
@@ -459,7 +541,7 @@ command_in_path(char *cmd)
 	if (strchr(cmd, '/') == 0) {
 	if (strchr(cmd, '/') == 0) {
 		char	* path;
 		char	* path;
 		static char	path_copy[PATHLEN];
 		static char	path_copy[PATHLEN];
-
+		
 		/* Search path for binary */
 		/* Search path for binary */
 		for (path = getenv("PATH"); path && *path; ) {
 		for (path = getenv("PATH"); path && *path; ) {
 			char * p2;
 			char * p2;
@@ -468,14 +550,14 @@ command_in_path(char *cmd)
 			if (p2 = strchr(path_copy, ':')) {
 			if (p2 = strchr(path_copy, ':')) {
 				*p2 = '\0';
 				*p2 = '\0';
 			}
 			}
-
+		
 			if (strlen(path_copy))
 			if (strlen(path_copy))
 				strcat(path_copy, "/");
 				strcat(path_copy, "/");
 			strcat(path_copy, cmd);
 			strcat(path_copy, cmd);
-
+			
 			if (!stat(path_copy, &stat_buf) && (stat_buf.st_mode & 0111))
 			if (!stat(path_copy, &stat_buf) && (stat_buf.st_mode & 0111))
 				return(TRUE);
 				return(TRUE);
-
+			
 			p2 = strchr(path, ':');
 			p2 = strchr(path, ':');
 			if (p2)
 			if (p2)
 				path = p2 + 1;
 				path = p2 + 1;
@@ -486,6 +568,7 @@ command_in_path(char *cmd)
 		return(TRUE);
 		return(TRUE);
 	return(FALSE);
 	return(FALSE);
 }
 }
+#endif /* FAVOUR_EXTERNAL_COMMANDS */
 
 
 
 
 /*
 /*
@@ -513,7 +596,7 @@ trybuiltin(argc, argv)
 			return FALSE;
 			return FALSE;
 
 
 	} while (strcmp(argv[0], cmdptr->name));
 	} while (strcmp(argv[0], cmdptr->name));
-
+	
 	/*
 	/*
 	 * Give a usage string if the number of arguments is too large
 	 * Give a usage string if the number of arguments is too large
 	 * or too small.
 	 * or too small.
@@ -526,6 +609,17 @@ trybuiltin(argc, argv)
 		return TRUE;
 		return TRUE;
 	}
 	}
 
 
+	/*
+	 * Check here for several special commands which do not
+	 * have wildcarding done for them.
+	 */
+
+/*        if (cmdptr->func == do_prompt) {
+		(*cmdptr->func)(argc, argv);
+		return TRUE;
+	}
+*/
+
 	/*
 	/*
 	 * Now for each command argument, see if it is a wildcard, and if
 	 * Now for each command argument, see if it is a wildcard, and if
 	 * so, replace the argument with the list of matching filenames.
 	 * so, replace the argument with the list of matching filenames.
@@ -562,6 +656,7 @@ trybuiltin(argc, argv)
 	return TRUE;
 	return TRUE;
 }
 }
 
 
+
 /*
 /*
  * Execute the specified command.
  * Execute the specified command.
  */
  */
@@ -573,6 +668,7 @@ runcmd(cmd, bg, argc, argv)
 	char	**argv;
 	char	**argv;
 {
 {
 	register char *	cp;
 	register char *	cp;
+	BOOL		magic;
 	int		pid;
 	int		pid;
 	int		status;
 	int		status;
 	int oac;
 	int oac;
@@ -582,8 +678,40 @@ runcmd(cmd, bg, argc, argv)
 	char	*newargv[MAXARGS];
 	char	*newargv[MAXARGS];
 	char	*nametable[MAXARGS];
 	char	*nametable[MAXARGS];
 	struct sigaction act;
 	struct sigaction act;
-
+	
 	newargv[0] = argv[0];
 	newargv[0] = argv[0];
+	
+#ifdef INTERNAL_PATH_EXPANSION
+	if (strchr(argv[0], '/') == 0) {
+		char	* path;
+		struct stat	stat_buf;
+		static char	path_copy[PATHLEN];
+		
+		/* Search path for binary */
+		for (path = getenv("PATH"); path && *path; ) {
+			char * p2;
+			strncpy(path_copy, path, sizeof(path_copy - 1));
+			if (p2 = strchr(path_copy, ':')) {
+				*p2 = '\0';
+			}
+		
+			if (strlen(path_copy))
+				strncat(path_copy, "/", sizeof(path_copy));
+			strncat(path_copy, argv[0], sizeof(path_copy));
+			
+			if (!stat(path_copy, &stat_buf) && (stat_buf.st_mode & 0111)) {
+				newargv[0] = path_copy;
+				break;
+			}
+			
+			p2 = strchr(path, ':');
+			if (p2)
+				path = p2 + 1;
+			else
+				path = 0;
+		}
+	}
+#endif
 
 
 	/*
 	/*
 	 * Now for each command argument, see if it is a wildcard, and if
 	 * Now for each command argument, see if it is a wildcard, and if
@@ -614,51 +742,69 @@ runcmd(cmd, bg, argc, argv)
 		for (i = 0; i < matches; i++)
 		for (i = 0; i < matches; i++)
 			newargv[newargc++] = nametable[i];
 			newargv[newargc++] = nametable[i];
 	}
 	}
-
+	
 	newargv[newargc] = 0;
 	newargv[newargc] = 0;
 
 
+	magic = FALSE;
+	
+	/*
+	for (cp = cmd; *cp; cp++) {
+		if ((*cp >= 'a') && (*cp <= 'z'))
+			continue;
+		if ((*cp >= 'A') && (*cp <= 'Z'))
+			continue;	
+		if (isdecimal(*cp))
+			continue;
+		if (isblank(*cp))
+			continue;
+
+		if ((*cp == '.') || (*cp == '/') || (*cp == '-') ||
+			(*cp == '+') || (*cp == '=') || (*cp == '_') ||
+			(*cp == ':') || (*cp == ','))
+				continue;
+
+		magic = TRUE;
+	}
+	*/
+
+	if (magic) {
+		printf("%s: no such file or directory\n", cmd);
+		system(cmd);
+		return;
+	}
+	
 	if (!bg)
 	if (!bg)
 		signal(SIGCHLD, SIG_DFL);
 		signal(SIGCHLD, SIG_DFL);
 
 
 	/*
 	/*
-	 * Do the fork and exec ourselves.
-	 * If this fails with ENOEXEC, then run the
+	 * No magic characters in the expanded command, so do the fork and
+	 * exec ourself.  If this fails with ENOEXEC, then run the
 	 * shell anyway since it might be a shell script.
 	 * shell anyway since it might be a shell script.
 	 */
 	 */
 	if (!(pid = vfork())) {
 	if (!(pid = vfork())) {
 		int	ci;
 		int	ci;
-		char	errbuf[50];
 
 
 		/*
 		/*
 		 * We are the child, so run the program.
 		 * We are the child, so run the program.
 		 * First close any extra file descriptors we have opened.
 		 * First close any extra file descriptors we have opened.
 		 * be sure not to modify any globals after the vfork !
 		 * be sure not to modify any globals after the vfork !
-		 */
-
+		 */	
+		
 		for (ci = 0; ci < sourcecount; ci++)
 		for (ci = 0; ci < sourcecount; ci++)
 			if (sourcefiles[ci] != stdin)
 			if (sourcefiles[ci] != stdin)
 				close(fileno(sourcefiles[ci]));
 				close(fileno(sourcefiles[ci]));
-
+		
 		signal(SIGINT, SIG_DFL);
 		signal(SIGINT, SIG_DFL);
 		signal(SIGQUIT, SIG_DFL);
 		signal(SIGQUIT, SIG_DFL);
 		signal(SIGCHLD, SIG_DFL);
 		signal(SIGCHLD, SIG_DFL);
-
+		
 		execvp(newargv[0], newargv);
 		execvp(newargv[0], newargv);
 
 
-		ci = errno;
-		write(2, newargv[0], strlen(newargv[0]));
-		write(2, ": ", 2);
-		if (ci == ENOENT)
-			write(2, enoent_msg, sizeof(enoent_msg) - 1);
-		else if (strerror_r(ci, errbuf, sizeof(errbuf)))
-			write(2, unkerr_msg, sizeof(unkerr_msg) - 1);
-		else
-			write(2, errbuf, strlen(errbuf));
-		write(2, "\n", 1);
-
-		_exit(ci == ENOENT ? 127 : 126);
+		printf("%s: %s\n", newargv[0], (errno == ENOENT) ? "Bad command or file name" : strerror(errno));
+		
+		_exit(0);
 	}
 	}
-
+	
 	if (pid < 0) {
 	if (pid < 0) {
 		memset(&act, 0, sizeof(act));
 		memset(&act, 0, sizeof(act));
 		act.sa_handler = catchchild;
 		act.sa_handler = catchchild;
@@ -668,7 +814,7 @@ runcmd(cmd, bg, argc, argv)
 		perror("vfork failed");
 		perror("vfork failed");
 		return;
 		return;
 	}
 	}
-
+	
 	if (bg) {
 	if (bg) {
 		printf("[%d]\n", pid);
 		printf("[%d]\n", pid);
 		return;
 		return;
@@ -695,7 +841,7 @@ runcmd(cmd, bg, argc, argv)
 		memset(&act.sa_mask, 0, sizeof(act.sa_mask));
 		memset(&act.sa_mask, 0, sizeof(act.sa_mask));
 		act.sa_flags = SA_RESTART;
 		act.sa_flags = SA_RESTART;
 		sigaction(SIGCHLD, &act, NULL);
 		sigaction(SIGCHLD, &act, NULL);
-
+		
 		intcrlf = TRUE;
 		intcrlf = TRUE;
 
 
 		if (WIFEXITED(status)) {
 		if (WIFEXITED(status)) {
@@ -707,11 +853,12 @@ runcmd(cmd, bg, argc, argv)
 
 
 		return;
 		return;
 	}
 	}
-
+	
 	perror(argv[0]);
 	perror(argv[0]);
 	exit(1);
 	exit(1);
 }
 }
 
 
+#ifdef CMD_HELP
 void
 void
 do_help(argc, argv)
 do_help(argc, argv)
 	int	argc;
 	int	argc;
@@ -722,6 +869,94 @@ do_help(argc, argv)
 	for (cmdptr = cmdtab; cmdptr->name && cmdptr->name[0]; cmdptr++)
 	for (cmdptr = cmdtab; cmdptr->name && cmdptr->name[0]; cmdptr++)
 		printf("%-10s %s\n", cmdptr->name, cmdptr->usage);
 		printf("%-10s %s\n", cmdptr->name, cmdptr->usage);
 }
 }
+#endif /* CMD_HELP */
+
+#ifdef CMD_ALIAS
+void
+do_alias(argc, argv)
+	int	argc;
+	char	**argv;
+{
+	char	*name;
+	char	*value;
+	ALIAS	*alias;
+	int	count;
+	char	buf[CMDLEN];
+
+	if (argc < 2) {
+		count = aliascount;
+		for (alias = aliastable; count-- > 0; alias++)
+			printf("%s\t%s\n", alias->name, alias->value);
+		return;
+	}
+
+	name = argv[1];
+	if (argc == 2) {
+		alias = findalias(name);
+		if (alias)
+			printf("%s\n", alias->value);
+		else
+			fprintf(stderr, "Alias \"%s\" is not defined\n", name);
+		return;	
+	}
+
+	if (strcmp(name, "alias") == 0) {
+		fprintf(stderr, "Cannot alias \"alias\"\n");
+		return;
+	}
+
+	if (!makestring(argc - 2, argv + 2, buf, CMDLEN))
+		return;
+
+	value = malloc(strlen(buf) + 1);
+
+	if (value == NULL) {
+		fprintf(stderr, "No memory for alias value\n");
+		return;
+	}
+
+	strcpy(value, buf);
+
+	alias = findalias(name);
+	if (alias) {
+		free(alias->value);
+		alias->value = value;
+		return;
+	}
+
+	if ((aliascount % ALIASALLOC) == 0) {
+		count = aliascount + ALIASALLOC;
+
+		if (aliastable)
+			alias = (ALIAS *) realloc(aliastable,
+				sizeof(ALIAS *) * count);
+		else
+			alias = (ALIAS *) malloc(sizeof(ALIAS *) * count);
+
+		if (alias == NULL) {
+			free(value);
+			fprintf(stderr, "No memory for alias table\n");
+			return;
+		}
+
+		aliastable = alias;
+	}
+
+	alias = &aliastable[aliascount];
+
+	alias->name = malloc(strlen(name) + 1);
+
+	if (alias->name == NULL) {
+		free(value);
+		fprintf(stderr, "No memory for alias name\n");
+		return;
+	}
+
+	strcpy(alias->name, name);
+	alias->value = value;
+	aliascount++;
+}
+#endif /* CMD_ALIAS */
 
 
 /*
 /*
  * Look up an alias name, and return a pointer to it.
  * Look up an alias name, and return a pointer to it.
@@ -752,6 +987,20 @@ do_source(argc, argv)
 	readfile(argv[1]);
 	readfile(argv[1]);
 }
 }
 
 
+/*void
+do_cd(argc, argv)
+	int	argc;
+	char	**argv;
+{
+	char	*name;
+
+	name = argv[1];
+	
+	if (chdir(name))
+		perror("Unable to chdir to %s");
+	
+}*/
+
 void
 void
 do_pid(argc, argv)
 do_pid(argc, argv)
 	int	argc;
 	int	argc;
@@ -777,6 +1026,40 @@ do_exec(argc, argv)
 	exit(1);
 	exit(1);
 }
 }
 
 
+/*void
+do_exit(argc, argv)
+	int	argc;
+	char	**argv;
+{
+	if (argc>1)
+		exit(atoi(argv[1]));
+	else
+		exit(0);
+}*/
+
+
+#ifdef CMD_ALIAS
+void
+do_unalias(argc, argv)
+	int	argc;
+	char	**argv;
+{
+	ALIAS	*alias;
+
+	while (--argc > 0) {
+		alias = findalias(*++argv);
+		if (alias == NULL)
+			continue;
+
+		free(alias->name);
+		free(alias->value);
+		aliascount--;
+		alias->name = aliastable[aliascount].name;
+		alias->value = aliastable[aliascount].value;	
+	}
+}
+#endif /* CMD_ALIAS */
+
 /*
 /*
  * Display the prompt string.
  * Display the prompt string.
  */
  */
@@ -784,8 +1067,9 @@ static void
 showprompt()
 showprompt()
 {
 {
 	char	*cp;
 	char	*cp;
+	//;'pa990523 changed from 6...
 	char buf[60];
 	char buf[60];
-
+	
 	if ((cp = getenv("PS1")) != NULL) {
 	if ((cp = getenv("PS1")) != NULL) {
 		printf("%s", cp);
 		printf("%s", cp);
 	}
 	}
@@ -795,7 +1079,7 @@ showprompt()
 		printf("%s> ", buf);
 		printf("%s> ", buf);
 	}
 	}
 	fflush(stdout);
 	fflush(stdout);
-}
+}	
 
 
 
 
 static void
 static void
@@ -827,16 +1111,18 @@ catchchild()
 	char buf[40];
 	char buf[40];
 	pid_t pid;
 	pid_t pid;
 	int status;
 	int status;
+	
+	/*signal(SIGCHLD, catchchild);*/ /* Unneeded */
 
 
 	pid = wait4(-1, &status, WUNTRACED, 0);
 	pid = wait4(-1, &status, WUNTRACED, 0);
 	if (WIFSTOPPED(status))
 	if (WIFSTOPPED(status))
 		sprintf(buf, "sh %d: Child %d stopped\n", getpid(), pid);
 		sprintf(buf, "sh %d: Child %d stopped\n", getpid(), pid);
 	else
 	else
 		sprintf(buf, "sh %d: Child %d died\n", getpid(), pid);
 		sprintf(buf, "sh %d: Child %d died\n", getpid(), pid);
-
+	
 	if (intcrlf)
 	if (intcrlf)
 		write(STDOUT, "\n", 1);
 		write(STDOUT, "\n", 1);
-
+	
 	write(STDOUT, buf, strlen(buf));
 	write(STDOUT, buf, strlen(buf));
 }
 }
 
 

+ 9 - 7
package/sash/src/sash.h

@@ -12,14 +12,16 @@
 #include <malloc.h>
 #include <malloc.h>
 #include <ctype.h>
 #include <ctype.h>
 
 
-#define	PATHLEN		256
+#define	PATHLEN		256	
 #define	CMDLEN		1024
 #define	CMDLEN		1024
-#define	MAXARGS		50
+#define	MAXARGS		50	
 #define	ALIASALLOC	20
 #define	ALIASALLOC	20
 #define	STDIN		0
 #define	STDIN		0
 #define	STDOUT		1
 #define	STDOUT		1
 #define	MAXSOURCE	10
 #define	MAXSOURCE	10
+#ifdef COMMAND_HISTORY
 #define HISTORY_SIZE	20	/* Number of entries in command history */
 #define HISTORY_SIZE	20	/* Number of entries in command history */
+#endif
 
 
 #ifndef	isblank
 #ifndef	isblank
 #define	isblank(ch)	(((ch) == ' ') || ((ch) == '\t'))
 #define	isblank(ch)	(((ch) == ' ') || ((ch) == '\t'))
@@ -36,14 +38,14 @@ typedef	int	BOOL;
 #define	TRUE	((BOOL) 1)
 #define	TRUE	((BOOL) 1)
 
 
 
 
-extern	void	do_cd(), do_exec(), do_exit(), do_prompt();
-extern	void	do_source(), do_umask(), do_help(), do_ln();
+extern	void	do_alias(), do_cd(), do_exec(), do_exit(), do_prompt();
+extern	void	do_source(), do_umask(), do_unalias(), do_help(), do_ln();
 extern	void	do_cp(), do_mv(), do_rm(), do_chmod(), do_mkdir(), do_rmdir();
 extern	void	do_cp(), do_mv(), do_rm(), do_chmod(), do_mkdir(), do_rmdir();
 extern	void	do_mknod(), do_chown(), do_chgrp(), do_sync(), do_printenv();
 extern	void	do_mknod(), do_chown(), do_chgrp(), do_sync(), do_printenv();
-extern	void	do_more(), do_cmp(), do_touch(), do_ls();
+extern	void	do_more(), do_cmp(), do_touch(), do_ls(), do_dd(), do_tar();
 extern	void	do_mount(), do_umount(), do_setenv(), do_pwd(), do_echo();
 extern	void	do_mount(), do_umount(), do_setenv(), do_pwd(), do_echo();
-extern	void	do_kill(), do_hexdump(), do_pid();
-extern	void	do_df(), do_ps(), do_cat(), do_free();
+extern	void	do_kill(), do_grep(), do_ed(), do_hexdump(), do_pid();
+extern	void	do_df(), do_ps(), do_reboot(), do_cat(), do_time(), do_free();
 extern	void	do_hostname(), do_sleep();
 extern	void	do_hostname(), do_sleep();
 extern	void	do_date();
 extern	void	do_date();
 
 

+ 4 - 3
package/sash/src/shutdown.c

@@ -41,7 +41,7 @@ main(argc, argv)
 		printf("Usage: %s [-d delay] -h|-r now\n", progname);
 		printf("Usage: %s [-d delay] -h|-r now\n", progname);
 		exit(0);
 		exit(0);
 	}
 	}
-
+	
 	kill(1, SIGTSTP);
 	kill(1, SIGTSTP);
 	sync();
 	sync();
 	signal(SIGTERM,SIG_IGN);
 	signal(SIGTERM,SIG_IGN);
@@ -53,12 +53,13 @@ main(argc, argv)
 	kill(-1, SIGKILL);
 	kill(-1, SIGKILL);
 	sync();
 	sync();
 	sleep(1);
 	sleep(1);
-
+	
 	if (strcmp(argv[1], "-h")==0) {
 	if (strcmp(argv[1], "-h")==0) {
 		reboot(0xCDEF0123);
 		reboot(0xCDEF0123);
 	} else {
 	} else {
 		reboot(0x01234567);
 		reboot(0x01234567);
 	}
 	}
-
+	
 	exit(0); /* Shrug */
 	exit(0); /* Shrug */
 }
 }
+

+ 2 - 2
package/socat/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		socat
 PKG_NAME:=		socat
-PKG_VERSION:=		1.7.3.2
+PKG_VERSION:=		1.7.3.0
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		ce3efc17e3e544876ebce7cd6c85b3c279fda057b2857fcaaf67b9ab8bdaf034
+PKG_HASH:=		f8de4a2aaadb406a2e475d18cf3b9f29e322d4e5803d8106716a01fd4e64b186
 PKG_DESCR:=		multipurpose relay
 PKG_DESCR:=		multipurpose relay
 PKG_SECTION:=		net/misc
 PKG_SECTION:=		net/misc
 PKG_NEEDS:=		threads
 PKG_NEEDS:=		threads

+ 52 - 0
package/socat/patches/patch-sslcls_c

@@ -0,0 +1,52 @@
+--- socat-1.7.3.0.orig/sslcls.c	2015-01-24 11:15:22.000000000 +0100
++++ socat-1.7.3.0/sslcls.c	2015-12-29 20:56:25.000000000 +0100
+@@ -55,6 +55,7 @@ const SSL_METHOD *sycSSLv2_server_method
+ }
+ #endif
+ 
++#ifdef HAVE_SSLv3_client_method
+ const SSL_METHOD *sycSSLv3_client_method(void) {
+    const SSL_METHOD *result;
+    Debug("SSLv3_client_method()");
+@@ -62,7 +63,9 @@ const SSL_METHOD *sycSSLv3_client_method
+    Debug1("SSLv3_client_method() -> %p", result);
+    return result;
+ }
++#endif
+ 
++#ifdef HAVE_SSLv3_server_method
+ const SSL_METHOD *sycSSLv3_server_method(void) {
+    const SSL_METHOD *result;
+    Debug("SSLv3_server_method()");
+@@ -70,6 +73,7 @@ const SSL_METHOD *sycSSLv3_server_method
+    Debug1("SSLv3_server_method() -> %p", result);
+    return result;
+ }
++#endif
+ 
+ const SSL_METHOD *sycSSLv23_client_method(void) {
+    const SSL_METHOD *result;
+@@ -331,14 +335,6 @@ void sycSSL_free(SSL *ssl) {
+    return;
+ }
+ 
+-int sycRAND_egd(const char *path) {
+-   int result;
+-   Debug1("RAND_egd(\"%s\")", path);
+-   result = RAND_egd(path);
+-   Debug1("RAND_egd() -> %d", result);
+-   return result;
+-}
+-
+ DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) {
+    DH *result;
+    Debug4("PEM_read_bio_DHparams(%p, %p, %p, %p)",
+@@ -375,7 +371,7 @@ int sycFIPS_mode_set(int onoff) {
+ }
+ #endif /* WITH_FIPS */
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+ const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl) {
+    const COMP_METHOD *result;
+    Debug1("SSL_get_current_compression(%p)", ssl);

+ 11 - 0
package/socat/patches/patch-sslcls_h

@@ -0,0 +1,11 @@
+--- socat-1.7.3.0.orig/sslcls.h	2015-01-24 11:15:22.000000000 +0100
++++ socat-1.7.3.0/sslcls.h	2015-12-29 23:11:35.000000000 +0100
+@@ -55,7 +55,7 @@ BIO *sycBIO_new_file(const char *filenam
+ 
+ int sycFIPS_mode_set(int onoff);
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+ const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl);
+ const COMP_METHOD *sycSSL_get_current_expansion(SSL *ssl);
+ const char *sycSSL_COMP_get_name(const COMP_METHOD *comp);

+ 49 - 0
package/socat/patches/patch-xio-openssl_c

@@ -0,0 +1,49 @@
+--- socat-1.7.3.0.orig/xio-openssl.c	2015-01-24 15:33:42.000000000 +0100
++++ socat-1.7.3.0/xio-openssl.c	2015-12-29 23:38:49.000000000 +0100
+@@ -110,7 +110,7 @@ const struct optdesc opt_openssl_cafile
+ const struct optdesc opt_openssl_capath      = { "openssl-capath",     "capath", OPT_OPENSSL_CAPATH,      GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
+ const struct optdesc opt_openssl_egd         = { "openssl-egd",        "egd",    OPT_OPENSSL_EGD,         GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
+ const struct optdesc opt_openssl_pseudo      = { "openssl-pseudo",     "pseudo", OPT_OPENSSL_PSEUDO,      GROUP_OPENSSL, PH_SPEC, TYPE_BOOL,     OFUNC_SPEC };
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+ const struct optdesc opt_openssl_compress    = { "openssl-compress",   "compress", OPT_OPENSSL_COMPRESS,  GROUP_OPENSSL, PH_SPEC, TYPE_STRING,   OFUNC_SPEC };
+ #endif
+ #if WITH_FIPS
+@@ -147,7 +147,7 @@ int xio_reset_fips_mode(void) {
+ static void openssl_conn_loginfo(SSL *ssl) {
+    Notice1("SSL connection using %s", SSL_get_cipher(ssl));
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+    {
+       const COMP_METHOD *comp, *expansion;
+ 
+@@ -651,7 +651,7 @@ int _xioopen_openssl_listen(struct singl
+ #endif /* WITH_LISTEN */
+ 
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+ /* In OpenSSL 0.9.7 compression methods could be added using
+  * SSL_COMP_add_compression_method(3), but the implemntation is not compatible
+  * with the standard (RFC3749).
+@@ -743,7 +743,7 @@ int
+    retropt_string(opts, OPT_OPENSSL_DHPARAM, &opt_dhparam);
+    retropt_string(opts, OPT_OPENSSL_EGD, &opt_egd);
+    retropt_bool(opts,OPT_OPENSSL_PSEUDO, &opt_pseudo);
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+    retropt_string(opts, OPT_OPENSSL_COMPRESS, &opt_compress);
+ #endif
+ #if WITH_FIPS
+@@ -877,10 +877,6 @@ int
+       }
+    }
+ 
+-   if (opt_egd) {
+-      sycRAND_egd(opt_egd);
+-   }
+-
+    if (opt_pseudo) {
+       long int randdata;
+       /* initialize libc random from actual microseconds */

+ 20 - 0
package/socat/patches/patch-xioopts_c

@@ -0,0 +1,20 @@
+--- socat-1.7.3.0.orig/xioopts.c	2015-01-24 11:15:22.000000000 +0100
++++ socat-1.7.3.0/xioopts.c	2015-12-29 23:28:16.000000000 +0100
+@@ -296,7 +296,7 @@ const struct optname optionnames[] = {
+ #if WITH_EXT2 && defined(EXT2_COMPR_FL)
+ 	IF_ANY    ("compr",	&opt_ext2_compr)
+ #endif
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+ 	IF_OPENSSL("compress",	&opt_openssl_compress)
+ #endif
+ #ifdef TCP_CONN_ABORT_THRESHOLD  /* HP_UX */
+@@ -1098,7 +1098,7 @@ const struct optname optionnames[] = {
+ 	IF_OPENSSL("openssl-certificate",	&opt_openssl_certificate)
+ 	IF_OPENSSL("openssl-cipherlist",	&opt_openssl_cipherlist)
+ 	IF_OPENSSL("openssl-commonname",	&opt_openssl_commonname)
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if !defined(OPENSSL_NO_COMP)
+ 	IF_OPENSSL("openssl-compress",	&opt_openssl_compress)
+ #endif
+ 	IF_OPENSSL("openssl-dhparam",	&opt_openssl_dhparam)

+ 0 - 1
package/talloc/Makefile

@@ -13,7 +13,6 @@ PKG_BUILDDEP:=		python2-host python2
 PKG_URL:=		https://talloc.samba.org/talloc/doc/html/index.html
 PKG_URL:=		https://talloc.samba.org/talloc/doc/html/index.html
 PKG_SITES:=		https://www.samba.org/ftp/talloc/
 PKG_SITES:=		https://www.samba.org/ftp/talloc/
 PKG_LIBNAME:=		libtalloc
 PKG_LIBNAME:=		libtalloc
-PKG_OPTS:=		dev
 
 
 DISTFILES:=             $(PKG_NAME)-$(PKG_VERSION).tar.gz
 DISTFILES:=             $(PKG_NAME)-$(PKG_VERSION).tar.gz
 
 

+ 0 - 1
package/toybox/Makefile

@@ -23,7 +23,6 @@ CONFIG_STYLE:=		manual
 XAKE_FLAGS+=		CC="gcc" V=1 PREFIX="$(WRKINST)"
 XAKE_FLAGS+=		CC="gcc" V=1 PREFIX="$(WRKINST)"
 
 
 do-configure:
 do-configure:
-	-rm $(WRKBUILD)/toys/other/swap*.c
 	cd $(WRKBUILD); PATH='$(HOST_PATH)' $(MAKE) defconfig
 	cd $(WRKBUILD); PATH='$(HOST_PATH)' $(MAKE) defconfig
 
 
 toybox-install:
 toybox-install:

+ 2 - 4
package/wget/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 include ${ADK_TOPDIR}/rules.mk
 
 
 PKG_NAME:=		wget
 PKG_NAME:=		wget
-PKG_VERSION:=		1.19.2
+PKG_VERSION:=		1.19.1
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_HASH:=		4f4a673b6d466efa50fbfba796bd84a46ae24e370fa562ede5b21ab53c11a920
+PKG_HASH:=		9e4f12da38cc6167d0752d934abe27c7b1599a9af294e73829be7ac7b5b4da40
 PKG_DESCR:=		retrieving files using http(s) and ftp
 PKG_DESCR:=		retrieving files using http(s) and ftp
 PKG_SECTION:=		net/http
 PKG_SECTION:=		net/http
 HOST_BUILDDEP:=		libressl-host
 HOST_BUILDDEP:=		libressl-host
@@ -31,8 +31,6 @@ include ${ADK_TOPDIR}/mk/package.mk
 $(eval $(call HOST_template,WGET,wget,${PKG_VERSION}-${PKG_RELEASE}))
 $(eval $(call HOST_template,WGET,wget,${PKG_VERSION}-${PKG_RELEASE}))
 $(eval $(call PKG_template,WGET,wget,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 $(eval $(call PKG_template,WGET,wget,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 
 
-CONFIGURE_ARGS+=	--disable-pcre
-
 ifeq (${ADK_PACKAGE_WGET_WITHOUT_SSL},y)
 ifeq (${ADK_PACKAGE_WGET_WITHOUT_SSL},y)
 CONFIGURE_ARGS+=	--with-ssl=no
 CONFIGURE_ARGS+=	--with-ssl=no
 endif
 endif

+ 2 - 9
scripts/create-menu

@@ -12,18 +12,11 @@ printf "source target/config/Config.in.system.default\n" >> target/config/Config
 printf "source target/config/Config.in.system.choice\n" >> target/config/Config.in.system
 printf "source target/config/Config.in.system.choice\n" >> target/config/Config.in.system
 
 
 # update tasks
 # update tasks
-if [ -d "$topdir/tasks" -o -n "$ADK_CUSTOM_TASKS_DIR" ];then
+if [ -d "$topdir/tasks" ];then
 	printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.tasks
 	printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.tasks
 	printf "menu \"Tasks\"\n" >> $topdir/target/config/Config.in.tasks
 	printf "menu \"Tasks\"\n" >> $topdir/target/config/Config.in.tasks
 	printf "\tvisible if ADK_TARGET_OS_LINUX && !ADK_TARGET_CHOOSE_ARCH\n\n" >> $topdir/target/config/Config.in.tasks
 	printf "\tvisible if ADK_TARGET_OS_LINUX && !ADK_TARGET_CHOOSE_ARCH\n\n" >> $topdir/target/config/Config.in.tasks
-
-        if [ -d "$topdir/tasks" ];then
-        	cat $topdir/tasks/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
-        fi
-        if [ -n "$ADK_CUSTOM_TASKS_DIR" -a -d "$ADK_CUSTOM_TASKS_DIR" ];then
-        	printf "\n# tasks pulled from ADK_CUSTOM_TASKS_DIR='%s'\n" "$ADK_CUSTOM_TASKS_DIR" >> $topdir/target/config/Config.in.tasks
-        	cat $ADK_CUSTOM_TASKS_DIR/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
-        fi
+	cat $topdir/tasks/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
 	printf "\nendmenu\n\n" >> $topdir/target/config/Config.in.tasks
 	printf "\nendmenu\n\n" >> $topdir/target/config/Config.in.tasks
 fi
 fi
 
 

+ 14 - 49
scripts/install.sh

@@ -63,12 +63,10 @@ speed=115200
 panicreboot=10
 panicreboot=10
 keep=0
 keep=0
 grub=0
 grub=0
-paragon_ext=0
-datapartcontent=""
 
 
 function usage {
 function usage {
 cat >&2 <<EOF
 cat >&2 <<EOF
-Syntax: $me [-f filesystem] [-c cfgfssize] [-d datafssize] [-D datafscontent] [-k] [-n] [-g]
+Syntax: $me [-f filesystem] [-c cfgfssize] [-d datafssize] [-k] [-n] [-g]
     [-p panictime] [±q] [-s serialspeed] [±t] <target> <device> <archive>
     [-p panictime] [±q] [-s serialspeed] [±t] <target> <device> <archive>
 Partition sizes are in MiB. Filesystem type is currently ignored (ext4).
 Partition sizes are in MiB. Filesystem type is currently ignored (ext4).
 To keep filesystem on data partition use -k.
 To keep filesystem on data partition use -k.
@@ -77,7 +75,8 @@ Defaults: -c 1 -p 10 -s 115200; -t = enable serial console
 EOF
 EOF
 	exit $1
 	exit $1
 }
 }
-while getopts "c:d:D:ef:ghknp:qs:tx:" ch; do
+
+while getopts "c:d:f:ghknp:qs:t" ch; do
 	case $ch {
 	case $ch {
 	(c)	if (( (cfgfs = OPTARG) < 0 || cfgfs > 16 )); then
 	(c)	if (( (cfgfs = OPTARG) < 0 || cfgfs > 16 )); then
 			print -u2 "$me: -c $OPTARG out of bounds"
 			print -u2 "$me: -c $OPTARG out of bounds"
@@ -87,7 +86,6 @@ while getopts "c:d:D:ef:ghknp:qs:tx:" ch; do
 			print -u2 "$me: -d $OPTARG out of bounds"
 			print -u2 "$me: -d $OPTARG out of bounds"
 			exit 1
 			exit 1
 		fi ;;
 		fi ;;
-	(e)	paragon_ext=1 ;;
 	(f)	if [[ $OPTARG != @(ext2|ext3|ext4|xfs) ]]; then
 	(f)	if [[ $OPTARG != @(ext2|ext3|ext4|xfs) ]]; then
 			print -u2 "$me: filesystem $OPTARG invalid"
 			print -u2 "$me: filesystem $OPTARG invalid"
 			exit 1
 			exit 1
@@ -110,11 +108,6 @@ while getopts "c:d:D:ef:ghknp:qs:tx:" ch; do
 	(n)	noformat=1 ;;
 	(n)	noformat=1 ;;
 	(t)	serial=1 ;;
 	(t)	serial=1 ;;
 	(+t)	serial=0 ;;
 	(+t)	serial=0 ;;
-        (D)	if [[ ! -d $OPTARG ]]; then
-			print -u2 "$me: -D $OPTARG must be an existing directory"
-			exit 1
-		fi
-                datapartcontent=$OPTARG;;
 	(*)	usage 1 ;;
 	(*)	usage 1 ;;
 	}
 	}
 done
 done
@@ -129,10 +122,6 @@ case $ostype {
 	;;
 	;;
 (Darwin)
 (Darwin)
 	tools="bc diskutil"
 	tools="bc diskutil"
-	if [[ $paragon_ext == 0 ]]; then
-	    export PATH=/usr/local/opt/e2fsprogs/sbin:/usr/local/opt/e2fsprogs/bin:$PATH
-	    tools="$tools fuse-ext2 umount mkfs.ext4 tune2fs"
-	fi
 	;;
 	;;
 (*)
 (*)
 	print -u2 Sorry, not ported to the OS "'$ostype'" yet.
 	print -u2 Sorry, not ported to the OS "'$ostype'" yet.
@@ -172,9 +161,9 @@ fi
 
 
 case $ostype {
 case $ostype {
 (Darwin)
 (Darwin)
-	R=/Volumes/ADKROOT; diskutil unmount $R || umount $R
-	B=/Volumes/ADKBOOT; diskutil unmount $B || umount $B
-	D=/Volumes/ADKDATA; diskutil unmount $D || umount $D
+	R=/Volumes/ADKROOT; diskutil unmount $R
+	B=/Volumes/ADKBOOT; diskutil unmount $B
+	D=/Volumes/ADKDATA; diskutil unmount $D
 	basedev=$tgt
 	basedev=$tgt
 	rootpart=${basedev}s1
 	rootpart=${basedev}s1
 	datapart=${basedev}s2
 	datapart=${basedev}s2
@@ -185,38 +174,22 @@ case $ostype {
 	fi
 	fi
 	match=\'${basedev}\''?(s+([0-9]))'
 	match=\'${basedev}\''?(s+([0-9]))'
 	function mount_fs {
 	function mount_fs {
-	    if [[ $paragon_ext == 0 && $3 = ext4 ]]; then
-		mkdir -p $2
-		fuse-ext2 "$1" "$2" -o rw+
-	    fi
 	}
 	}
 	function umount_fs {
 	function umount_fs {
 		(( quiet )) || print "Unmounting filesystem on ${1}..."
 		(( quiet )) || print "Unmounting filesystem on ${1}..."
-	    if [[ $paragon_ext == 0 ]]; then
-		umount "$1" || diskutil unmount "$1" || true
-		rmdir $2 || true
-	    else
 		diskutil unmount "$1"
 		diskutil unmount "$1"
-	    fi
 	}
 	}
 	function create_fs {
 	function create_fs {
-		(( quiet )) || printf "Creating filesystem on ${1}"
-	    if [[ $paragon_ext == 0 && $3 = ext4 ]]; then
-			mkfs.ext4 -L "$2" "$1"
-	    else
-			if [[ $3 = ext4 ]]; then
-				fstype=UFSD_EXTFS4
-			fi
-			if [[ $3 = vfat ]]; then
-				fstype=fat32
-			fi
-			diskutil eraseVolume $fstype "$2" "$1"
-	    fi
+		(( quiet )) || print "Creating filesystem on ${2}..."
+		if [[ $3 = ext4 ]]; then
+			fstype=UFSD_EXTFS4
+		fi
+		if [[ $3 = vfat ]]; then
+			fstype=fat32
+		fi
+		diskutil eraseVolume $fstype "$2" "$1"
 	}
 	}
 	function tune_fs {
 	function tune_fs {
-	    if [[ $paragon_ext == 0 && $3 = ext4 ]]; then
-			tune2fs -c 0 -i 0 "$1"
-	    fi
 	}
 	}
 	;;
 	;;
 (Linux)
 (Linux)
@@ -582,14 +555,6 @@ if (( datafssz )); then
 		echo "/dev/mmcblk0p2	/data	ext4	rw	0	0" >> "$R"/etc/fstab
 		echo "/dev/mmcblk0p2	/data	ext4	rw	0	0" >> "$R"/etc/fstab
 	;;
 	;;
 	}
 	}
-        if [[ -d $datapartcontent ]]; then
-            mount_fs "$datapart" "$D" ext4
-            # strip trailing slash
-            case $datapartcontent in
-                *[!/]*/) datapartcontent=${datapartcontent%"${x##*[!/]}"};;
-            esac            
-            cp -R $datapartcontent/* "$D"
-        fi
 fi
 fi
 
 
 (( quiet )) || print Finishing up with bootloader and kernel ...
 (( quiet )) || print Finishing up with bootloader and kernel ...

+ 1 - 1
scripts/prereq.sh

@@ -225,7 +225,7 @@ printf " --->  checking if bash is installed.. "
 if which bash >/dev/null; then
 if which bash >/dev/null; then
   printf "found\n"
   printf "found\n"
   printf " --->  checking if it is bash 4.x.. "
   printf " --->  checking if it is bash 4.x.. "
-  bash --version 2>/dev/null| grep "GNU bash" | grep -i " 4." >/dev/null
+  bash --version 2>/dev/null| grep -i "Version 4" >/dev/null
   if [ $? -eq 0 ]; then
   if [ $? -eq 0 ]; then
     printf "yes\n"
     printf "yes\n"
   else
   else

+ 5 - 0
target/config/Config.in.binutils

@@ -3,6 +3,7 @@
 
 
 choice
 choice
 prompt "Binutils version"
 prompt "Binutils version"
+default ADK_TOOLCHAIN_BINUTILS_ARC if ADK_TARGET_ARCH_ARC
 default ADK_TOOLCHAIN_BINUTILS_CSKY if ADK_TARGET_ARCH_CSKY
 default ADK_TOOLCHAIN_BINUTILS_CSKY if ADK_TARGET_ARCH_CSKY
 default ADK_TOOLCHAIN_BINUTILS_NDS32 if ADK_TARGET_ARCH_NDS32
 default ADK_TOOLCHAIN_BINUTILS_NDS32 if ADK_TARGET_ARCH_NDS32
 default ADK_TOOLCHAIN_BINUTILS_2_20_1 if ADK_TARGET_ARCH_AVR32
 default ADK_TOOLCHAIN_BINUTILS_2_20_1 if ADK_TARGET_ARCH_AVR32
@@ -33,6 +34,10 @@ config ADK_TOOLCHAIN_BINUTILS_NDS32
 	bool "2.24-nds32"
 	bool "2.24-nds32"
 	depends on ADK_TARGET_ARCH_NDS32
 	depends on ADK_TARGET_ARCH_NDS32
 
 
+config ADK_TOOLCHAIN_BINUTILS_ARC
+	bool "arc-2016.09-release"
+	depends on ADK_TARGET_ARCH_ARC
+
 config ADK_TOOLCHAIN_BINUTILS_CSKY
 config ADK_TOOLCHAIN_BINUTILS_CSKY
 	bool "2.27-c-sky"
 	bool "2.27-c-sky"
 	depends on ADK_TARGET_ARCH_CSKY
 	depends on ADK_TARGET_ARCH_CSKY

+ 5 - 0
target/config/Config.in.compiler

@@ -16,6 +16,7 @@ endchoice
 choice
 choice
 prompt "GCC version"
 prompt "GCC version"
 depends on ADK_BUILD_COMPILER_GCC
 depends on ADK_BUILD_COMPILER_GCC
+default ADK_TOOLCHAIN_GCC_ARC if ADK_TARGET_ARCH_ARC
 default ADK_TOOLCHAIN_GCC_CSKY if ADK_TARGET_ARCH_CSKY
 default ADK_TOOLCHAIN_GCC_CSKY if ADK_TARGET_ARCH_CSKY
 default ADK_TOOLCHAIN_GCC_OR1K if ADK_TARGET_ARCH_OR1K
 default ADK_TOOLCHAIN_GCC_OR1K if ADK_TARGET_ARCH_OR1K
 default ADK_TOOLCHAIN_GCC_NDS32 if ADK_TARGET_ARCH_NDS32
 default ADK_TOOLCHAIN_GCC_NDS32 if ADK_TARGET_ARCH_NDS32
@@ -58,6 +59,10 @@ config ADK_TOOLCHAIN_GCC_NDS32
 	bool "4.9.4-nds32"
 	bool "4.9.4-nds32"
 	depends on ADK_TARGET_ARCH_NDS32
 	depends on ADK_TARGET_ARCH_NDS32
 
 
+config ADK_TOOLCHAIN_GCC_ARC
+	bool "arc-2016.09-release"
+	depends on ADK_TARGET_ARCH_ARC
+
 config ADK_TOOLCHAIN_GCC_4_4
 config ADK_TOOLCHAIN_GCC_4_4
 	bool "4.4.7"
 	bool "4.4.7"
 	depends on ADK_TARGET_ARCH_AVR32
 	depends on ADK_TARGET_ARCH_AVR32

+ 4 - 81
target/config/Config.in.cpu

@@ -489,14 +489,13 @@ config ADK_TARGET_CPU_CRIS_CRISV32
 	depends on ADK_TARGET_ARCH_CRIS
 	depends on ADK_TARGET_ARCH_CRIS
 
 
 # c-sky
 # c-sky
-config ADK_TARGET_CPU_CSKY_CK610
-	bool "ck610"
+config ADK_TARGET_CPU_CSKY_CK610F
+	bool "ck610f"
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_LT
 	select ADK_TARGET_SUPPORTS_LT
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
 	depends on ADK_TARGET_ARCH_CSKY
 	depends on ADK_TARGET_ARCH_CSKY
-	depends on ADK_TARGET_LITTLE_ENDIAN
 
 
 config ADK_TARGET_CPU_CSKY_CK810F
 config ADK_TARGET_CPU_CSKY_CK810F
 	bool "ck810f"
 	bool "ck810f"
@@ -505,7 +504,6 @@ config ADK_TARGET_CPU_CSKY_CK810F
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
 	depends on ADK_TARGET_ARCH_CSKY
 	depends on ADK_TARGET_ARCH_CSKY
-	depends on ADK_TARGET_LITTLE_ENDIAN
 
 
 config ADK_TARGET_CPU_CSKY_CK807F
 config ADK_TARGET_CPU_CSKY_CK807F
 	bool "ck807f"
 	bool "ck807f"
@@ -514,7 +512,6 @@ config ADK_TARGET_CPU_CSKY_CK807F
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
 	depends on ADK_TARGET_ARCH_CSKY
 	depends on ADK_TARGET_ARCH_CSKY
-	depends on ADK_TARGET_LITTLE_ENDIAN
 
 
 # epiphany
 # epiphany
 config ADK_TARGET_CPU_EPIPHANY
 config ADK_TARGET_CPU_EPIPHANY
@@ -1063,50 +1060,6 @@ config ADK_TARGET_CPU_PPC_7400
 	select ADK_TARGET_SUPPORTS_LT
 	select ADK_TARGET_SUPPORTS_LT
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
-	depends on ADK_TARGET_ARCH_PPC
-
-config ADK_TARGET_CPU_PPC_7450
-	bool "7450"
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_LT
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
-	depends on ADK_TARGET_ARCH_PPC
-
-config ADK_TARGET_CPU_PPC_750
-	bool "750"
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_LT
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
-	depends on ADK_TARGET_ARCH_PPC
-
-config ADK_TARGET_CPU_PPC_8540
-	bool "8540"
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_LT
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_SPE
-	depends on ADK_TARGET_ARCH_PPC
-
-config ADK_TARGET_CPU_PPC_8548
-	bool "8548"
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_LT
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_SPE
-	depends on ADK_TARGET_ARCH_PPC
-
-config ADK_TARGET_CPU_PPC_E500MC
-	bool "e500mc"
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_LT
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
 	depends on ADK_TARGET_ARCH_PPC
 	depends on ADK_TARGET_ARCH_PPC
 
 
 config ADK_TARGET_CPU_PPC_970
 config ADK_TARGET_CPU_PPC_970
@@ -1115,7 +1068,6 @@ config ADK_TARGET_CPU_PPC_970
 	select ADK_TARGET_SUPPORTS_LT
 	select ADK_TARGET_SUPPORTS_LT
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
 	depends on ADK_TARGET_ARCH_PPC
 	depends on ADK_TARGET_ARCH_PPC
 
 
 # ppc64
 # ppc64
@@ -1128,31 +1080,12 @@ config ADK_TARGET_CPU_PPC64_POWERPC64
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_BIG_ENDIAN
 	depends on ADK_TARGET_BIG_ENDIAN
 
 
-config ADK_TARGET_CPU_PPC64_POWER4
-	bool "power4"
-	select ADK_LINUX_64
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
-	depends on ADK_TARGET_ARCH_PPC64
-	depends on ADK_TARGET_BIG_ENDIAN
-
-config ADK_TARGET_CPU_PPC64_POWER5
-	bool "power5"
-	select ADK_LINUX_64
-	select ADK_TARGET_SUPPORTS_THREADS
-	select ADK_TARGET_SUPPORTS_NPTL
-	select ADK_TARGET_WITH_MMU
-	depends on ADK_TARGET_ARCH_PPC64
-	depends on ADK_TARGET_BIG_ENDIAN
-
 config ADK_TARGET_CPU_PPC64_POWER6
 config ADK_TARGET_CPU_PPC64_POWER6
 	bool "power6"
 	bool "power6"
 	select ADK_LINUX_64
 	select ADK_LINUX_64
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_BIG_ENDIAN
 	depends on ADK_TARGET_BIG_ENDIAN
 
 
@@ -1162,7 +1095,6 @@ config ADK_TARGET_CPU_PPC64_POWER7
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_BIG_ENDIAN
 	depends on ADK_TARGET_BIG_ENDIAN
 
 
@@ -1172,7 +1104,6 @@ config ADK_TARGET_CPU_PPC64_POWER8
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_SUPPORTS_NPTL
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
-	select ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
 	depends on ADK_TARGET_ARCH_PPC64
 	depends on ADK_TARGET_ARCH_PPC64
 
 
 # riscv 
 # riscv 
@@ -1875,9 +1806,6 @@ config ADK_TARGET_CPU_WITH_VT
 config ADK_TARGET_CPU_WITH_MTRR
 config ADK_TARGET_CPU_WITH_MTRR
 	bool
 	bool
 
 
-config ADK_TARGET_CPU_WITH_ALTIVEC
-	bool
-
 config ADK_TARGET_CPU_WITH_MMX
 config ADK_TARGET_CPU_WITH_MMX
 	bool
 	bool
 
 
@@ -1923,6 +1851,7 @@ config ADK_TARGET_CPU_WITH_3DNOWEXT
 # for gcc --with-cpu
 # for gcc --with-cpu
 config ADK_TARGET_GCC_CPU
 config ADK_TARGET_GCC_CPU
 	string
 	string
+	default "440" if ADK_TARGET_CPU_PPC_440
 	default "51" if ADK_TARGET_CPU_CF_51
 	default "51" if ADK_TARGET_CPU_CF_51
 	default "5206" if ADK_TARGET_CPU_CF_5206
 	default "5206" if ADK_TARGET_CPU_CF_5206
 	default "5206e" if ADK_TARGET_CPU_CF_5206E
 	default "5206e" if ADK_TARGET_CPU_CF_5206E
@@ -1978,8 +1907,6 @@ config ADK_TARGET_GCC_CPU
 	default "n13" if ADK_TARGET_CPU_NDS32
 	default "n13" if ADK_TARGET_CPU_NDS32
 	default "powerpc" if ADK_TARGET_CPU_PPC
 	default "powerpc" if ADK_TARGET_CPU_PPC
 	default "powerpc64" if ADK_TARGET_CPU_PPC64_POWERPC64
 	default "powerpc64" if ADK_TARGET_CPU_PPC64_POWERPC64
-	default "power4" if ADK_TARGET_CPU_PPC64_POWER4
-	default "power5" if ADK_TARGET_CPU_PPC64_POWER5
 	default "power6" if ADK_TARGET_CPU_PPC64_POWER6
 	default "power6" if ADK_TARGET_CPU_PPC64_POWER6
 	default "power7" if ADK_TARGET_CPU_PPC64_POWER7
 	default "power7" if ADK_TARGET_CPU_PPC64_POWER7
 	default "power8" if ADK_TARGET_CPU_PPC64_POWER8
 	default "power8" if ADK_TARGET_CPU_PPC64_POWER8
@@ -1988,11 +1915,7 @@ config ADK_TARGET_GCC_CPU
 	default "xscale" if ADK_TARGET_CPU_ARM_XSCALE
 	default "xscale" if ADK_TARGET_CPU_ARM_XSCALE
 	default "440" if ADK_TARGET_CPU_PPC_440
 	default "440" if ADK_TARGET_CPU_PPC_440
 	default "740" if ADK_TARGET_CPU_PPC_740
 	default "740" if ADK_TARGET_CPU_PPC_740
-	default "750" if ADK_TARGET_CPU_PPC_750
 	default "7400" if ADK_TARGET_CPU_PPC_7400
 	default "7400" if ADK_TARGET_CPU_PPC_7400
-	default "7450" if ADK_TARGET_CPU_PPC_7450
-	default "8540" if ADK_TARGET_CPU_PPC_8540
-	default "8548" if ADK_TARGET_CPU_PPC_8548
 	default "970" if ADK_TARGET_CPU_PPC_970
 	default "970" if ADK_TARGET_CPU_PPC_970
 
 
 # for gcc --with-arch
 # for gcc --with-arch
@@ -2080,7 +2003,7 @@ config ADK_TARGET_CPU_FLAGS
 	default "-mcpu=bf549m" if ADK_TARGET_CPU_BFIN_BF549M
 	default "-mcpu=bf549m" if ADK_TARGET_CPU_BFIN_BF549M
 	default "-mcpu=bf561" if ADK_TARGET_CPU_BFIN_BF561
 	default "-mcpu=bf561" if ADK_TARGET_CPU_BFIN_BF561
 	default "-mcpu=bf592" if ADK_TARGET_CPU_BFIN_BF592
 	default "-mcpu=bf592" if ADK_TARGET_CPU_BFIN_BF592
-	default "-mcpu=ck610" if ADK_TARGET_CPU_CSKY_CK610
+	default "-mcpu=ck610f" if ADK_TARGET_CPU_CSKY_CK610F
 	default "-mcpu=ck810f" if ADK_TARGET_CPU_CSKY_CK810F
 	default "-mcpu=ck810f" if ADK_TARGET_CPU_CSKY_CK810F
 	default "-mcpu=ck807f" if ADK_TARGET_CPU_CSKY_CK807F
 	default "-mcpu=ck807f" if ADK_TARGET_CPU_CSKY_CK807F
 	default "-mcpu=v10" if ADK_TARGET_CPU_CRIS_CRISV10
 	default "-mcpu=v10" if ADK_TARGET_CPU_CRIS_CRISV10

+ 0 - 1
target/config/Config.in.endian

@@ -6,7 +6,6 @@ prompt "Endianess"
 depends on ADK_TARGET_ARCH_ARC \
 depends on ADK_TARGET_ARCH_ARC \
 	|| ADK_TARGET_ARCH_AARCH64 \
 	|| ADK_TARGET_ARCH_AARCH64 \
 	|| ADK_TARGET_ARCH_ARM \
 	|| ADK_TARGET_ARCH_ARM \
-	|| ADK_TARGET_ARCH_CSKY \
 	|| ADK_TARGET_ARCH_C6X \
 	|| ADK_TARGET_ARCH_C6X \
 	|| ADK_TARGET_ARCH_MICROBLAZE \
 	|| ADK_TARGET_ARCH_MICROBLAZE \
 	|| ADK_TARGET_ARCH_MIPS \
 	|| ADK_TARGET_ARCH_MIPS \

+ 0 - 11
target/config/Config.in.fpu

@@ -1,17 +1,6 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 # material, please see the LICENCE file in the top-level directory.
 
 
-config ADK_TARGET_ARCH_PPC_WITH_SPE
-	bool
-	default n
-
-config ADK_TARGET_ARCH_PPC_WITH_ALTIVEC
-	bool "enable AltiVec SIMD support"
-	depends on ADK_TARGET_ARCH_PPC && ADK_TARGET_CPU_WITH_ALTIVEC
-	default n
-	help
-	  Enable support for AltiVec SIMD CPU extensions.
-
 config ADK_TARGET_ARCH_ARM_WITH_NEON
 config ADK_TARGET_ARCH_ARM_WITH_NEON
 	bool "enable NEON SIMD support"
 	bool "enable NEON SIMD support"
 	depends on ADK_TARGET_ARCH_ARM && ADK_TARGET_CPU_WITH_NEON
 	depends on ADK_TARGET_ARCH_ARM && ADK_TARGET_CPU_WITH_NEON

+ 3 - 3
target/config/Config.in.gdb

@@ -21,7 +21,7 @@ choice
 prompt "GNU debugger version"
 prompt "GNU debugger version"
 depends on ADK_TOOLCHAIN_WITH_GDB
 depends on ADK_TOOLCHAIN_WITH_GDB
 default ADK_TOOLCHAIN_GDB_H8300_GIT if ADK_TARGET_ARCH_H8300
 default ADK_TOOLCHAIN_GDB_H8300_GIT if ADK_TARGET_ARCH_H8300
-default ADK_TOOLCHAIN_GDB_8_0_1
+default ADK_TOOLCHAIN_GDB_8_0
 
 
 config ADK_TOOLCHAIN_GDB_GIT
 config ADK_TOOLCHAIN_GDB_GIT
 	bool "git"
 	bool "git"
@@ -33,8 +33,8 @@ config ADK_TOOLCHAIN_GDB_H8300_GIT
 	bool "h8300-git"
 	bool "h8300-git"
 	depends on ADK_TARGET_ARCH_H8300
 	depends on ADK_TARGET_ARCH_H8300
 
 
-config ADK_TOOLCHAIN_GDB_8_0_1
-	bool "8.0.1"
+config ADK_TOOLCHAIN_GDB_8_0
+	bool "8.0"
 	depends on !ADK_TARGET_ARCH_AVR32
 	depends on !ADK_TARGET_ARCH_AVR32
 	depends on !ADK_TARGET_ARCH_H8300
 	depends on !ADK_TARGET_ARCH_H8300
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NDS32

+ 32 - 13
target/config/Config.in.kernelversion

@@ -17,9 +17,7 @@ default ADK_TARGET_KERNEL_VERSION_GIT if ADK_TARGET_ARCH_RISCV64
 default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_ARCH_CRIS
 default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_ARCH_CRIS
 default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_ARCH_METAG
 default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_ARCH_METAG
 default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
 default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
-default ADK_TARGET_KERNEL_VERSION_4_4 if ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 default ADK_TARGET_KERNEL_VERSION_4_13 if ADK_TARGET_SYSTEM_ORANGE_PI0
 default ADK_TARGET_KERNEL_VERSION_4_13 if ADK_TARGET_SYSTEM_ORANGE_PI0
-default ADK_TARGET_KERNEL_VERSION_4_13 if ADK_TARGET_ARCH_OR1K
 default ADK_TARGET_KERNEL_VERSION_4_9
 default ADK_TARGET_KERNEL_VERSION_4_9
 
 
 config ADK_TARGET_KERNEL_VERSION_GIT
 config ADK_TARGET_KERNEL_VERSION_GIT
@@ -33,7 +31,7 @@ config ADK_TARGET_KERNEL_VERSION_GIT
 	select ADK_TARGET_KERNEL_IMAGE if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
 	select ADK_TARGET_KERNEL_IMAGE if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
 
 
 config ADK_TARGET_KERNEL_VERSION_4_13
 config ADK_TARGET_KERNEL_VERSION_4_13
-	bool "4.13.13"
+	bool "4.13.2"
 	depends on !ADK_TARGET_ARCH_AVR32
 	depends on !ADK_TARGET_ARCH_AVR32
 	depends on !ADK_TARGET_ARCH_CRIS
 	depends on !ADK_TARGET_ARCH_CRIS
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_CSKY
@@ -42,23 +40,20 @@ config ADK_TARGET_KERNEL_VERSION_4_13
 	depends on !ADK_TARGET_ARCH_RISCV32
 	depends on !ADK_TARGET_ARCH_RISCV32
 	depends on !ADK_TARGET_ARCH_RISCV64
 	depends on !ADK_TARGET_ARCH_RISCV64
 	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
 	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
-	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 
 
 config ADK_TARGET_KERNEL_VERSION_4_9
 config ADK_TARGET_KERNEL_VERSION_4_9
-	bool "4.9.60"
+	bool "4.9.50"
 	depends on !ADK_TARGET_ARCH_CRIS
 	depends on !ADK_TARGET_ARCH_CRIS
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_METAG
 	depends on !ADK_TARGET_ARCH_METAG
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NDS32
-	depends on !ADK_TARGET_ARCH_OR1K
 	depends on !ADK_TARGET_ARCH_RISCV32
 	depends on !ADK_TARGET_ARCH_RISCV32
 	depends on !ADK_TARGET_ARCH_RISCV64
 	depends on !ADK_TARGET_ARCH_RISCV64
 	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
 	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
-	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 
 
 config ADK_TARGET_KERNEL_VERSION_4_4
 config ADK_TARGET_KERNEL_VERSION_4_4
-	bool "4.4.96"
+	bool "4.4.88"
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NIOS2
 	depends on !ADK_TARGET_ARCH_NIOS2
@@ -71,7 +66,7 @@ config ADK_TARGET_KERNEL_VERSION_4_4
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 
 
 config ADK_TARGET_KERNEL_VERSION_4_1
 config ADK_TARGET_KERNEL_VERSION_4_1
-	bool "4.1.45"
+	bool "4.1.43"
 	depends on !ADK_TARGET_ARCH_ARC
 	depends on !ADK_TARGET_ARCH_ARC
 	depends on !ADK_TARGET_ARCH_BFIN
 	depends on !ADK_TARGET_ARCH_BFIN
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_CSKY
@@ -90,7 +85,7 @@ config ADK_TARGET_KERNEL_VERSION_4_1
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 
 
 config ADK_TARGET_KERNEL_VERSION_3_16
 config ADK_TARGET_KERNEL_VERSION_3_16
-	bool "3.16.49"
+	bool "3.16.48"
 	depends on !ADK_TARGET_ARCH_ARC
 	depends on !ADK_TARGET_ARCH_ARC
 	depends on !ADK_TARGET_ARCH_BFIN
 	depends on !ADK_TARGET_ARCH_BFIN
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_CSKY
@@ -138,13 +133,37 @@ config ADK_TARGET_KERNEL_VERSION_3_10
 	depends on !ADK_TARGET_CPU_MIPS64_MIPS64R6
 	depends on !ADK_TARGET_CPU_MIPS64_MIPS64R6
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
 
 
+config ADK_TARGET_KERNEL_VERSION_3_4
+	bool "3.4.113"
+	depends on !ADK_TARGET_ARCH_ARC
+	depends on !ADK_TARGET_ARCH_BFIN
+	depends on !ADK_TARGET_ARCH_CSKY
+	depends on !ADK_TARGET_ARCH_H8300
+	depends on !ADK_TARGET_ARCH_NDS32
+	depends on !ADK_TARGET_ARCH_NIOS2
+	depends on !ADK_TARGET_ARCH_OR1K
+	depends on !ADK_TARGET_ARCH_RISCV32
+	depends on !ADK_TARGET_ARCH_RISCV64
+	depends on !ADK_TARGET_ARCH_SPARC
+	depends on !ADK_TARGET_BOARD_ATH79
+	depends on !ADK_TARGET_BOARD_BCM28XX
+	depends on !ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
+	depends on !ADK_TARGET_SYSTEM_KINETIS_K70
+	depends on !ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
+	depends on !ADK_TARGET_SYSTEM_QEMU_M68K_MCF5208
+	depends on !ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
+	depends on !ADK_TARGET_SYSTEM_NUMATO_MIMASV2
+	depends on !ADK_TARGET_CPU_MIPS_MIPS32R6
+	depends on !ADK_TARGET_CPU_MIPS64_MIPS64R6
+	depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
+
 config ADK_TARGET_KERNEL_VERSION_3_10_NDS32
 config ADK_TARGET_KERNEL_VERSION_3_10_NDS32
 	bool "3.10-nds32"
 	bool "3.10-nds32"
 	depends on ADK_TARGET_ARCH_NDS32
 	depends on ADK_TARGET_ARCH_NDS32
 	select ADK_TARGET_KERNEL_NO_MIRROR
 	select ADK_TARGET_KERNEL_NO_MIRROR
 
 
 config ADK_TARGET_KERNEL_VERSION_3_2
 config ADK_TARGET_KERNEL_VERSION_3_2
-	bool "3.2.94"
+	bool "3.2.93"
 	depends on !ADK_TARGET_ARCH_ARC
 	depends on !ADK_TARGET_ARCH_ARC
 	depends on !ADK_TARGET_ARCH_BFIN
 	depends on !ADK_TARGET_ARCH_BFIN
 	depends on !ADK_TARGET_ARCH_CSKY
 	depends on !ADK_TARGET_ARCH_CSKY
@@ -227,7 +246,7 @@ config ADK_TARGET_KERNEL_GIT_REPO_NAME
 config ADK_TARGET_KERNEL_GIT
 config ADK_TARGET_KERNEL_GIT
 	string "git version"
 	string "git version"
 	depends on ADK_TARGET_KERNEL_VERSION_GIT
 	depends on ADK_TARGET_KERNEL_VERSION_GIT
-	default "6064a9bdf48cefbccc4f6472dd04251f0dec1931" if ADK_TARGET_ARCH_CSKY
+	default "314c498ddc8c43a66ca96ff3af7da98e10fa1cc6" if ADK_TARGET_ARCH_CSKY
 	default "6a2f2e4198eaff63ee75f6085ce9f966c47b4441" if ADK_TARGET_ARCH_LM32
 	default "6a2f2e4198eaff63ee75f6085ce9f966c47b4441" if ADK_TARGET_ARCH_LM32
 	default "1cd2e072bbd1a518e11b551435be0ad84a2c52af" if ADK_TARGET_ARCH_RISCV32 || ADK_TARGET_ARCH_RISCV64
 	default "1cd2e072bbd1a518e11b551435be0ad84a2c52af" if ADK_TARGET_ARCH_RISCV32 || ADK_TARGET_ARCH_RISCV64
 	default "cfa29b46af94d83e31aa000dbaee553f9c4d670c" if ADK_TARGET_BOARD_BCM28XX
 	default "cfa29b46af94d83e31aa000dbaee553f9c4d670c" if ADK_TARGET_BOARD_BCM28XX
@@ -241,7 +260,7 @@ config ADK_TARGET_KERNEL_GIT
 config ADK_TARGET_KERNEL_GIT_VER
 config ADK_TARGET_KERNEL_GIT_VER
 	string "kernel version"
 	string "kernel version"
 	depends on ADK_TARGET_KERNEL_VERSION_GIT
 	depends on ADK_TARGET_KERNEL_VERSION_GIT
-	default "4.9.56" if ADK_TARGET_ARCH_CSKY
+	default "4.9.13" if ADK_TARGET_ARCH_CSKY
 	default "4.9.37" if ADK_TARGET_BOARD_BCM28XX
 	default "4.9.37" if ADK_TARGET_BOARD_BCM28XX
 	default "4.4.37" if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
 	default "4.4.37" if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
 	default "4.4.52" if ADK_TARGET_SYSTEM_PHYTEC_WEGA
 	default "4.4.52" if ADK_TARGET_SYSTEM_PHYTEC_WEGA

+ 6 - 8
target/config/Config.in.libc

@@ -136,8 +136,8 @@ endchoice
 choice
 choice
 prompt "C library version"
 prompt "C library version"
 
 
-config ADK_TARGET_LIB_UCLIBC_NG_1_0_27
-	bool "1.0.27"
+config ADK_TARGET_LIB_UCLIBC_NG_1_0_26
+	bool "1.0.26"
 	depends on ADK_TARGET_LIB_UCLIBC_NG
 	depends on ADK_TARGET_LIB_UCLIBC_NG
 
 
 config ADK_TARGET_LIB_UCLIBC_NG_GIT
 config ADK_TARGET_LIB_UCLIBC_NG_GIT
@@ -156,8 +156,8 @@ config ADK_TARGET_LIB_GLIBC_GIT
 	bool "git"
 	bool "git"
 	depends on ADK_TARGET_LIB_GLIBC && !ADK_TARGET_ARCH_RISCV32 && !ADK_TARGET_ARCH_RISCV64
 	depends on ADK_TARGET_LIB_GLIBC && !ADK_TARGET_ARCH_RISCV32 && !ADK_TARGET_ARCH_RISCV64
 
 
-config ADK_TARGET_LIB_MUSL_1_1_18
-	bool "1.1.18"
+config ADK_TARGET_LIB_MUSL_1_1_17
+	bool "1.1.17"
 	depends on ADK_TARGET_LIB_MUSL
 	depends on ADK_TARGET_LIB_MUSL
 
 
 config ADK_TARGET_LIB_MUSL_GIT
 config ADK_TARGET_LIB_MUSL_GIT
@@ -224,8 +224,8 @@ config ADK_TARGET_LIBC
 
 
 config ADK_LIBC_VERSION
 config ADK_LIBC_VERSION
 	string
 	string
-	default "1.0.27" if ADK_TARGET_LIB_UCLIBC_NG_1_0_27
-	default "1.1.18" if ADK_TARGET_LIB_MUSL_1_1_18
+	default "1.0.26" if ADK_TARGET_LIB_UCLIBC_NG_1_0_26
+	default "1.1.17" if ADK_TARGET_LIB_MUSL_1_1_17
 	default "2.26" if ADK_TARGET_LIB_GLIBC_2_26
 	default "2.26" if ADK_TARGET_LIB_GLIBC_2_26
 	default "2.4.0" if ADK_TARGET_LIB_NEWLIB_2_4_0
 	default "2.4.0" if ADK_TARGET_LIB_NEWLIB_2_4_0
 	default "2.4.0-riscv" if ADK_TARGET_LIB_NEWLIB_RISCV
 	default "2.4.0-riscv" if ADK_TARGET_LIB_NEWLIB_RISCV
@@ -243,7 +243,6 @@ config ADK_TARGET_SUFFIX
 	default "gnuabi32" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ABI_O64
 	default "gnuabi32" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ABI_O64
 	default "gnu32" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ABI_32 && ADK_LINUX_64
 	default "gnu32" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ABI_32 && ADK_LINUX_64
 	default "gnux32" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ABI_X32 && ADK_LINUX_64
 	default "gnux32" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ABI_X32 && ADK_LINUX_64
-	default "gnuspe" if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ARCH_PPC && ADK_TARGET_ARCH_PPC_WITH_SPE
 	default "gnu" if ADK_TARGET_LIB_GLIBC
 	default "gnu" if ADK_TARGET_LIB_GLIBC
 	default "uclibceabihf" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ARCH_ARM && ADK_TARGET_HARD_FLOAT
 	default "uclibceabihf" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ARCH_ARM && ADK_TARGET_HARD_FLOAT
 	default "uclibceabi" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ARCH_ARM
 	default "uclibceabi" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ARCH_ARM
@@ -252,7 +251,6 @@ config ADK_TARGET_SUFFIX
 	default "uclibcabin32" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ABI_N32
 	default "uclibcabin32" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ABI_N32
 	default "uclibcabi32" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ABI_O32
 	default "uclibcabi32" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ABI_O32
 	default "uclibc32" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ABI_32 && ADK_LINUX_64
 	default "uclibc32" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ABI_32 && ADK_LINUX_64
-	default "uclibcspe" if ADK_TARGET_LIB_UCLIBC_NG && ADK_TARGET_ARCH_PPC && ADK_TARGET_ARCH_PPC_WITH_SPE
 	default "uclibc" if ADK_TARGET_LIB_UCLIBC_NG
 	default "uclibc" if ADK_TARGET_LIB_UCLIBC_NG
 	default "musleabihf" if ADK_TARGET_LIB_MUSL && ADK_TARGET_ARCH_ARM && ADK_TARGET_HARD_FLOAT
 	default "musleabihf" if ADK_TARGET_LIB_MUSL && ADK_TARGET_ARCH_ARM && ADK_TARGET_HARD_FLOAT
 	default "musleabi" if ADK_TARGET_LIB_MUSL && ADK_TARGET_ARCH_ARM
 	default "musleabi" if ADK_TARGET_LIB_MUSL && ADK_TARGET_ARCH_ARM

+ 1 - 2
target/config/Config.in.rootfs

@@ -115,8 +115,7 @@ config ADK_TARGET_ROOTFS_USB
 	select ADK_KERNEL_USB_UHCI_HCD
 	select ADK_KERNEL_USB_UHCI_HCD
 	select ADK_KERNEL_USB_STORAGE
 	select ADK_KERNEL_USB_STORAGE
 	select ADK_PACKAGE_ADKINSTALL
 	select ADK_PACKAGE_ADKINSTALL
-	depends on ADK_TARGET_WITH_USB_BOOT \
-		|| ADK_TARGET_GENERIC
+	depends on ADK_TARGET_WITH_USB_BOOT
 	help
 	help
 	  Boot system from USB stick. 
 	  Boot system from USB stick. 
 
 

+ 1 - 1
target/config/Config.in.toolchain

@@ -36,7 +36,7 @@ config ADK_TARGET_LIBC_WITH_LIBINTL
 
 
 config ADK_TARGET_LIBC_WITH_LIBICONV
 config ADK_TARGET_LIBC_WITH_LIBICONV
 	bool "Enable basic libiconv"
 	bool "Enable basic libiconv"
-	depends on ADK_TARGET_LIB_UCLIBC_NG && !ADK_PACKAGE_LIBICONV
+	depends on ADK_TARGET_LIB_UCLIBC_NG
 	help
 	help
 	  Enables uClibc-ng included basic libiconv support.
 	  Enables uClibc-ng included basic libiconv support.
 
 

+ 4094 - 0
target/cris/qemu-cris/patches/4.1.35/crisv32_ethernet_driver.patch

@@ -0,0 +1,4094 @@
+diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
+index e6c523c..5737a5b 100644
+--- a/arch/cris/arch-v32/drivers/Kconfig
++++ b/arch/cris/arch-v32/drivers/Kconfig
+@@ -8,9 +8,18 @@ config ETRAX_ETHERNET
+ 	  This option enables the ETRAX FS built-in 10/100Mbit Ethernet
+ 	  controller.
+ 
++config ETRAX_HAVE_PHY
++        bool "PHY present"
++	default y
++        help
++          Search and use the first PHY available on the MDIO bus. Fail
++          if none is found. Say Y here if you are not in a switched
++          environment (single port device).
++
+ config ETRAX_NO_PHY
+ 	bool "PHY not present"
+ 	depends on ETRAX_ETHERNET
++	default n
+ 	help
+ 	  This option disables all MDIO communication with an ethernet
+ 	  transceiver connected to the MII interface. This option shall
+@@ -18,6 +27,70 @@ config ETRAX_NO_PHY
+ 	  switch. This option should normally be disabled. If enabled,
+ 	  speed and duplex will be locked to 100 Mbit and full duplex.
+ 
++config ETRAX_PHY_FALLBACK
++        bool "Fixed PHY fallback"
++        depends on ETRAX_ETHERNET
++	default n
++        help
++          If no PHY is found on the MDIO bus, fall back on a fixed
++          100/Full fixed PHY. Say Y here if you need dynamic PHY
++          presence detection (switch connection where some but not
++          all ports have integrated PHYs), otherwise say N.
++
++config ETRAX_ETHERNET_IFACE0
++        depends on ETRAX_ETHERNET
++        bool "Enable network interface 0"
++
++config ETRAX_ETHERNET_IFACE1
++        depends on (ETRAX_ETHERNET && ETRAXFS)
++        bool "Enable network interface 1 (uses DMA6 and DMA7)"
++
++choice
++        prompt "Eth0 led group"
++        depends on ETRAX_ETHERNET_IFACE0
++        default ETRAX_ETH0_USE_LEDGRP0
++
++config ETRAX_ETH0_USE_LEDGRP0
++        bool "Use LED grp 0"
++        depends on ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO
++        help
++          Use LED grp 0 for eth0
++
++config ETRAX_ETH0_USE_LEDGRP1
++        bool "Use LED grp 1"
++        depends on ETRAX_NBR_LED_GRP_TWO
++        help
++          Use LED grp 1 for eth0
++
++config ETRAX_ETH0_USE_LEDGRPNULL
++        bool "Use no LEDs for eth0"
++        help
++          Use no LEDs for eth0
++endchoice
++
++choice
++        prompt "Eth1 led group"
++        depends on ETRAX_ETHERNET_IFACE1
++        default ETRAX_ETH1_USE_LEDGRP1
++
++config ETRAX_ETH1_USE_LEDGRP0
++        bool "Use LED grp 0"
++        depends on ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO
++        help
++          Use LED grp 0 for eth1
++
++config ETRAX_ETH1_USE_LEDGRP1
++        bool "Use LED grp 1"
++        depends on ETRAX_NBR_LED_GRP_TWO
++        help
++          Use LED grp 1 for eth1
++
++config ETRAX_ETH1_USE_LEDGRPNULL
++        bool "Use no LEDs for eth1"
++        help
++          Use no LEDs for eth1
++endchoice
++
+ config ETRAXFS_SERIAL
+ 	bool "Serial-port support"
+ 	depends on ETRAX_ARCH_V32
+diff --git a/arch/cris/include/arch-v32/arch/hwregs/eth_defs.h b/arch/cris/include/arch-v32/arch/hwregs/eth_defs.h
+index 90fe8a2..37bec9a 100644
+--- a/arch/cris/include/arch-v32/arch/hwregs/eth_defs.h
++++ b/arch/cris/include/arch-v32/arch/hwregs/eth_defs.h
+@@ -2,69 +2,64 @@
+ #define __eth_defs_h
+ 
+ /*
+- * This file is autogenerated from
+- *   file:           eth.r
+- *     id:           eth_regs.r,v 1.16 2005/05/20 15:41:22 perz Exp
+- *     last modfied: Mon Jan  9 06:06:41 2006
+- *
+- *   by /n/asic/design/tools/rdesc/rdes2c eth.r
+- *      id: $Id: eth_defs.h,v 1.7 2006/01/26 13:45:30 karljope Exp $
+- * Any changes here will be lost.
+- *
+- * -*- buffer-read-only: t -*-
++ * Note: Previously this was autogenerated code from the hardware
++ * implementation. However, to enable the same file to be used
++ * for both ARTPEC-3 and ETRAX FS this file is now hand-edited.
++ * Be careful.
+  */
++
+ /* Main access macros */
+ #ifndef REG_RD
+ #define REG_RD( scope, inst, reg ) \
+-  REG_READ( reg_##scope##_##reg, \
+-            (inst) + REG_RD_ADDR_##scope##_##reg )
++	REG_READ( reg_##scope##_##reg, \
++			(inst) + REG_RD_ADDR_##scope##_##reg )
+ #endif
+ 
+ #ifndef REG_WR
+ #define REG_WR( scope, inst, reg, val ) \
+-  REG_WRITE( reg_##scope##_##reg, \
+-             (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
++	REG_WRITE( reg_##scope##_##reg, \
++			(inst) + REG_WR_ADDR_##scope##_##reg, (val) )
+ #endif
+ 
+ #ifndef REG_RD_VECT
+ #define REG_RD_VECT( scope, inst, reg, index ) \
+-  REG_READ( reg_##scope##_##reg, \
+-            (inst) + REG_RD_ADDR_##scope##_##reg + \
+-	    (index) * STRIDE_##scope##_##reg )
++	REG_READ( reg_##scope##_##reg, \
++			(inst) + REG_RD_ADDR_##scope##_##reg + \
++			(index) * STRIDE_##scope##_##reg )
+ #endif
+ 
+ #ifndef REG_WR_VECT
+ #define REG_WR_VECT( scope, inst, reg, index, val ) \
+-  REG_WRITE( reg_##scope##_##reg, \
+-             (inst) + REG_WR_ADDR_##scope##_##reg + \
+-	     (index) * STRIDE_##scope##_##reg, (val) )
++	REG_WRITE( reg_##scope##_##reg, \
++			(inst) + REG_WR_ADDR_##scope##_##reg + \
++			(index) * STRIDE_##scope##_##reg, (val) )
+ #endif
+ 
+ #ifndef REG_RD_INT
+ #define REG_RD_INT( scope, inst, reg ) \
+-  REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
++	REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
+ #endif
+ 
+ #ifndef REG_WR_INT
+ #define REG_WR_INT( scope, inst, reg, val ) \
+-  REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
++	REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
+ #endif
+ 
+ #ifndef REG_RD_INT_VECT
+ #define REG_RD_INT_VECT( scope, inst, reg, index ) \
+-  REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
+-	    (index) * STRIDE_##scope##_##reg )
++	REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
++			(index) * STRIDE_##scope##_##reg )
+ #endif
+ 
+ #ifndef REG_WR_INT_VECT
+ #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
+-  REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
+-	     (index) * STRIDE_##scope##_##reg, (val) )
++	REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
++			(index) * STRIDE_##scope##_##reg, (val) )
+ #endif
+ 
+ #ifndef REG_TYPE_CONV
+ #define REG_TYPE_CONV( type, orgtype, val ) \
+-  ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
++	( { union { orgtype o; type n; } r; r.o = val; r.n; } )
+ #endif
+ 
+ #ifndef reg_page_size
+@@ -73,306 +68,332 @@
+ 
+ #ifndef REG_ADDR
+ #define REG_ADDR( scope, inst, reg ) \
+-  ( (inst) + REG_RD_ADDR_##scope##_##reg )
++	( (inst) + REG_RD_ADDR_##scope##_##reg )
+ #endif
+ 
+ #ifndef REG_ADDR_VECT
+ #define REG_ADDR_VECT( scope, inst, reg, index ) \
+-  ( (inst) + REG_RD_ADDR_##scope##_##reg + \
+-    (index) * STRIDE_##scope##_##reg )
++	( (inst) + REG_RD_ADDR_##scope##_##reg + \
++	  (index) * STRIDE_##scope##_##reg )
+ #endif
+ 
+ /* C-code for register scope eth */
+ 
+ /* Register rw_ma0_lo, scope eth, type rw */
+ typedef struct {
+-  unsigned int addr : 32;
++	unsigned int addr : 32;
+ } reg_eth_rw_ma0_lo;
+ #define REG_RD_ADDR_eth_rw_ma0_lo 0
+ #define REG_WR_ADDR_eth_rw_ma0_lo 0
+ 
+ /* Register rw_ma0_hi, scope eth, type rw */
+ typedef struct {
+-  unsigned int addr : 16;
+-  unsigned int dummy1 : 16;
++	unsigned int addr : 16;
++	unsigned int dummy1 : 16;
+ } reg_eth_rw_ma0_hi;
+ #define REG_RD_ADDR_eth_rw_ma0_hi 4
+ #define REG_WR_ADDR_eth_rw_ma0_hi 4
+ 
+ /* Register rw_ma1_lo, scope eth, type rw */
+ typedef struct {
+-  unsigned int addr : 32;
++	unsigned int addr : 32;
+ } reg_eth_rw_ma1_lo;
+ #define REG_RD_ADDR_eth_rw_ma1_lo 8
+ #define REG_WR_ADDR_eth_rw_ma1_lo 8
+ 
+ /* Register rw_ma1_hi, scope eth, type rw */
+ typedef struct {
+-  unsigned int addr : 16;
+-  unsigned int dummy1 : 16;
++	unsigned int addr : 16;
++	unsigned int dummy1 : 16;
+ } reg_eth_rw_ma1_hi;
+ #define REG_RD_ADDR_eth_rw_ma1_hi 12
+ #define REG_WR_ADDR_eth_rw_ma1_hi 12
+ 
+ /* Register rw_ga_lo, scope eth, type rw */
+ typedef struct {
+-  unsigned int tbl : 32;
++	unsigned int table : 32;
+ } reg_eth_rw_ga_lo;
+ #define REG_RD_ADDR_eth_rw_ga_lo 16
+ #define REG_WR_ADDR_eth_rw_ga_lo 16
+ 
+ /* Register rw_ga_hi, scope eth, type rw */
+ typedef struct {
+-  unsigned int tbl : 32;
++	unsigned int table : 32;
+ } reg_eth_rw_ga_hi;
+ #define REG_RD_ADDR_eth_rw_ga_hi 20
+ #define REG_WR_ADDR_eth_rw_ga_hi 20
+ 
+ /* Register rw_gen_ctrl, scope eth, type rw */
+ typedef struct {
+-  unsigned int en         : 1;
+-  unsigned int phy        : 2;
+-  unsigned int protocol   : 1;
+-  unsigned int loopback   : 1;
+-  unsigned int flow_ctrl  : 1;
+-  unsigned int gtxclk_out : 1;
+-  unsigned int phyrst_n   : 1;
+-  unsigned int dummy1     : 24;
++	unsigned int en         : 1;
++	unsigned int phy        : 2;
++	unsigned int protocol   : 1;
++	unsigned int loopback   : 1;
++	unsigned int flow_ctrl  : 1;
++	unsigned int gtxclk_out : 1;
++	unsigned int phyrst_n   : 1;
++	unsigned int dummy1     : 24;
+ } reg_eth_rw_gen_ctrl;
+ #define REG_RD_ADDR_eth_rw_gen_ctrl 24
+ #define REG_WR_ADDR_eth_rw_gen_ctrl 24
+ 
+ /* Register rw_rec_ctrl, scope eth, type rw */
+ typedef struct {
+-  unsigned int ma0        : 1;
+-  unsigned int ma1        : 1;
+-  unsigned int individual : 1;
+-  unsigned int broadcast  : 1;
+-  unsigned int undersize  : 1;
+-  unsigned int oversize   : 1;
+-  unsigned int bad_crc    : 1;
+-  unsigned int duplex     : 1;
+-  unsigned int max_size   : 16;
+-  unsigned int dummy1     : 8;
++	unsigned int ma0        : 1;
++	unsigned int ma1        : 1;
++	unsigned int individual : 1;
++	unsigned int broadcast  : 1;
++	unsigned int undersize  : 1;
++	unsigned int oversize   : 1;
++	unsigned int bad_crc    : 1;
++	unsigned int duplex     : 1;
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	unsigned int max_size   : 16;
++	unsigned int dummy1     : 8;
++#else
++	unsigned int max_size   : 1;
++	unsigned int dummy1     : 23;
++#endif
+ } reg_eth_rw_rec_ctrl;
+ #define REG_RD_ADDR_eth_rw_rec_ctrl 28
+ #define REG_WR_ADDR_eth_rw_rec_ctrl 28
+ 
+ /* Register rw_tr_ctrl, scope eth, type rw */
+ typedef struct {
+-  unsigned int crc         : 1;
+-  unsigned int pad         : 1;
+-  unsigned int retry       : 1;
+-  unsigned int ignore_col  : 1;
+-  unsigned int cancel      : 1;
+-  unsigned int hsh_delay   : 1;
+-  unsigned int ignore_crs  : 1;
+-  unsigned int carrier_ext : 1;
+-  unsigned int dummy1      : 24;
++	unsigned int crc         : 1;
++	unsigned int pad         : 1;
++	unsigned int retry       : 1;
++	unsigned int ignore_col  : 1;
++	unsigned int cancel      : 1;
++	unsigned int hsh_delay   : 1;
++	unsigned int ignore_crs  : 1;
++	unsigned int carrier_ext : 1;
++	unsigned int dummy1      : 24;
+ } reg_eth_rw_tr_ctrl;
+ #define REG_RD_ADDR_eth_rw_tr_ctrl 32
+ #define REG_WR_ADDR_eth_rw_tr_ctrl 32
+ 
+ /* Register rw_clr_err, scope eth, type rw */
+ typedef struct {
+-  unsigned int clr : 1;
+-  unsigned int dummy1 : 31;
++	unsigned int clr : 1;
++	unsigned int dummy1 : 31;
+ } reg_eth_rw_clr_err;
+ #define REG_RD_ADDR_eth_rw_clr_err 36
+ #define REG_WR_ADDR_eth_rw_clr_err 36
+ 
+ /* Register rw_mgm_ctrl, scope eth, type rw */
+ typedef struct {
+-  unsigned int mdio : 1;
+-  unsigned int mdoe : 1;
+-  unsigned int mdc  : 1;
+-  unsigned int dummy1 : 29;
++	unsigned int mdio : 1;
++	unsigned int mdoe : 1;
++	unsigned int mdc  : 1;
++	unsigned int phyclk : 1;
++	unsigned int txdata : 4;
++	unsigned int txen   : 1;
++	unsigned int dummy1 : 23;
+ } reg_eth_rw_mgm_ctrl;
+ #define REG_RD_ADDR_eth_rw_mgm_ctrl 40
+ #define REG_WR_ADDR_eth_rw_mgm_ctrl 40
+ 
+ /* Register r_stat, scope eth, type r */
+ typedef struct {
+-  unsigned int mdio    : 1;
+-  unsigned int exc_col : 1;
+-  unsigned int urun    : 1;
+-  unsigned int clk_125 : 1;
+-  unsigned int dummy1  : 28;
++	unsigned int mdio    : 1;
++	unsigned int exc_col : 1;
++	unsigned int urun    : 1;
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	unsigned int clk_125 : 1;
++#else
++	unsigned int phyclk  : 1;
++#endif
++	unsigned int txdata  : 4;
++	unsigned int txen    : 1;
++	unsigned int col     : 1;
++	unsigned int crs     : 1;
++	unsigned int txclk   : 1;
++	unsigned int rxdata  : 4;
++	unsigned int rxer    : 1;
++	unsigned int rxdv    : 1;
++	unsigned int rxclk   : 1;
++	unsigned int dummy1  : 13;
+ } reg_eth_r_stat;
+ #define REG_RD_ADDR_eth_r_stat 44
+ 
+ /* Register rs_rec_cnt, scope eth, type rs */
+ typedef struct {
+-  unsigned int crc_err    : 8;
+-  unsigned int align_err  : 8;
+-  unsigned int oversize   : 8;
+-  unsigned int congestion : 8;
++	unsigned int crc_err    : 8;
++	unsigned int align_err  : 8;
++	unsigned int oversize   : 8;
++	unsigned int congestion : 8;
+ } reg_eth_rs_rec_cnt;
+ #define REG_RD_ADDR_eth_rs_rec_cnt 48
+ 
+ /* Register r_rec_cnt, scope eth, type r */
+ typedef struct {
+-  unsigned int crc_err    : 8;
+-  unsigned int align_err  : 8;
+-  unsigned int oversize   : 8;
+-  unsigned int congestion : 8;
++	unsigned int crc_err    : 8;
++	unsigned int align_err  : 8;
++	unsigned int oversize   : 8;
++	unsigned int congestion : 8;
+ } reg_eth_r_rec_cnt;
+ #define REG_RD_ADDR_eth_r_rec_cnt 52
+ 
+ /* Register rs_tr_cnt, scope eth, type rs */
+ typedef struct {
+-  unsigned int single_col : 8;
+-  unsigned int mult_col   : 8;
+-  unsigned int late_col   : 8;
+-  unsigned int deferred   : 8;
++	unsigned int single_col : 8;
++	unsigned int mult_col   : 8;
++	unsigned int late_col   : 8;
++	unsigned int deferred   : 8;
+ } reg_eth_rs_tr_cnt;
+ #define REG_RD_ADDR_eth_rs_tr_cnt 56
+ 
+ /* Register r_tr_cnt, scope eth, type r */
+ typedef struct {
+-  unsigned int single_col : 8;
+-  unsigned int mult_col   : 8;
+-  unsigned int late_col   : 8;
+-  unsigned int deferred   : 8;
++	unsigned int single_col : 8;
++	unsigned int mult_col   : 8;
++	unsigned int late_col   : 8;
++	unsigned int deferred   : 8;
+ } reg_eth_r_tr_cnt;
+ #define REG_RD_ADDR_eth_r_tr_cnt 60
+ 
+ /* Register rs_phy_cnt, scope eth, type rs */
+ typedef struct {
+-  unsigned int carrier_loss : 8;
+-  unsigned int sqe_err      : 8;
+-  unsigned int dummy1       : 16;
++	unsigned int carrier_loss : 8;
++	unsigned int sqe_err      : 8;
++	unsigned int dummy1       : 16;
+ } reg_eth_rs_phy_cnt;
+ #define REG_RD_ADDR_eth_rs_phy_cnt 64
+ 
+ /* Register r_phy_cnt, scope eth, type r */
+ typedef struct {
+-  unsigned int carrier_loss : 8;
+-  unsigned int sqe_err      : 8;
+-  unsigned int dummy1       : 16;
++	unsigned int carrier_loss : 8;
++	unsigned int sqe_err      : 8;
++	unsigned int dummy1       : 16;
+ } reg_eth_r_phy_cnt;
+ #define REG_RD_ADDR_eth_r_phy_cnt 68
+ 
+ /* Register rw_test_ctrl, scope eth, type rw */
+ typedef struct {
+-  unsigned int snmp_inc : 1;
+-  unsigned int snmp     : 1;
+-  unsigned int backoff  : 1;
+-  unsigned int dummy1   : 29;
++	unsigned int snmp_inc : 1;
++	unsigned int snmp     : 1;
++	unsigned int backoff  : 1;
++	unsigned int dummy1   : 29;
+ } reg_eth_rw_test_ctrl;
+ #define REG_RD_ADDR_eth_rw_test_ctrl 72
+ #define REG_WR_ADDR_eth_rw_test_ctrl 72
+ 
+ /* Register rw_intr_mask, scope eth, type rw */
+ typedef struct {
+-  unsigned int crc          : 1;
+-  unsigned int align        : 1;
+-  unsigned int oversize     : 1;
+-  unsigned int congestion   : 1;
+-  unsigned int single_col   : 1;
+-  unsigned int mult_col     : 1;
+-  unsigned int late_col     : 1;
+-  unsigned int deferred     : 1;
+-  unsigned int carrier_loss : 1;
+-  unsigned int sqe_test_err : 1;
+-  unsigned int orun         : 1;
+-  unsigned int urun         : 1;
+-  unsigned int exc_col      : 1;
+-  unsigned int mdio         : 1;
+-  unsigned int dummy1       : 18;
++	unsigned int crc          : 1;
++	unsigned int align        : 1;
++	unsigned int oversize     : 1;
++	unsigned int congestion   : 1;
++	unsigned int single_col   : 1;
++	unsigned int mult_col     : 1;
++	unsigned int late_col     : 1;
++	unsigned int deferred     : 1;
++	unsigned int carrier_loss : 1;
++	unsigned int sqe_test_err : 1;
++	unsigned int orun         : 1;
++	unsigned int urun         : 1;
++	unsigned int exc_col      : 1;
++	unsigned int mdio         : 1;
++	unsigned int dummy1       : 18;
+ } reg_eth_rw_intr_mask;
+ #define REG_RD_ADDR_eth_rw_intr_mask 76
+ #define REG_WR_ADDR_eth_rw_intr_mask 76
+ 
+ /* Register rw_ack_intr, scope eth, type rw */
+ typedef struct {
+-  unsigned int crc          : 1;
+-  unsigned int align        : 1;
+-  unsigned int oversize     : 1;
+-  unsigned int congestion   : 1;
+-  unsigned int single_col   : 1;
+-  unsigned int mult_col     : 1;
+-  unsigned int late_col     : 1;
+-  unsigned int deferred     : 1;
+-  unsigned int carrier_loss : 1;
+-  unsigned int sqe_test_err : 1;
+-  unsigned int orun         : 1;
+-  unsigned int urun         : 1;
+-  unsigned int exc_col      : 1;
+-  unsigned int mdio         : 1;
+-  unsigned int dummy1       : 18;
++	unsigned int crc          : 1;
++	unsigned int align        : 1;
++	unsigned int oversize     : 1;
++	unsigned int congestion   : 1;
++	unsigned int single_col   : 1;
++	unsigned int mult_col     : 1;
++	unsigned int late_col     : 1;
++	unsigned int deferred     : 1;
++	unsigned int carrier_loss : 1;
++	unsigned int sqe_test_err : 1;
++	unsigned int orun         : 1;
++	unsigned int urun         : 1;
++	unsigned int exc_col      : 1;
++	unsigned int mdio         : 1;
++	unsigned int dummy1       : 18;
+ } reg_eth_rw_ack_intr;
+ #define REG_RD_ADDR_eth_rw_ack_intr 80
+ #define REG_WR_ADDR_eth_rw_ack_intr 80
+ 
+ /* Register r_intr, scope eth, type r */
+ typedef struct {
+-  unsigned int crc          : 1;
+-  unsigned int align        : 1;
+-  unsigned int oversize     : 1;
+-  unsigned int congestion   : 1;
+-  unsigned int single_col   : 1;
+-  unsigned int mult_col     : 1;
+-  unsigned int late_col     : 1;
+-  unsigned int deferred     : 1;
+-  unsigned int carrier_loss : 1;
+-  unsigned int sqe_test_err : 1;
+-  unsigned int orun         : 1;
+-  unsigned int urun         : 1;
+-  unsigned int exc_col      : 1;
+-  unsigned int mdio         : 1;
+-  unsigned int dummy1       : 18;
++	unsigned int crc          : 1;
++	unsigned int align        : 1;
++	unsigned int oversize     : 1;
++	unsigned int congestion   : 1;
++	unsigned int single_col   : 1;
++	unsigned int mult_col     : 1;
++	unsigned int late_col     : 1;
++	unsigned int deferred     : 1;
++	unsigned int carrier_loss : 1;
++	unsigned int sqe_test_err : 1;
++	unsigned int orun         : 1;
++	unsigned int urun         : 1;
++	unsigned int exc_col      : 1;
++	unsigned int mdio         : 1;
++	unsigned int dummy1       : 18;
+ } reg_eth_r_intr;
+ #define REG_RD_ADDR_eth_r_intr 84
+ 
+ /* Register r_masked_intr, scope eth, type r */
+ typedef struct {
+-  unsigned int crc          : 1;
+-  unsigned int align        : 1;
+-  unsigned int oversize     : 1;
+-  unsigned int congestion   : 1;
+-  unsigned int single_col   : 1;
+-  unsigned int mult_col     : 1;
+-  unsigned int late_col     : 1;
+-  unsigned int deferred     : 1;
+-  unsigned int carrier_loss : 1;
+-  unsigned int sqe_test_err : 1;
+-  unsigned int orun         : 1;
+-  unsigned int urun         : 1;
+-  unsigned int exc_col      : 1;
+-  unsigned int mdio         : 1;
+-  unsigned int dummy1       : 18;
++	unsigned int crc          : 1;
++	unsigned int align        : 1;
++	unsigned int oversize     : 1;
++	unsigned int congestion   : 1;
++	unsigned int single_col   : 1;
++	unsigned int mult_col     : 1;
++	unsigned int late_col     : 1;
++	unsigned int deferred     : 1;
++	unsigned int carrier_loss : 1;
++	unsigned int sqe_test_err : 1;
++	unsigned int orun         : 1;
++	unsigned int urun         : 1;
++	unsigned int exc_col      : 1;
++	unsigned int mdio         : 1;
++	unsigned int dummy1       : 18;
+ } reg_eth_r_masked_intr;
+ #define REG_RD_ADDR_eth_r_masked_intr 88
+ 
+-
+ /* Constants */
+ enum {
+-  regk_eth_discard                         = 0x00000000,
+-  regk_eth_ether                           = 0x00000000,
+-  regk_eth_full                            = 0x00000001,
+-  regk_eth_gmii                            = 0x00000003,
+-  regk_eth_gtxclk                          = 0x00000001,
+-  regk_eth_half                            = 0x00000000,
+-  regk_eth_hsh                             = 0x00000001,
+-  regk_eth_mii                             = 0x00000001,
+-  regk_eth_mii_arec                        = 0x00000002,
+-  regk_eth_mii_clk                         = 0x00000000,
+-  regk_eth_no                              = 0x00000000,
+-  regk_eth_phyrst                          = 0x00000000,
+-  regk_eth_rec                             = 0x00000001,
+-  regk_eth_rw_ga_hi_default                = 0x00000000,
+-  regk_eth_rw_ga_lo_default                = 0x00000000,
+-  regk_eth_rw_gen_ctrl_default             = 0x00000000,
+-  regk_eth_rw_intr_mask_default            = 0x00000000,
+-  regk_eth_rw_ma0_hi_default               = 0x00000000,
+-  regk_eth_rw_ma0_lo_default               = 0x00000000,
+-  regk_eth_rw_ma1_hi_default               = 0x00000000,
+-  regk_eth_rw_ma1_lo_default               = 0x00000000,
+-  regk_eth_rw_mgm_ctrl_default             = 0x00000000,
+-  regk_eth_rw_test_ctrl_default            = 0x00000000,
+-  regk_eth_size1518                        = 0x000005ee,
+-  regk_eth_size1522                        = 0x000005f2,
+-  regk_eth_yes                             = 0x00000001
++	regk_eth_discard                         = 0x00000000,
++	regk_eth_ether                           = 0x00000000,
++	regk_eth_full                            = 0x00000001,
++	regk_eth_gmii                            = 0x00000003,
++	regk_eth_gtxclk                          = 0x00000001,
++	regk_eth_half                            = 0x00000000,
++	regk_eth_hsh                             = 0x00000001,
++	regk_eth_mii                             = 0x00000001,
++	regk_eth_mii_arec                        = 0x00000002,
++	regk_eth_mii_clk                         = 0x00000000,
++	regk_eth_no                              = 0x00000000,
++	regk_eth_phyrst                          = 0x00000000,
++	regk_eth_rec                             = 0x00000001,
++	regk_eth_rw_ga_hi_default                = 0x00000000,
++	regk_eth_rw_ga_lo_default                = 0x00000000,
++	regk_eth_rw_gen_ctrl_default             = 0x00000000,
++	regk_eth_rw_intr_mask_default            = 0x00000000,
++	regk_eth_rw_ma0_hi_default               = 0x00000000,
++	regk_eth_rw_ma0_lo_default               = 0x00000000,
++	regk_eth_rw_ma1_hi_default               = 0x00000000,
++	regk_eth_rw_ma1_lo_default               = 0x00000000,
++	regk_eth_rw_mgm_ctrl_default             = 0x00000000,
++	regk_eth_rw_test_ctrl_default            = 0x00000000,
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	regk_eth_size1518                        = 0x000005ee,
++	regk_eth_size1522                        = 0x000005f2,
++#else
++	regk_eth_size1518                        = 0x00000000,
++	regk_eth_size1522                        = 0x00000001,
++#endif
++	regk_eth_yes                             = 0x00000001
+ };
++
+ #endif /* __eth_defs_h */
+diff --git a/drivers/net/cris/Makefile b/drivers/net/cris/Makefile
+index b4e8932..39b4d4d 100644
+--- a/drivers/net/cris/Makefile
++++ b/drivers/net/cris/Makefile
+@@ -1 +1,2 @@
+ obj-$(CONFIG_ETRAX_ARCH_V10) += eth_v10.o
++obj-$(CONFIG_ETRAX_ARCH_V32) += eth_v32.o
+diff --git a/drivers/net/cris/eth_v32.c b/drivers/net/cris/eth_v32.c
+new file mode 100644
+index 0000000..92c4cae
+--- /dev/null
++++ b/drivers/net/cris/eth_v32.c
+@@ -0,0 +1,3093 @@
++/*
++ * Driver for the ETRAX FS/Artpec-3 network controller.
++ *
++ * Copyright (c) 2003-2008 Axis Communications AB.
++ *
++ * TODO:
++ *   *    Decrease the amount of code running with interrupts disabled.
++ *   *    Rework the error handling so that we do not need to touch the tx
++ *        ring from the error interrupts. When done, we should be able to
++ *        do tx completition from the NAPI loop without disabling interrupts.
++ *   *    Remove the gigabit code. It's probably never going to be used.
++ */
++
++#include <linux/module.h>
++
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/delay.h>
++#include <linux/types.h>
++#include <linux/fcntl.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/errno.h>
++#include <linux/init.h>
++
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/skbuff.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++
++#include <asm/io.h>		/* CRIS_LED_* I/O functions */
++#include <asm/irq.h>
++#include <hwregs/reg_map.h>
++#include <hwregs/reg_rdwr.h>
++#include <hwregs/dma.h>
++#include <hwregs/eth_defs.h>
++#ifdef CONFIG_ETRAXFS
++#include <hwregs/config_defs.h>
++#else
++#include <hwregs/clkgen_defs.h>
++#endif
++#include <hwregs/intr_vect_defs.h>
++#include <hwregs/strmux_defs.h>
++#include <asm/bitops.h>
++#include <asm/ethernet.h>
++#include <mach/dma.h>
++#include <pinmux.h>
++
++#include "eth_v32.h"
++
++#ifndef CONFIG_ETRAXFS
++#define ETH0_INTR_VECT ETH_INTR_VECT
++#define ETH1_INTR_VECT ETH_INTR_VECT
++#define regi_eth0 regi_eth
++#define regi_eth1 regi_
++#endif
++
++#define DEBUG(x)
++#define GET_BIT(bit,val)   (((val) >> (bit)) & 0x01)
++
++#if defined(CONFIG_ETRAX_HAVE_PHY) || defined(CONFIG_ETRAX_PHY_FALLBACK)
++#define RESET_PHY 1
++#else
++#define RESET_PHY 0
++#endif
++
++enum {
++	HAVE_PHY,
++	NO_PHY,
++	FALLBACK_PHY,
++};
++#if defined(CONFIG_ETRAX_PHY_FALLBACK)
++#define PHY_MODE (FALLBACK_PHY)
++#elif defined(CONFIG_ETRAX_NO_PHY)
++#define PHY_MODE (NO_PHY)
++#elif defined(CONFIG_ETRAX_HAVE_PHY)
++#define PHY_MODE (HAVE_PHY)
++#else
++#error Unknown PHY behaviour
++#endif
++
++static struct {
++	const char str[ETH_GSTRING_LEN];
++} const ethtool_stats_keys[] = {
++	{ "tx_dma_restarts" },
++	{ "tx_mac_resets" },
++	{ "rx_dma_restarts" },
++	{ "rx_dma_timeouts" },
++	{ "  dropped_rx" }
++};
++
++static void crisv32_eth_check_speed(unsigned long idev);
++static void crisv32_eth_check_duplex(unsigned long idev);
++static void update_rx_stats(struct crisv32_ethernet_local *np);
++static void update_tx_stats(struct crisv32_ethernet_local *np);
++static int crisv32_eth_poll(struct napi_struct *napi, int budget);
++static void crisv32_eth_setup_controller(struct net_device *dev);
++static int crisv32_eth_request_irqdma(struct net_device *dev);
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++static void
++crisv32_eth_restart_rx_dma(struct net_device* dev,
++			   struct crisv32_ethernet_local *np);
++#endif
++#if 0
++static void crisv32_ethernet_bug(struct net_device *dev);
++#endif
++
++/*
++ * The name of the card. Is used for messages and in the requests for
++ * io regions, irqs and dma channels.
++ */
++#ifdef CONFIG_ETRAXFS
++static const char cardname[] = "ETRAX FS built-in ethernet controller";
++#else
++static const char cardname[] = "ARTPEC-3 built-in ethernet controller";
++#endif
++
++/* Some chipset needs special care. */
++#ifndef CONFIG_ETRAX_NO_PHY
++struct transceiver_ops transceivers[] = {
++	{0x1018, broadcom_check_speed, broadcom_check_duplex},
++	{0x50EF, broadcom_check_speed, broadcom_check_duplex},
++	/* TDK 2120 and TDK 2120C */
++	{0xC039, tdk_check_speed, tdk_check_duplex},
++	{0x039C, tdk_check_speed, tdk_check_duplex},
++	/* Intel LXT972A*/
++	{0x04de, intel_check_speed, intel_check_duplex},
++	/* National Semiconductor DP83865 */
++	{0x0017, national_check_speed, national_check_duplex},
++	/* Vitesse VCS8641 */
++	{0x01c1, vitesse_check_speed, vitesse_check_duplex},
++	/* Davicom DM9161 */
++	{0x606E, davicom_check_speed, davicom_check_duplex},
++	/* Generic, must be last. */
++	{0x0000, generic_check_speed, generic_check_duplex}
++};
++#endif
++
++static struct net_device *crisv32_dev[2];
++static struct crisv32_eth_leds *crisv32_leds[3];
++
++/* Default MAC address for interface 0.
++ * The real one will be set later. */
++static struct sockaddr default_mac_iface0 =
++  {0, {0x00, 0x40, 0x8C, 0xCD, 0x00, 0x00}};
++
++#ifdef CONFIG_CPU_FREQ
++static int
++crisv32_ethernet_freq_notifier(struct notifier_block *nb, unsigned long val,
++			       void *data);
++
++static struct notifier_block crisv32_ethernet_freq_notifier_block = {
++	.notifier_call	= crisv32_ethernet_freq_notifier
++};
++#endif
++
++static void receive_timeout(unsigned long arg);
++static void receive_timeout_work(struct work_struct* work);
++static void transmit_timeout(unsigned long arg);
++
++/*
++ * mask in and out tx/rx interrupts.
++ */
++static inline void crisv32_disable_tx_ints(struct crisv32_ethernet_local *np)
++{
++	reg_dma_rw_intr_mask intr_mask_tx = { .data = regk_dma_no };
++	REG_WR(dma, np->dma_out_inst, rw_intr_mask, intr_mask_tx);
++}
++
++static inline void crisv32_enable_tx_ints(struct crisv32_ethernet_local *np)
++{
++	reg_dma_rw_intr_mask intr_mask_tx = { .data = regk_dma_yes };
++	REG_WR(dma, np->dma_out_inst, rw_intr_mask, intr_mask_tx);
++}
++
++static inline void crisv32_disable_rx_ints(struct crisv32_ethernet_local *np)
++{
++	reg_dma_rw_intr_mask intr_mask_rx = { .in_eop = regk_dma_no };
++	REG_WR(dma, np->dma_in_inst, rw_intr_mask, intr_mask_rx);
++}
++
++static inline void crisv32_enable_rx_ints(struct crisv32_ethernet_local *np)
++{
++	reg_dma_rw_intr_mask intr_mask_rx = { .in_eop = regk_dma_yes };
++	REG_WR(dma, np->dma_in_inst, rw_intr_mask, intr_mask_rx);
++}
++
++static inline void crisv32_disable_eth_ints(struct crisv32_ethernet_local *np)
++{
++	int intr_mask_nw = 0x0;
++	REG_WR_INT(eth, np->eth_inst, rw_intr_mask, intr_mask_nw);
++}
++
++static inline void crisv32_enable_eth_ints(struct crisv32_ethernet_local *np)
++{
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	/* For Artpec-3 we use overrun to workaround voodoo TR 87 */
++	int intr_mask_nw = 0x1c00;
++#else
++	int intr_mask_nw = 0x1800;
++#endif
++	REG_WR_INT(eth, np->eth_inst, rw_intr_mask, intr_mask_nw);
++}
++
++static inline int crisv32_eth_gigabit(struct crisv32_ethernet_local *np)
++{
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	return np->gigabit_mode;
++#else
++	return 0;
++#endif
++}
++
++static inline void crisv32_eth_set_gigabit(struct crisv32_ethernet_local *np,
++					   int g)
++{
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	np->gigabit_mode = g;
++#endif
++}
++
++/* start/stop receiver */
++static inline void crisv32_start_receiver(struct crisv32_ethernet_local *np)
++{
++	reg_eth_rw_rec_ctrl rec_ctrl;
++
++	rec_ctrl = REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++	rec_ctrl.ma0 = regk_eth_yes;
++	rec_ctrl.broadcast = regk_eth_rec;
++	REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++}
++
++static inline void crisv32_stop_receiver(struct crisv32_ethernet_local *np)
++{
++	reg_eth_rw_rec_ctrl rec_ctrl;
++
++	rec_ctrl = REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++	rec_ctrl.ma0 = regk_eth_no;
++	rec_ctrl.broadcast = regk_eth_discard;
++	REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++}
++
++static inline void crisv32_eth_reset(struct crisv32_ethernet_local *np)
++{
++	reg_eth_rw_gen_ctrl gen_ctrl = { 0 };
++
++	gen_ctrl = REG_RD(eth, np->eth_inst, rw_gen_ctrl);
++	gen_ctrl.en = regk_eth_no;
++	REG_WR(eth, np->eth_inst, rw_gen_ctrl, gen_ctrl);
++	gen_ctrl.en = regk_eth_yes;
++	REG_WR(eth, np->eth_inst, rw_gen_ctrl, gen_ctrl);
++}
++
++static void crisv32_eth_tx_cancel_frame(struct crisv32_ethernet_local *np)
++{
++	reg_eth_rw_tr_ctrl tr_ctrl;
++
++	/* Cancel any pending transmits.  This should bring us to the
++	   excessive collisions state but it doesn't always do it.  */
++	tr_ctrl = REG_RD(eth, np->eth_inst, rw_tr_ctrl);
++	tr_ctrl.cancel = 1;
++	REG_WR(eth, np->eth_inst, rw_tr_ctrl, tr_ctrl);
++	tr_ctrl.cancel = 0;
++	REG_WR(eth, np->eth_inst, rw_tr_ctrl, tr_ctrl);
++}
++
++/*
++ * Hack to disconnect/reconnect the dma from the ethernet block while we reset
++ * things. TODO: verify that we don't need to disconnect out channels and
++ * remove that code.
++ *
++ * ARTPEC-3 has only a single ethernet block so np->eth_inst is always eth0.
++ * The strmux values are named slightly different, redefine to avoid #ifdefs
++ * in the code blocks. For artpec3 only regk_strmux_eth0 and channel 0/1
++ * should be used.
++ */
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++#define regk_strmux_eth0 regk_strmux_eth
++#define regk_strmux_eth1 regk_strmux_eth
++#endif
++static inline void
++crisv32_disconnect_eth_tx_dma(struct crisv32_ethernet_local *np)
++{
++	reg_strmux_rw_cfg strmux_cfg;
++
++	strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
++	if (np->eth_inst == regi_eth0)
++		strmux_cfg.dma0 = regk_strmux_off;
++	else
++		strmux_cfg.dma6 = regk_strmux_off;
++	REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
++}
++
++static inline void crisv32_connect_eth_tx_dma(struct crisv32_ethernet_local *np)
++{
++	reg_strmux_rw_cfg strmux_cfg;
++
++	strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
++	if (np->eth_inst == regi_eth0)
++		strmux_cfg.dma0 = regk_strmux_eth0;
++	else
++		strmux_cfg.dma6 = regk_strmux_eth1;
++	REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
++}
++
++static inline void
++crisv32_disconnect_eth_rx_dma(struct crisv32_ethernet_local *np)
++{
++	reg_strmux_rw_cfg strmux_cfg;
++
++	strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
++	if (np->eth_inst == regi_eth0)
++		strmux_cfg.dma1 = regk_strmux_off;
++	else
++		strmux_cfg.dma7 = regk_strmux_off;
++	REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
++}
++
++static inline void crisv32_connect_eth_rx_dma(struct crisv32_ethernet_local *np)
++{
++	reg_strmux_rw_cfg strmux_cfg;
++
++	strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
++	if (np->eth_inst == regi_eth0)
++		strmux_cfg.dma1 = regk_strmux_eth0;
++	else
++		strmux_cfg.dma7 = regk_strmux_eth1;
++	REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
++}
++
++static int dma_wait_busy(int inst, int timeout)
++{
++	reg_dma_rw_stream_cmd dma_sc;
++
++	do {
++		dma_sc = REG_RD(dma, inst, rw_stream_cmd);
++	} while (timeout-- > 0 && dma_sc.busy);
++	return dma_sc.busy;
++}
++
++static int __init crisv32_eth_request_irqdma(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	/* Allocate IRQs and DMAs. */
++	if (np->eth_inst == regi_eth0) {
++		if (request_irq(DMA0_INTR_VECT, crisv32tx_eth_interrupt,
++				0, "Ethernet TX", dev)) {
++			return -EAGAIN;
++		}
++
++		if (request_irq(DMA1_INTR_VECT, crisv32rx_eth_interrupt,
++				0, "Ethernet RX", dev))
++			goto err0_1;
++
++		if (crisv32_request_dma(0, cardname, DMA_VERBOSE_ON_ERROR,
++					12500000, dma_eth0))
++			goto err0_2;
++
++		if (crisv32_request_dma(1, cardname, DMA_VERBOSE_ON_ERROR,
++					12500000, dma_eth0))
++			goto err0_3;
++
++		if (request_irq(ETH0_INTR_VECT, crisv32nw_eth_interrupt, 0,
++					cardname, dev)) {
++			crisv32_free_dma(1);
++err0_3:
++			crisv32_free_dma(0);
++err0_2:
++			free_irq(DMA1_INTR_VECT, dev);
++err0_1:
++			free_irq(DMA0_INTR_VECT, dev);
++			return -EAGAIN;
++		}
++	} else {
++		if (request_irq(DMA6_INTR_VECT, crisv32tx_eth_interrupt,
++				0, cardname, dev))
++			return -EAGAIN;
++
++		if (request_irq(DMA7_INTR_VECT, crisv32rx_eth_interrupt,
++				0, cardname, dev))
++			goto err1_1;
++
++		if (crisv32_request_dma(6, cardname, DMA_VERBOSE_ON_ERROR,
++					0, dma_eth1))
++			goto err1_2;
++
++		if (crisv32_request_dma(7, cardname, DMA_VERBOSE_ON_ERROR,
++					0, dma_eth1))
++			goto err1_3;
++
++		if (request_irq(ETH1_INTR_VECT, crisv32nw_eth_interrupt, 0,
++					cardname, dev)) {
++			crisv32_free_dma(7);
++err1_3:
++			crisv32_free_dma(6);
++err1_2:
++			free_irq(DMA7_INTR_VECT, dev);
++err1_1:
++			free_irq(DMA6_INTR_VECT, dev);
++			return -EAGAIN;
++		}
++	}
++	return 0;
++}
++
++static int __init crisv32_eth_init_phy(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	struct timer_list timer_init = TIMER_INITIALIZER(NULL, 0, 0);
++
++	if (RESET_PHY) {
++#ifdef CONFIG_ETRAXFS
++		reg_config_rw_pad_ctrl pad_ctrl;
++		pad_ctrl = REG_RD(config, regi_config, rw_pad_ctrl);
++		pad_ctrl.phyrst_n = 0;
++		REG_WR(config, regi_config, rw_pad_ctrl, pad_ctrl);
++
++		udelay(500); /* RESET_LEN */
++
++		pad_ctrl.phyrst_n = 1;
++		REG_WR(config, regi_config, rw_pad_ctrl, pad_ctrl);
++#else
++		reg_eth_rw_gen_ctrl gen_ctrl = REG_RD(eth, np->eth_inst, rw_gen_ctrl);
++		gen_ctrl.phyrst_n = 0;
++		REG_WR(eth, np->eth_inst, rw_gen_ctrl, gen_ctrl);
++
++		udelay(500); /* RESET_LEN */
++
++		gen_ctrl.phyrst_n = 1;
++		REG_WR(eth, np->eth_inst, rw_gen_ctrl, gen_ctrl);
++#endif
++
++		udelay(200); /* RESET_WAIT */
++	}
++
++	switch (PHY_MODE) {
++	case FALLBACK_PHY:
++		/* Fall back on using fixed iff there is no PHY on */
++		/* the MDIO bus */
++		np->fixed_phy = crisv32_eth_probe_transceiver(dev) != 0;
++		if (np->fixed_phy)
++			printk(KERN_WARNING
++				"eth: No transciever found, falling back "
++				"to fixed phy mode\n");
++		break;
++
++	case NO_PHY:
++		/* Don't even bother looking for a PHY, always rely */
++		/* on fixed PHY */
++		np->fixed_phy = 1;
++		break;
++
++	default: /* HAVE_PHY */
++		/* Look for a PHY and abort if there is none, */
++		/* otherwise just carry on */
++		if (crisv32_eth_probe_transceiver(dev)) {
++			printk(KERN_WARNING
++				"eth: No transceiver found, "
++				"removing interface\n");
++			return -ENODEV;
++		}
++		np->fixed_phy = 0;
++	}
++
++	if (np->fixed_phy) {
++		reg_eth_rw_rec_ctrl rec_ctrl;
++
++		/* speed */
++		np->current_speed = 100;
++		np->current_speed_selection = 100;	/* Auto. */
++
++		/* duplex */
++		np->full_duplex = 1;
++		np->current_duplex = full;
++
++		rec_ctrl = REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++		rec_ctrl.duplex = regk_eth_full;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	} else {
++		np->mii_if.supports_gmii = mii_check_gmii_support(&np->mii_if);
++
++		/* speed */
++		np->current_speed = 10;
++		np->current_speed_selection = 0;	/* Auto. */
++		np->speed_timer = timer_init;
++		np->speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;
++		np->speed_timer.data = (unsigned long) dev;
++		np->speed_timer.function = crisv32_eth_check_speed;
++
++		/* duplex */
++		np->full_duplex = 0;
++		np->current_duplex = autoneg;
++		np->duplex_timer = timer_init;
++		np->duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL;
++		np->duplex_timer.data = (unsigned long) dev;
++		np->duplex_timer.function = crisv32_eth_check_duplex;
++	}
++
++	return 0;
++}
++
++static void __init crisv32_eth_setup_controller(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	reg_eth_rw_gen_ctrl gen_ctrl;
++
++	reg_eth_rw_tr_ctrl tr_ctrl = {
++		/* SW retransmits to avoid transmitter bugs.  */
++		.retry = regk_eth_no,
++		.pad = regk_eth_yes,
++		.crc = regk_eth_yes
++	};
++
++	reg_eth_rw_rec_ctrl rec_ctrl = {
++		.ma0 = regk_eth_no,	/* enable at open() */
++		.broadcast = regk_eth_no,
++		.max_size = regk_eth_size1522
++	};
++
++	reg_eth_rw_ga_lo ga_lo = { 0 };
++	reg_eth_rw_ga_hi ga_hi = { 0 };
++
++	/*
++	 * Initialize group address registers to make sure that no
++	 * unwanted addresses are matched.
++	 */
++	REG_WR(eth, np->eth_inst, rw_ga_lo, ga_lo);
++	REG_WR(eth, np->eth_inst, rw_ga_hi, ga_hi);
++
++	/* Configure receiver and transmitter */
++	REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	REG_WR(eth, np->eth_inst, rw_tr_ctrl, tr_ctrl);
++
++	/*
++	 * Read from rw_gen_ctrl so that we don't override any previous
++	 * configuration.
++	 */
++	gen_ctrl = REG_RD(eth, np->eth_inst, rw_gen_ctrl);
++	gen_ctrl.phy = regk_eth_mii_clk;
++#ifdef CONFIG_ETRAXFS
++	/* On ETRAX FS, this bit has reversed meaning */
++	gen_ctrl.flow_ctrl = regk_eth_no;
++#else
++	gen_ctrl.flow_ctrl = regk_eth_yes;
++#endif
++
++	/* Enable ethernet controller with mii clk. */
++	REG_WR(eth, np->eth_inst, rw_gen_ctrl, gen_ctrl);
++	gen_ctrl.en = regk_eth_yes;
++	REG_WR(eth, np->eth_inst, rw_gen_ctrl, gen_ctrl);
++}
++
++static void crisv32_eth_reset_rx_ring(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	int i;
++
++	/* cleanup the rx-ring */
++	for (i = 0; i < NBR_RX_DESC; i++) {
++		struct sk_buff *skb;
++		skb = np->dma_rx_descr_list[i].skb;
++		if (!skb
++		    || (np->dma_rx_descr_list[i].descr.buf !=
++			(void *)virt_to_phys(skb->data))) {
++			if (skb)
++				dev_kfree_skb(skb);
++			skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE);
++			np->dma_rx_descr_list[i].skb = skb;
++			np->dma_rx_descr_list[i].descr.buf =
++				(char*)virt_to_phys(skb->data);
++		}
++		if (np->dma_rx_descr_list[i].descr.in_eop)
++			np->rx_restarts_dropped++;
++		np->dma_rx_descr_list[i].descr.after =
++			(char*)virt_to_phys(skb->data
++					    + MAX_MEDIA_DATA_SIZE);
++		np->dma_rx_descr_list[i].descr.eol = 0;
++		np->dma_rx_descr_list[i].descr.in_eop = 0;
++		/* Workaround cache bug */
++		flush_dma_descr(&np->dma_rx_descr_list[i].descr, 1);
++	}
++
++	/* reset rx-ring */
++	np->active_rx_desc = &np->dma_rx_descr_list[0];
++	np->prev_rx_desc = &np->dma_rx_descr_list[NBR_RX_DESC - 1];
++	np->last_rx_desc = np->prev_rx_desc;
++	np->dma_rx_descr_list[NBR_RX_DESC - 1].descr.eol = 1;
++	flush_dma_descr(&np->dma_rx_descr_list[NBR_RX_DESC - 1].descr, 0);
++	/* ready to accept new packets.  */
++	np->new_rx_package = 1;
++
++	/* Fill context descriptors. */
++	np->ctxt_in.next = 0;
++	np->ctxt_in.saved_data =
++		(void *)virt_to_phys(&np->active_rx_desc->descr);
++	np->ctxt_in.saved_data_buf = np->active_rx_desc->descr.buf;
++}
++
++static inline int crisv32_eth_tx_ring_full(struct crisv32_ethernet_local *np)
++{
++	crisv32_eth_descr *active = np->active_tx_desc;
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	active = phys_to_virt((unsigned long)active->descr.next);
++#endif
++	if (active == np->catch_tx_desc)
++		return 1;
++	return 0;
++}
++
++static void crisv32_eth_reset_tx_ring(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	/* free un-handled tx packets */
++	while (np->txpackets || np->catch_tx_desc != np->active_tx_desc) {
++		np->txpackets--;
++		if (np->catch_tx_desc->skb)
++			dev_kfree_skb(np->catch_tx_desc->skb);
++
++		np->catch_tx_desc->skb = 0;
++		np->catch_tx_desc =
++			phys_to_virt((int)np->catch_tx_desc->descr.next);
++	}
++
++	WARN_ON(np->txpackets != 0);
++	np->txpackets = 0;
++
++	/* reset tx-ring */
++	np->dma_tx_descr_list[0].descr.buf =
++		np->dma_tx_descr_list[0].descr.after = 0;
++	np->dma_tx_descr_list[0].descr.eol = 1;
++
++	np->active_tx_desc = &np->dma_tx_descr_list[0];
++	np->prev_tx_desc = &np->dma_tx_descr_list[NBR_TX_DESC - 1];
++	np->catch_tx_desc = &np->dma_tx_descr_list[0];
++
++	np->ctxt_out.next = 0;
++	np->ctxt_out.saved_data =
++		(void *)virt_to_phys(&np->dma_tx_descr_list[0].descr);
++
++}
++
++static void crisv32_eth_reset_rings(struct net_device *dev)
++{
++	crisv32_eth_reset_tx_ring(dev);
++	crisv32_eth_reset_rx_ring(dev);
++}
++
++/*
++ * Really advance the receive ring. RX interrupts must be off.
++ */
++static void __crisv32_eth_rx_ring_advance(struct crisv32_ethernet_local *np)
++{
++	if (np->newbuf)
++		np->active_rx_desc->descr.buf = (void *) np->newbuf;
++	np->active_rx_desc->descr.after =
++		np->active_rx_desc->descr.buf + MAX_MEDIA_DATA_SIZE;
++	np->active_rx_desc->descr.eol = 1;
++	np->active_rx_desc->descr.in_eop = 0;
++	np->active_rx_desc = phys_to_virt((int)np->active_rx_desc->descr.next);
++	barrier();
++	np->prev_rx_desc->descr.eol = 0;
++
++	/* Workaround cache bug.  */
++	flush_dma_descr(&np->prev_rx_desc->descr, 0);
++	np->prev_rx_desc = phys_to_virt((int)np->prev_rx_desc->descr.next);
++	flush_dma_descr(&np->prev_rx_desc->descr, 1);
++}
++
++/*
++ * Advance the receive ring. RX interrupts must be off.
++ */
++static inline void
++crisv32_eth_rx_ring_advance(struct crisv32_ethernet_local *np)
++{
++	/*
++	 * When the input DMA reaches eol precaution must be taken, otherwise
++	 * the DMA could stop. The problem occurs if the eol flag is re-placed
++	 * on the descriptor that the DMA stands on before the DMA proceed to
++	 * the next descriptor. This case could, for example, happen if there
++	 * is a traffic burst and then the network goes silent. To prevent this
++	 * we make sure that we do not set the eol flag on the descriptor that
++	 * the DMA stands on.
++	 */
++	unsigned long dma_pos;
++
++	/* Get the current input dma position. */
++	dma_pos = REG_RD_INT(dma, np->dma_in_inst, rw_saved_data);
++
++	if (virt_to_phys(&np->active_rx_desc->descr) != dma_pos) {
++		crisv32_eth_descr *cur, *nxt;
++
++		/* Now really advance the ring one step.  */
++		__crisv32_eth_rx_ring_advance(np);
++
++		cur = np->active_rx_desc;
++		nxt = (void *)phys_to_virt((unsigned long)cur->descr.next);
++		flush_dma_descr(&cur->descr, 0);
++		flush_dma_descr(&nxt->descr, 0);
++		if (!cur->descr.in_eop && nxt->descr.in_eop) {
++			/* TODO: Investigate this more. The DMA seems to have
++			   skipped a descriptor, possibly due to incoherence
++			   between the CPU L1 cache and the DMA updates to the
++			   descriptor.  */
++			np->newbuf = (unsigned long) np->active_rx_desc->descr.buf;
++			__crisv32_eth_rx_ring_advance(np);
++		}
++		/* flush after peek.  */
++		flush_dma_descr(&cur->descr, 0);
++		flush_dma_descr(&nxt->descr, 0);
++	} else {
++		/* delay the advancing of the ring.  */
++		np->new_rx_package = 0;
++	}
++}
++
++static void __init crisv32_eth_init_rings(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	int i;
++
++	/* Initialise receive descriptors for interface. */
++	for (i = 0; i < NBR_RX_DESC; i++) {
++		struct sk_buff *skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE);
++
++		np->dma_rx_descr_list[i].skb = skb;
++		np->dma_rx_descr_list[i].descr.buf =
++			(char*)virt_to_phys(skb->data);
++		np->dma_rx_descr_list[i].descr.after =
++		    (char*)virt_to_phys(skb->data + MAX_MEDIA_DATA_SIZE);
++
++		np->dma_rx_descr_list[i].descr.eol = 0;
++		np->dma_rx_descr_list[i].descr.in_eop = 0;
++		np->dma_rx_descr_list[i].descr.next =
++		    (void *) virt_to_phys(&np->dma_rx_descr_list[i + 1].descr);
++	}
++	/* bend the list into a ring */
++	np->dma_rx_descr_list[NBR_RX_DESC - 1].descr.next =
++		(void *) virt_to_phys(&np->dma_rx_descr_list[0].descr);
++
++	/* Initialize transmit descriptors. */
++	for (i = 0; i < NBR_TX_DESC; i++) {
++		np->dma_tx_descr_list[i].descr.wait = 1;
++		np->dma_tx_descr_list[i].descr.eol = 0;
++		np->dma_tx_descr_list[i].descr.out_eop = 0;
++		np->dma_tx_descr_list[i].descr.next =
++			(void*)virt_to_phys(&np->dma_tx_descr_list[i+1].descr);
++	}
++	/* bend the list into a ring */
++	np->dma_tx_descr_list[NBR_TX_DESC - 1].descr.next =
++		(void *) virt_to_phys(&np->dma_tx_descr_list[0].descr);
++
++	crisv32_eth_reset_rings(dev);
++}
++
++static void __init crisv32_init_leds(int ledgrp, struct net_device *dev)
++{
++	struct timer_list timer_init = TIMER_INITIALIZER(NULL, 0, 0);
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	/* Use already allocated led grp if initialized */
++	if (crisv32_leds[ledgrp] != NULL) {
++		np->leds = crisv32_leds[ledgrp];
++		return;
++	}
++
++	crisv32_leds[ledgrp] =
++		kmalloc(sizeof(struct crisv32_eth_leds), GFP_KERNEL);
++
++	crisv32_leds[ledgrp]->ledgrp = ledgrp;
++	crisv32_leds[ledgrp]->led_active = 0;
++	crisv32_leds[ledgrp]->ifisup[0] = 0;
++	crisv32_leds[ledgrp]->ifisup[1] = 0;
++	/* NOTE: Should this value be set to zero as the jiffies timer
++	   can wrap? */
++	crisv32_leds[ledgrp]->led_next_time = jiffies;
++
++	crisv32_leds[ledgrp]->clear_led_timer = timer_init;
++	crisv32_leds[ledgrp]->clear_led_timer.function =
++		crisv32_clear_network_leds;
++	crisv32_leds[ledgrp]->clear_led_timer.data = (unsigned long) dev;
++
++	spin_lock_init(&crisv32_leds[ledgrp]->led_lock);
++
++	np->leds = crisv32_leds[ledgrp];
++}
++
++static int __init crisv32_ethernet_init(void)
++{
++	struct crisv32_ethernet_local *np;
++	int ret = 0;
++
++#ifdef CONFIG_ETRAXFS
++	printk("ETRAX FS 10/100MBit ethernet v0.01 (c)"
++	       " 2003 Axis Communications AB\n");
++#else
++	printk("ARTPEC-3 10/100 MBit ethernet (c)"
++	       " 2003-2009 Axis Communications AB\n");
++#endif
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	{
++		reg_clkgen_rw_clk_ctrl clk_ctrl = REG_RD(clkgen, regi_clkgen,
++							 rw_clk_ctrl);
++		clk_ctrl.eth = clk_ctrl.dma0_1_eth = regk_clkgen_yes;
++		REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl);
++	}
++#endif
++{
++	int iface0 = 0;
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	if (crisv32_pinmux_alloc_fixed(pinmux_eth))
++		panic("Eth pinmux\n");
++#endif
++
++	if (!(crisv32_dev[iface0] = alloc_etherdev(sizeof *np)))
++		return -ENOMEM;
++
++	ret |= crisv32_ethernet_device_init(crisv32_dev[iface0]);
++
++#if defined(CONFIG_ETRAX_ETH0_USE_LEDGRP0)
++	crisv32_init_leds(CRIS_LED_GRP_0,crisv32_dev[iface0]);
++#elif defined(CONFIG_ETRAX_ETH0_USE_LEDGRP1)
++	crisv32_init_leds(CRIS_LED_GRP_1,crisv32_dev[iface0]);
++#else
++	crisv32_init_leds(CRIS_LED_GRP_NONE,crisv32_dev[iface0]);
++#endif
++
++	np = (struct crisv32_ethernet_local *) netdev_priv(crisv32_dev[iface0]);
++	np->eth_inst = regi_eth0;
++	np->dma_out_inst = regi_dma0;
++	np->dma_in_inst = regi_dma1;
++
++	np->mii_if.dev = crisv32_dev[iface0];
++	np->mii_if.mdio_read = crisv32_eth_get_mdio_reg;
++	np->mii_if.mdio_write = crisv32_eth_set_mdio_reg;
++	np->mii_if.phy_id_mask = 0x1f;
++	np->mii_if.reg_num_mask = 0x1f;
++
++	np->use_leds = 1;
++	np->autoneg_normal = 1;
++
++
++	register_netdev(crisv32_dev[iface0]);
++
++	/* Set up default MAC address */
++	memcpy(crisv32_dev[iface0]->dev_addr, default_mac_iface0.sa_data, 6);
++	crisv32_eth_set_mac_address(crisv32_dev[iface0], &default_mac_iface0);
++	if (crisv32_eth_request_irqdma(crisv32_dev[iface0]))
++		printk("%s: eth0 unable to allocate IRQ and DMA resources\n",
++		       __func__);
++	np->txpackets = 0;
++	crisv32_eth_init_rings(crisv32_dev[iface0]);
++	crisv32_eth_setup_controller(crisv32_dev[iface0]);
++	ret |= crisv32_eth_init_phy(crisv32_dev[iface0]);
++	if (ret) {
++		unregister_netdev(crisv32_dev[iface0]);
++		return ret;
++	}
++}
++
++#ifdef CONFIG_ETRAX_ETHERNET_IFACE1
++{
++	int iface1 = 0;
++	/* Default MAC address for interface 1.
++	 * The real one will be set later. */
++	static struct sockaddr default_mac_iface1 =
++		{0, {0x00, 0x40, 0x8C, 0xCD, 0x00, 0x01}};
++
++	if (crisv32_pinmux_alloc_fixed(pinmux_eth1))
++		panic("Eth pinmux\n");
++
++	/* Increase index to device array if interface 0 is enabled as well.*/
++#ifdef CONFIG_ETRAX_ETHERNET_IFACE0
++	iface1++;
++#endif
++	if (!(crisv32_dev[iface1] = alloc_etherdev(sizeof *np)))
++		return -ENOMEM;
++
++	ret |= crisv32_ethernet_device_init(crisv32_dev[iface1]);
++
++#if defined(CONFIG_ETRAX_ETH1_USE_LEDGRP0)
++	crisv32_init_leds(CRIS_LED_GRP_0,crisv32_dev[iface1]);
++#elif defined(CONFIG_ETRAX_ETH1_USE_LEDGRP1)
++	crisv32_init_leds(CRIS_LED_GRP_1,crisv32_dev[iface1]);
++#else
++	crisv32_init_leds(CRIS_LED_GRP_NONE,crisv32_dev[iface1]);
++#endif
++
++	np = (struct crisv32_ethernet_local *) netdev_priv(crisv32_dev[iface1]);
++	np->eth_inst = regi_eth1;
++	np->dma_out_inst = regi_dma6;
++	np->dma_in_inst = regi_dma7;
++
++	np->mii_if.dev = crisv32_dev[iface1];
++	np->mii_if.mdio_read = crisv32_eth_get_mdio_reg;
++	np->mii_if.mdio_write = crisv32_eth_set_mdio_reg;
++	np->mii_if.phy_id_mask = 0x1f;
++	np->mii_if.reg_num_mask = 0x1f;
++
++
++	register_netdev(crisv32_dev[iface1]);
++
++	/* Set up default MAC address */
++	memcpy(crisv32_dev[iface1]->dev_addr, default_mac_iface1.sa_data, 6);
++	crisv32_eth_set_mac_address(crisv32_dev[iface1], &default_mac_iface1);
++
++	if (crisv32_eth_request_irqdma(crisv32_dev[iface1]))
++		printk("%s: eth1 unable to allocate IRQ and DMA resources\n",
++		       __func__);
++	np->txpackets = 0;
++	crisv32_eth_init_rings(crisv32_dev[iface1]);
++	crisv32_eth_setup_controller(crisv32_dev[iface1]);
++	ret |= crisv32_eth_init_phy(crisv32_dev[iface1]);
++	if (ret) {
++		unregister_netdev(crisv32_dev[iface1]);
++		return ret;
++	}
++}
++#endif /* CONFIG_ETRAX_ETHERNET_IFACE1 */
++
++#ifdef CONFIG_CPU_FREQ
++	cpufreq_register_notifier(&crisv32_ethernet_freq_notifier_block,
++				  CPUFREQ_TRANSITION_NOTIFIER);
++#endif
++
++	return ret;
++}
++
++static struct net_device_ops crisv32_netdev_ops = {
++	.ndo_open = crisv32_eth_open,
++	.ndo_stop = crisv32_eth_close,
++	.ndo_start_xmit = crisv32_eth_send_packet,
++	.ndo_set_rx_mode = crisv32_eth_set_rx_mode,
++	.ndo_validate_addr = eth_validate_addr,
++	.ndo_set_mac_address = crisv32_eth_set_mac_address,
++	.ndo_do_ioctl =crisv32_eth_ioctl,
++	.ndo_get_stats = crisv32_get_stats,
++	.ndo_tx_timeout = crisv32_eth_do_tx_recovery,
++	.ndo_set_config = crisv32_eth_set_config,
++};
++
++static int __init crisv32_ethernet_device_init(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np;
++	struct timer_list timer_init = TIMER_INITIALIZER(NULL, 0, 0);
++
++	dev->base_addr = 0;	/* Just to have something to show. */
++
++	/* we do our own locking */
++	dev->features |= NETIF_F_LLTX;
++
++	/* We use several IRQs and DMAs so just report 0 here. */
++	dev->irq = 0;
++	dev->dma = 0;
++
++	/*
++	 * Fill in our handlers so the network layer can talk to us in the
++	 * future.
++	 */
++	dev->netdev_ops = &crisv32_netdev_ops;
++	dev->ethtool_ops = &crisv32_ethtool_ops;
++	dev->watchdog_timeo = HZ * 10;
++#ifdef CONFIG_NET_POLL_CONTROLLER
++	dev->poll_controller = crisv32_netpoll;
++#endif
++	np = netdev_priv(dev);
++	np->dev = dev;
++
++	/*
++	 * 8 skbs keeps the system very reponsive even under high load.
++	 * At 64 the system locks, pretty much the same way as without NAPI.
++	 *
++	 * TODO: meassure with 2 interfaces
++	 */
++	netif_napi_add(dev, &np->napi, crisv32_eth_poll, 8);
++
++	spin_lock_init(&np->lock);
++	spin_lock_init(&np->transceiver_lock);
++
++	np->receive_timer = timer_init;
++	np->receive_timer.data = (unsigned)dev;
++	np->receive_timer.function = receive_timeout;
++
++	INIT_WORK(&np->receive_work, receive_timeout_work);
++
++	np->transmit_timer = timer_init;
++	np->transmit_timer.data = (unsigned)dev;
++	np->transmit_timer.function = transmit_timeout;
++
++	return 0;
++}
++
++static int crisv32_eth_open(struct net_device *dev)
++{
++	struct sockaddr mac_addr;
++	reg_dma_rw_ack_intr ack_intr = { .data = 1, .in_eop = 1 };
++	reg_eth_rw_clr_err clr_err = {.clr = regk_eth_yes};
++	/*
++	 * dont interrupt us at any stat counter thresholds, only at urun
++	 * and exc_col.
++	 */
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	/* For Artpec-3 we use overrun to workaround voodoo TR 87 */
++	int intr_mask_nw = 0x1c00;
++#else
++	int intr_mask_nw = 0x1800;
++#endif
++	int eth_ack_intr = 0xffff;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	spin_lock(&np->lock);
++	crisv32_eth_set_gigabit(np, 0);
++
++	crisv32_disable_tx_ints(np);
++	crisv32_disable_rx_ints(np);
++
++	REG_WR(eth, np->eth_inst, rw_clr_err, clr_err);
++	REG_WR_INT(eth, np->eth_inst, rw_ack_intr, eth_ack_intr);
++	REG_WR_INT(eth, np->eth_inst, rw_intr_mask, intr_mask_nw);
++	crisv32_eth_reset_rings(dev);
++
++	/* Give the hardware an idea of what MAC address we want. */
++	memcpy(mac_addr.sa_data, dev->dev_addr, dev->addr_len);
++	crisv32_eth_set_mac_address(dev, &mac_addr);
++
++	/* Enable irq and make sure that the irqs are cleared. */
++	REG_WR(dma, np->dma_out_inst, rw_ack_intr, ack_intr);
++	REG_WR(dma, np->dma_in_inst, rw_ack_intr, ack_intr);
++
++	crisv32_disconnect_eth_rx_dma(np);
++
++	/* Prepare input DMA. */
++	DMA_RESET(np->dma_in_inst);
++	DMA_ENABLE(np->dma_in_inst);
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	DMA_WR_CMD(np->dma_in_inst, regk_dma_set_w_size2);
++#endif
++	DMA_START_CONTEXT(np->dma_in_inst, virt_to_phys(&np->ctxt_in));
++	DMA_CONTINUE(np->dma_in_inst);
++	crisv32_enable_rx_ints(np);
++	crisv32_start_receiver(np);
++
++	/* Prepare output DMA. */
++	DMA_RESET(np->dma_out_inst);
++	DMA_ENABLE(np->dma_out_inst);
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	DMA_WR_CMD(np->dma_out_inst, regk_dma_set_w_size4);
++#endif
++	crisv32_connect_eth_rx_dma(np);
++
++	netif_start_queue(dev);
++	crisv32_enable_tx_ints(np);
++
++	if (!np->fixed_phy) {
++		/* Start duplex/speed timers */
++		if (!timer_pending(&np->speed_timer))
++			add_timer(&np->speed_timer);
++		if (!timer_pending(&np->duplex_timer))
++			add_timer(&np->duplex_timer);
++	}
++
++	spin_unlock(&np->lock);
++	/*
++	 * We are now ready to accept transmit requests from the queueing
++	 * layer of the networking.
++	 */
++	np->link = 1;
++	netif_carrier_on(dev);
++	napi_enable(&np->napi);
++
++	return 0;
++}
++
++static int crisv32_eth_close(struct net_device *dev)
++{
++	reg_dma_rw_ack_intr ack_intr = {0};
++
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	unsigned long flags;
++
++	del_timer(&np->transmit_timer);
++	spin_lock_irqsave(&np->lock, flags);
++
++	/* stop the receiver before the DMA channels to avoid overruns. */
++	crisv32_disable_rx_ints(np);
++	napi_disable(&np->napi);
++	crisv32_stop_receiver(np);
++
++	netif_stop_queue(dev);
++
++	/* Reset the TX DMA in case it has hung on something. */
++	DMA_RESET(np->dma_in_inst);
++
++	/* Stop DMA */
++	DMA_STOP(np->dma_in_inst);
++	DMA_STOP(np->dma_out_inst);
++
++	/* Disable irq and make sure that the irqs are cleared. */
++	crisv32_disable_tx_ints(np);
++	ack_intr.data = 1;
++	REG_WR(dma, np->dma_out_inst, rw_ack_intr, ack_intr);
++
++	ack_intr.in_eop = 1;
++	REG_WR(dma, np->dma_in_inst, rw_ack_intr, ack_intr);
++
++	np->sender_started = 0;
++	spin_unlock_irqrestore(&np->lock, flags);
++
++	/* Update the statistics. */
++	update_rx_stats(np);
++	update_tx_stats(np);
++
++	if (!np->fixed_phy) {
++		/* Stop speed/duplex timers */
++		del_timer(&np->speed_timer);
++		del_timer(&np->duplex_timer);
++	}
++
++	return 0;
++}
++
++static int crisv32_eth_set_mac_address(struct net_device *dev, void *vpntr)
++{
++	int i;
++	static int first = 1;
++
++	unsigned char *addr = ((struct sockaddr*)vpntr)->sa_data;
++
++	reg_eth_rw_ma0_lo ma0_lo =
++	  { addr[0] | (addr[1] << 8) | (addr[2] << 16) | (addr[3] << 24)};
++
++	reg_eth_rw_ma0_hi ma0_hi = { addr[4] | (addr[5] << 8) };
++
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	/* Remember the address. */
++	memcpy(dev->dev_addr, addr, dev->addr_len);
++
++	/*
++	 * Write the address to the hardware.
++	 * Note the way the address is wrapped:
++	 * ma0_l0 = a0_0 | (a0_1 << 8) | (a0_2 << 16) | (a0_3 << 24);
++	 * ma0_hi = a0_4 | (a0_5 << 8);
++	 */
++	REG_WR(eth, np->eth_inst, rw_ma0_lo, ma0_lo);
++	REG_WR(eth, np->eth_inst, rw_ma0_hi, ma0_hi);
++
++	if (first) {
++		printk(KERN_INFO "%s: changed MAC to ", dev->name);
++
++		for (i = 0; i < 5; i++)
++			printk("%02X:", dev->dev_addr[i]);
++		printk("%02X\n", dev->dev_addr[i]);
++
++		first = 0;
++	}
++
++	return 0;
++}
++
++static irqreturn_t crisv32rx_eth_interrupt(int irq, void *dev_id)
++{
++	struct net_device *dev = (struct net_device *) dev_id;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	reg_dma_r_masked_intr masked_in;
++
++	masked_in = REG_RD(dma, np->dma_in_inst, r_masked_intr);
++
++	if (masked_in.in_eop) {
++		reg_dma_rw_ack_intr ack_intr = {0};
++
++		/*
++		 * Ack the rx irq even if we are not prepared to start
++		 * polling. This is needed to handle incomming packets
++		 * during the stop sequence.
++		 */
++		ack_intr.in_eop = 1;
++		REG_WR(dma, np->dma_in_inst, rw_ack_intr, ack_intr);
++
++		mod_timer(&np->receive_timer, jiffies + HZ);
++		np->do_rx_recovery = 0;
++
++		if (napi_schedule_prep(&np->napi)) {
++			crisv32_disable_rx_ints(np);
++			crisv32_disable_tx_ints(np);
++			/* put us onto the poll list */
++			__napi_schedule(&np->napi);
++		}
++	} else {
++		/* Unexpected, ACK it and hope for the best.  */
++		reg_dma_rw_ack_intr ack_intr = {
++			.group = 1,
++			.ctxt = 1,
++			.data = 1,
++			.in_eop = 0,
++			.stream_cmd = 1,
++			.dummy1 = ~0
++		};
++		REG_WR(dma, np->dma_in_inst, rw_ack_intr, ack_intr);
++	}
++
++	return IRQ_HANDLED;
++}
++
++static inline void crisv32_eth_roll_tx_timer(struct crisv32_ethernet_local *np)
++{
++	/* If there are more packets in the ring, roll the tx timer.  */
++	if (np->txpackets) {
++		/* Eth pause frames may halt us for up to 320ms (100mbit).  */
++		unsigned long timeout = jiffies + (HZ / 3) + 1;
++		mod_timer(&np->transmit_timer, timeout);
++	}
++	else
++		del_timer(&np->transmit_timer);
++}
++
++/* Call with np->lock held.  */
++static void _crisv32_tx_ring_advance(struct crisv32_ethernet_local *np,
++				     int cleanup)
++{
++	reg_dma_rw_stat stat;
++	dma_descr_data *dma_pos;
++	struct net_device *dev = np->dev;
++	int eol;
++
++	/* Get the current output dma position. */
++	dma_pos = phys_to_virt(REG_RD_INT(dma, np->dma_out_inst, rw_data));
++	stat = REG_RD(dma, np->dma_out_inst, rw_stat);
++	eol = stat.list_state == regk_dma_data_at_eol;
++	if (cleanup || eol)
++		dma_pos = &np->active_tx_desc->descr;
++
++	/* Take care of transmited dma descriptors and report sent packet. */
++	while (np->txpackets && (&np->catch_tx_desc->descr != dma_pos)) {
++		/* Update sent packet statistics. */
++		np->stats.tx_bytes += np->catch_tx_desc->skb->len;
++		np->stats.tx_packets++;
++
++		dev_kfree_skb_any(np->catch_tx_desc->skb);
++		np->catch_tx_desc->skb = 0;
++		np->txpackets--;
++		np->catch_tx_desc->descr.buf = 0;
++		np->catch_tx_desc =
++			phys_to_virt((int)np->catch_tx_desc->descr.next);
++		np->do_tx_recovery = 0;
++		np->retrans = 0;
++
++		netif_wake_queue(dev);
++	}
++}
++
++static inline void crisv32_tx_ring_advance(struct crisv32_ethernet_local *np)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&np->lock, flags);
++	_crisv32_tx_ring_advance(np, 0);
++	crisv32_eth_roll_tx_timer(np);
++	spin_unlock_irqrestore(&np->lock, flags);
++}
++
++static inline int crisv32_tx_complete(struct crisv32_ethernet_local *np)
++{
++	reg_dma_rw_ack_intr ack_intr = { .data = 1 };
++	reg_dma_r_intr ints;
++	int r = 0;
++
++	/* We are interested in the unmasked raw interrupt source here. When
++	   polling with tx interrupts masked off we still want to do
++	   tx completition when the DMA makes progress.  */
++	ints = REG_RD(dma, np->dma_out_inst, r_intr);
++	if (ints.data)
++	{
++		/* ack the interrupt, if it was active */
++		REG_WR(dma, np->dma_out_inst, rw_ack_intr, ack_intr);
++		crisv32_tx_ring_advance(np);
++		r = 1;
++	}
++	return r;
++}
++
++static irqreturn_t crisv32tx_eth_interrupt(int irq, void *dev_id)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev_id);
++
++	crisv32_tx_complete(np);
++	return IRQ_HANDLED;
++}
++
++
++/* Update receive errors. */
++static void
++update_rx_stats(struct crisv32_ethernet_local *np)
++{
++	reg_eth_rs_rec_cnt r;
++
++	r = REG_RD(eth, np->eth_inst, rs_rec_cnt);
++
++	np->stats.rx_over_errors += r.congestion;
++	np->stats.rx_crc_errors += r.crc_err;
++	np->stats.rx_frame_errors += r.align_err;
++	np->stats.rx_length_errors += r.oversize;
++	np->stats.rx_errors += r.crc_err + r.align_err +
++			r.oversize + r.congestion;
++}
++
++/* Update transmit errors. */
++static void update_tx_stats(struct crisv32_ethernet_local *np)
++{
++	reg_eth_rs_tr_cnt r;
++	reg_eth_rs_phy_cnt rp;
++
++	r = REG_RD(eth, np->eth_inst, rs_tr_cnt);
++	rp = REG_RD(eth, np->eth_inst, rs_phy_cnt);
++
++	/* r.deferred is not good for counting collisions because it also
++	   includes frames that have to wait for the interframe gap. That
++	   means we get deferred frames even when in full duplex.
++	   Here we don't actually count the number of collisions that
++	   occured (artpec3 seems to lack such a counter), instead we count
++	   the number of frames that collide once or more.  */
++	np->stats.collisions += r.mult_col + r.single_col;
++	np->stats.tx_window_errors += r.late_col;
++	np->stats.tx_carrier_errors += rp.carrier_loss;
++
++	/* Ordinary collisions are not errors, they are just part of
++	   ethernet's bus arbitration and congestion control mechanisms.
++	   Late collisions are serious errors though.  */
++	np->stats.tx_errors += r.late_col;
++}
++
++/* Get current statistics. */
++static struct net_device_stats *crisv32_get_stats(struct net_device *dev)
++{
++	unsigned long flags;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	spin_lock_irqsave(&np->lock, flags);
++
++	update_rx_stats(np);
++	update_tx_stats(np);
++
++	spin_unlock_irqrestore(&np->lock, flags);
++
++	return &np->stats;
++}
++
++/* Check for network errors. This acknowledge the received interrupt. */
++static irqreturn_t crisv32nw_eth_interrupt(int irq, void *dev_id)
++{
++	struct net_device *dev = (struct net_device *) dev_id;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	reg_eth_r_masked_intr intr_mask;
++	int ack_intr = 0xffff;
++	reg_eth_rw_clr_err clr_err;
++
++	intr_mask = REG_RD(eth, np->eth_inst, r_masked_intr);
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	/* Only apply the workaround if it is not already pending.
++	   enable_eth_ints will re-enable the orun interrupt regardless
++	   of pending_overrun.  */
++	if (intr_mask.orun && !np->pending_overrun) {
++		reg_eth_rw_rec_ctrl rec_ctrl =
++			REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++		np->saved_rec_ctrl = rec_ctrl;
++		np->overrun_set = 1;
++		DMA_STOP(np->dma_in_inst);
++		rec_ctrl.ma0 = regk_eth_no;
++		rec_ctrl.broadcast = regk_eth_no;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++		np->saved_ga_lo = REG_RD_INT(eth, np->eth_inst, rw_ga_lo);
++		np->saved_ga_hi = REG_RD_INT(eth, np->eth_inst, rw_ga_hi);
++		REG_WR_INT(eth, np->eth_inst, rw_ga_lo, 0);
++		REG_WR_INT(eth, np->eth_inst, rw_ga_hi, 0);
++		REG_WR_INT(eth, np->eth_inst, rw_intr_mask,
++			REG_RD_INT(eth, np->eth_inst, rw_intr_mask) & 0xfbff);
++		REG_WR_INT(eth, np->eth_inst, rw_ack_intr, 0x400);
++		intr_mask.orun = 0;
++		np->pending_overrun = 1;
++		if (!np->napi_processing)
++			crisv32_eth_restart_rx_dma(np->dev, np);
++
++		return IRQ_HANDLED;
++	}
++#endif
++
++	/*
++	 * Check for underrun and/or excessive collisions. Note that the
++	 * rw_clr_err register clears both underrun and excessive collision
++	 * errors, so there's no need to check them separately.
++	 */
++	if (np->sender_started
++	    && (intr_mask.urun || intr_mask.exc_col)) {
++		unsigned long flags;
++
++		/* Underrun are considered to be tx-errors.  */
++		np->stats.tx_errors += intr_mask.urun;
++		np->stats.tx_fifo_errors += intr_mask.urun;
++
++		/*
++		 * Protect against the tx-interrupt messing with
++		 * the tx-ring.
++		 */
++		spin_lock_irqsave(&np->lock, flags);
++
++		/* DMA should have stopped now, eat from the ring before
++		   removing anything due to tx errors.  */
++		_crisv32_tx_ring_advance(np, 0);
++
++		/*
++		 * Drop packets after 15 retries.
++		 * TODO: Add backoff.
++		 */
++		if (np->retrans > 15 && np->txpackets) {
++			dev_kfree_skb_irq(np->catch_tx_desc->skb);
++			np->catch_tx_desc->skb = 0;
++			np->catch_tx_desc->descr.buf = 0;
++			np->catch_tx_desc =
++				phys_to_virt((int)
++					     np->catch_tx_desc->descr.next);
++			flush_dma_descr(&np->catch_tx_desc->descr, 0);
++
++			np->txpackets--;
++			np->retrans = 0;
++			netif_wake_queue(dev);
++			np->stats.tx_dropped++;
++		}
++		np->ctxt_out.next = 0;
++		if (np->txpackets) {
++			np->retrans++;
++			np->ctxt_out.saved_data = (void *)
++				virt_to_phys(&np->catch_tx_desc->descr);
++			np->ctxt_out.saved_data_buf =
++				np->catch_tx_desc->descr.buf;
++			WARN_ON(!np->ctxt_out.saved_data_buf);
++			flush_dma_descr(&np->catch_tx_desc->descr, 0);
++			cris_flush_cache_range(&np->ctxt_out,
++					       sizeof np->ctxt_out);
++
++			/* restart the DMA */
++			DMA_START_CONTEXT(np->dma_out_inst,
++					  (int) virt_to_phys(&np->ctxt_out));
++			np->sender_started = 1;
++		}
++		else {
++			/* Load dummy context but do not load the data
++			   descriptor nor start the burst. This brings the
++			   buggy eth transmitter back in sync with the DMA
++			   avoiding malformed frames.  */
++			REG_WR(dma, np->dma_out_inst, rw_group_down,
++			       (int) virt_to_phys(&np->ctxt_out));
++			DMA_WR_CMD(np->dma_out_inst, regk_dma_load_c);
++			np->sender_started = 0;
++		}
++		crisv32_eth_roll_tx_timer(np);
++		spin_unlock_irqrestore(&np->lock, flags);
++	}
++
++	ack_intr = *(u32 *)&intr_mask;
++	REG_WR_INT(eth, np->eth_inst, rw_ack_intr, ack_intr);
++	clr_err.clr = 1;
++	REG_WR(eth, np->eth_inst, rw_clr_err, clr_err);
++
++	update_rx_stats(np);
++	update_tx_stats(np);
++
++	return IRQ_HANDLED;
++}
++
++/* We have a good packet(s), get it/them out of the buffers. */
++static int crisv32_eth_receive_packet(struct net_device *dev)
++{
++	int length;
++	struct sk_buff *skb;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	struct sk_buff *tmp;
++	unsigned long flags;
++
++	DEBUG(printk("crisv32_receive_packet\n"));
++
++	/* Roll the rx bug timer.  */
++	mod_timer(&np->receive_timer, jiffies + HZ);
++
++	/* Activate LED */
++	spin_lock_irqsave(&np->leds->led_lock, flags);
++	if (!np->leds->led_active && time_after(jiffies,
++						np->leds->led_next_time)) {
++		/* light the network leds depending on the current speed. */
++		crisv32_set_network_leds(CRIS_LED_ACTIVITY, dev);
++
++		/* Set the earliest time we may clear the LED */
++		np->leds->led_next_time = jiffies + NET_FLASH_TIME;
++		np->leds->led_active = 1;
++		np->leds->clear_led_timer.data = (unsigned long) dev;
++		mod_timer(&np->leds->clear_led_timer, jiffies + HZ/10);
++	}
++	spin_unlock_irqrestore(&np->leds->led_lock, flags);
++
++	/* Discard CRC (4 bytes). */
++	length = (np->active_rx_desc->descr.after) -
++		(np->active_rx_desc->descr.buf) - 4;
++
++	tmp = dev_alloc_skb(MAX_MEDIA_DATA_SIZE);
++	if (!tmp) {
++		np->stats.rx_errors++;
++		printk(KERN_NOTICE "%s: memory squeeze,"
++		       " dropping packet.",
++		       dev->name);
++		return 0;
++	}
++	skb = np->active_rx_desc->skb;
++	np->active_rx_desc->skb = tmp;
++	skb_put(skb, length);
++
++	np->newbuf = virt_to_phys(np->active_rx_desc->skb->data);
++
++	skb->dev = dev;
++	skb->protocol = eth_type_trans(skb, dev);
++	skb->ip_summed = CHECKSUM_NONE;
++
++	np->stats.multicast += skb->pkt_type == PACKET_MULTICAST;
++	/* Send the packet to the upper layer. */
++	netif_receive_skb(skb);
++	np->last_rx_desc =
++		phys_to_virt((int)
++			     np->last_rx_desc->descr.next);
++
++	/* Forward rotate the receive ring.  */
++	crisv32_eth_rx_ring_advance(np);
++	return length;
++}
++
++/* Must be called with the np-lock held.  */
++static void
++__crisv32_eth_restart_rx_dma(struct net_device* dev,
++			     struct crisv32_ethernet_local *np)
++{
++	reg_dma_rw_ack_intr ack_intr = {0};
++	reg_dma_rw_stream_cmd dma_sc = {0};
++	reg_dma_rw_stat stat;
++	int resets = 0;
++	reg_eth_rw_intr_mask eth_intr_mask;
++
++	np->rx_dma_restarts++;
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	if (np->pending_overrun) {
++		np->pending_overrun = 0;
++		REG_WR_INT(eth, np->eth_inst, rw_ga_lo, np->saved_ga_lo);
++		REG_WR_INT(eth, np->eth_inst, rw_ga_hi, np->saved_ga_hi);
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, np->saved_rec_ctrl);
++		REG_WR_INT(eth, np->eth_inst, rw_intr_mask,
++			   REG_RD_INT(eth, regi_eth, rw_intr_mask) | 0x400);
++		DMA_CONTINUE(np->dma_in_inst);
++	}
++#endif
++	/* Bring down the receiver.  */
++	crisv32_disable_rx_ints(np);
++	crisv32_disconnect_eth_rx_dma(np);
++
++	/* Stop DMA and ack possible ints.  */
++	DMA_STOP(np->dma_in_inst);
++	ack_intr.in_eop = 1;
++	REG_WR(dma, np->dma_in_inst, rw_ack_intr, ack_intr);
++
++	crisv32_stop_receiver(np);
++
++	/* Disable overrun interrupts while receive is shut off. */
++	eth_intr_mask = REG_RD(eth, np->eth_inst, rw_intr_mask);
++	eth_intr_mask.orun = regk_eth_no;
++	REG_WR(eth, np->eth_inst, rw_intr_mask, eth_intr_mask);
++	/* ACK overrun.  */
++	REG_WR_INT(eth, np->eth_inst, rw_ack_intr, 0x400);
++
++	crisv32_eth_reset_rx_ring(dev);
++  reset:
++	/* TODO: if nr resets grows to high we should reboot.  */
++	if (resets++ > 0)
++		printk("reset DMA %d.\n", resets);
++
++	DMA_RESET(np->dma_in_inst);
++	/* Wait for the channel to reset.  */
++	do {
++		stat = REG_RD(dma, np->dma_in_inst, rw_stat);
++	} while (stat.mode != regk_dma_rst);
++
++	/* Now bring the rx path back up.  */
++	DMA_ENABLE(np->dma_in_inst);
++	if (dma_wait_busy(np->dma_in_inst, 100))
++		goto reset;
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++//	DMA_WR_CMD(np->dma_in_inst, regk_dma_set_w_size2);
++	dma_sc.cmd = (regk_dma_set_w_size2);
++	REG_WR(dma, np->dma_in_inst, rw_stream_cmd, dma_sc);
++	if (dma_wait_busy(np->dma_in_inst, 100))
++		goto reset;
++#endif
++
++//	DMA_START_CONTEXT(np->dma_in_inst, virt_to_phys(&np->ctxt_in));
++	REG_WR_INT(dma, np->dma_in_inst, rw_group_down, (int)&np->ctxt_in);
++
++//	DMA_WR_CMD(np->dma_in_inst, regk_dma_load_c);
++	dma_sc.cmd = (regk_dma_load_c);
++	REG_WR(dma, np->dma_in_inst, rw_stream_cmd, dma_sc);
++	if (dma_wait_busy(np->dma_in_inst, 100))
++		goto reset;
++
++//	DMA_WR_CMD(np->dma_in_inst, regk_dma_load_d | regk_dma_burst);
++	dma_sc.cmd = (regk_dma_load_d | regk_dma_burst);
++	REG_WR(dma, np->dma_in_inst, rw_stream_cmd, dma_sc);
++
++	if (dma_wait_busy(np->dma_in_inst, 100))
++		goto reset;
++
++	/* Now things get critical again. Don't give us any interrupts until
++	   the following sequence is complete.  */
++	DMA_CONTINUE(np->dma_in_inst);
++	np->overrun_set = 0;
++	crisv32_enable_rx_ints(np);
++	crisv32_start_receiver(np);
++
++	/* Reenable overrun interrupts when receive is started again. */
++	eth_intr_mask = REG_RD(eth, np->eth_inst, rw_intr_mask);
++	eth_intr_mask.orun = regk_eth_yes;
++	REG_WR(eth, np->eth_inst, rw_intr_mask, eth_intr_mask);
++
++	crisv32_connect_eth_rx_dma(np);
++}
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++static void
++crisv32_eth_restart_rx_dma(struct net_device* dev,
++			   struct crisv32_ethernet_local *np)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&np->lock, flags);
++	__crisv32_eth_restart_rx_dma(dev, np);
++	spin_unlock_irqrestore(&np->lock, flags);
++}
++#endif
++
++/*
++ * Is there work to do in the rx-path?
++ */
++static inline int crisv32_has_rx_work(struct crisv32_ethernet_local *np,
++				      dma_descr_data *active)
++{
++	int mw;
++	mw = (active->in_eop && np->new_rx_package);
++	return mw;
++}
++
++static void crisv32_eth_do_rx_recovery(struct net_device* dev,
++				       struct crisv32_ethernet_local *np)
++{
++	unsigned long flags;
++	static int r = 0;
++
++	r++;
++
++	/* Bring down the receiver.  */
++	spin_lock_irqsave(&np->lock, flags);
++	if (!np->do_rx_recovery)
++		goto done;
++
++	napi_disable(&np->napi);
++
++	np->rx_dma_timeouts++;
++
++	__crisv32_eth_restart_rx_dma(dev, np);
++
++	np->do_rx_recovery = 0;
++
++	napi_enable(&np->napi);
++  done:
++	spin_unlock_irqrestore(&np->lock, flags);
++
++	WARN_ON(r != 1);
++	r--;
++}
++
++static void receive_timeout_work(struct work_struct* work)
++{
++	struct dma_descr_data* descr;
++	struct dma_descr_data* descr2;
++	struct net_device* dev = crisv32_dev[0];
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	reg_eth_r_intr intr_mask;
++
++	descr = &np->active_rx_desc->descr;
++	descr2 = phys_to_virt(REG_RD_INT(dma, np->dma_in_inst, rw_data));
++
++	intr_mask = REG_RD(eth, np->eth_inst, r_intr);
++
++	if (!np->overrun_set
++	    && !intr_mask.orun
++	    && !descr->in_eop
++	    && !descr2->in_eop)
++		return;
++
++	crisv32_eth_do_rx_recovery(dev, np);
++}
++
++static void receive_timeout(unsigned long arg)
++{
++	struct net_device* dev = (struct net_device*)arg;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	np->do_rx_recovery++;
++	schedule_work(&np->receive_work);
++	mod_timer(&np->receive_timer, jiffies + 1*HZ);
++}
++
++static void transmit_timeout(unsigned long arg)
++{
++	struct net_device* dev = (struct net_device*)arg;
++	crisv32_eth_do_tx_recovery(dev);
++}
++
++/*
++ * NAPI poll
++ *
++ * We are allowed to pull up to budget number of frames from the rx ring.
++ * If we are done, remove us from the poll list and re-enable rx interrupts.
++ * Always return number of pulled frames from the rx ring.
++ */
++static int crisv32_eth_poll(struct napi_struct *napi, int budget)
++{
++	struct crisv32_ethernet_local *np;
++	int work_done = 0;
++	int morework;
++	int rx_bytes = 0;
++	reg_dma_rw_ack_intr ack_intr = {0};
++
++	np = container_of(napi, struct crisv32_ethernet_local, napi);
++	crisv32_disable_eth_ints(np);
++	np->napi_processing = 1;
++	ack_intr.in_eop = 1;
++
++	if (np->new_rx_package == 0) {
++		/*
++		 * In the previous round we pulled a packet from the ring but
++		 * we didn't advance the ring due to hw DMA bug. Try to do it
++		 * now.
++		 */
++		np->new_rx_package = 1;
++		crisv32_eth_rx_ring_advance(np);
++	}
++
++	morework = crisv32_has_rx_work(np, &np->active_rx_desc->descr);
++
++	/* See if tx needs attention.  */
++	crisv32_tx_complete(np);
++
++	while (morework)
++	{
++		rx_bytes += crisv32_eth_receive_packet(np->dev);
++		work_done++;
++
++		/* Ack irq and restart rx dma */
++		REG_WR(dma, np->dma_in_inst, rw_ack_intr, ack_intr);
++		DMA_CONTINUE_DATA(np->dma_in_inst);
++
++		if (unlikely(work_done >= budget))
++			break;
++
++		/* See if tx needs attention.  */
++		crisv32_tx_complete(np);
++
++		morework = crisv32_has_rx_work(np, &np->active_rx_desc->descr);
++	}
++	crisv32_enable_eth_ints(np);
++
++	if (!morework) {
++		np->napi_processing = 0;
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++		if (np->pending_overrun) {
++			crisv32_eth_restart_rx_dma(np->dev, np);
++		}
++#endif
++		if (irqs_disabled())
++			printk("WARNING: %s irqs disabled!\n", __func__);
++
++		if (work_done < budget) {
++			/* first mark as done, then enable irq's */
++			napi_complete(napi);
++			crisv32_enable_rx_ints(np);
++			crisv32_enable_tx_ints(np);
++		}
++	}
++	np->napi_processing = 0;
++
++	np->stats.rx_bytes += rx_bytes;
++	np->stats.rx_packets += work_done;
++	update_rx_stats(np);
++	return work_done;
++}
++
++/*
++ * This function (i.e. hard_start_xmit) is protected from concurent calls by a
++ * spinlock (xmit_lock) in the net_device structure.
++ */
++static int
++crisv32_eth_send_packet(struct sk_buff *skb, struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	unsigned char *buf = skb->data;
++	unsigned long flags;
++
++	/*
++	 * Need to disable irq to avoid updating pointer in interrupt while
++	 * sending packets.
++	 */
++	spin_lock_irqsave(&np->lock, flags);
++
++	np->active_tx_desc->skb = skb;
++	crisv32_eth_hw_send_packet(buf, skb->len, np);
++
++	dev->trans_start = jiffies;
++
++	/* Stop queue if full. */
++	if (crisv32_eth_tx_ring_full(np))
++		netif_stop_queue(dev);
++
++	np->txpackets++;
++	crisv32_eth_roll_tx_timer(np);
++	spin_unlock_irqrestore(&np->lock, flags);
++
++	spin_lock_irqsave(&np->leds->led_lock, flags);
++	if (!np->leds->led_active && time_after(jiffies,
++						np->leds->led_next_time)) {
++		/* light the network leds depending on the current speed. */
++		crisv32_set_network_leds(CRIS_LED_ACTIVITY, dev);
++
++		/* Set the earliest time we may clear the LED */
++		np->leds->led_next_time = jiffies + NET_FLASH_TIME;
++		np->leds->led_active = 1;
++		np->leds->clear_led_timer.data = (unsigned long) dev;
++		mod_timer(&np->leds->clear_led_timer, jiffies + HZ/10);
++	}
++	spin_unlock_irqrestore(&np->leds->led_lock, flags);
++
++	return 0;
++}
++
++
++static void
++crisv32_eth_hw_send_packet(unsigned char *buf, int length, void *priv)
++{
++	struct crisv32_ethernet_local *np =
++		(struct crisv32_ethernet_local *) priv;
++
++	/* Configure the tx dma descriptor. */
++	np->active_tx_desc->descr.buf = (unsigned char *)virt_to_phys(buf);
++
++	np->active_tx_desc->descr.after = np->active_tx_desc->descr.buf +
++		length;
++	np->active_tx_desc->descr.intr = 1;
++	np->active_tx_desc->descr.out_eop = 1;
++
++	/* Move eol. */
++	np->active_tx_desc->descr.eol = 1;
++	flush_dma_descr(&np->active_tx_desc->descr, 1);
++
++	if (np->sender_started)
++		WARN_ON(!np->prev_tx_desc->descr.eol);
++	np->prev_tx_desc->descr.eol = 0;
++	flush_dma_descr(&np->prev_tx_desc->descr, 0);
++
++	/* Update pointers. */
++	np->prev_tx_desc = np->active_tx_desc;
++	np->active_tx_desc = phys_to_virt((int)np->active_tx_desc->descr.next);
++
++	/* Start DMA. */
++	crisv32_start_dma_out(np);
++}
++
++static void crisv32_start_dma_out(struct crisv32_ethernet_local *np)
++{
++	if (!np->sender_started) {
++		/* Start DMA for the first time. */
++		np->ctxt_out.saved_data =
++			(void *)virt_to_phys(&np->prev_tx_desc->descr);
++		np->ctxt_out.saved_data_buf = np->prev_tx_desc->descr.buf;
++		WARN_ON(!np->ctxt_out.saved_data_buf);
++
++		cris_flush_cache_range(&np->ctxt_out, sizeof np->ctxt_out);
++		REG_WR(dma, np->dma_out_inst, rw_group_down,
++		       (int) virt_to_phys(&np->ctxt_out));
++		DMA_WR_CMD(np->dma_out_inst, regk_dma_load_c);
++		DMA_WR_CMD(np->dma_out_inst, regk_dma_load_d | regk_dma_burst);
++		np->sender_started = 1;
++	} else {
++		DMA_CONTINUE_DATA(np->dma_out_inst);
++	}
++}
++
++/*
++ * Bring the transmitter back to life.
++ */
++static void
++crisv32_eth_do_tx_recovery(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	reg_eth_rw_clr_err clr_err;
++	reg_dma_rw_stat stat = {0};
++	unsigned long flags;
++	/* ACK urun and exc_col.  */
++	int ack_intr = 0x1800;
++	int do_full;
++
++	/* Give the tx recovery some time without link state polling.  */
++	if (!np->fixed_phy)
++		mod_timer(&np->speed_timer, jiffies + 4 * HZ);
++
++	np->tx_dma_restarts++;
++
++	spin_lock_irqsave(&np->lock, flags);
++
++	do_full = 1;
++	update_tx_stats(np);
++
++	/* Cancel ongoing frame.  */
++	crisv32_eth_tx_cancel_frame(np);
++
++	/* In case TR 125 just hit us.  */
++	DMA_WR_CMD(np->dma_out_inst, regk_dma_ack_pkt);
++	dma_wait_busy(np->dma_out_inst, 100);
++
++	/* At this point, the transmit block should be idle or waiting for us
++	   to clear the excessive collision error. Let's reset the DMA.  */
++	DMA_STOP(np->dma_out_inst);
++
++	crisv32_disconnect_eth_tx_dma(np);
++
++	/* Eat from the tx ring.  */
++	_crisv32_tx_ring_advance(np, 1);
++	np->do_tx_recovery++;
++
++	DMA_RESET(np->dma_out_inst);
++	do {
++		stat = REG_RD(dma, np->dma_out_inst, rw_stat);
++	} while (stat.mode != regk_dma_rst);
++
++	/* Next packet will restart output DMA. */
++	np->sender_started = 0;
++
++	crisv32_enable_tx_ints(np);
++
++	DMA_ENABLE(np->dma_out_inst);
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	DMA_WR_CMD(np->dma_out_inst, regk_dma_set_w_size4);
++#endif
++	DMA_CONTINUE(np->dma_out_inst);
++
++	/* Clear pending errors.  */
++	REG_WR_INT(eth, np->eth_inst, rw_ack_intr, ack_intr);
++	clr_err.clr = 1;
++	REG_WR(eth, np->eth_inst, rw_clr_err, clr_err);
++
++	/* Do a full reset of the MAC block.  */
++	if (do_full) {
++		np->tx_mac_resets++;
++		crisv32_eth_reset(np);
++	}
++
++	crisv32_connect_eth_tx_dma(np);
++
++	if (np->txpackets) {
++		WARN_ON(!np->catch_tx_desc->skb);
++		np->catch_tx_desc->descr.intr = 1;
++		np->catch_tx_desc->descr.out_eop = 1;
++
++		/* Start DMA for the first time. */
++		np->ctxt_out.saved_data =
++			(void *)virt_to_phys(&np->catch_tx_desc->descr);
++		np->ctxt_out.saved_data_buf = np->catch_tx_desc->descr.buf;
++		WARN_ON(!np->ctxt_out.saved_data_buf);
++		flush_dma_descr(&np->catch_tx_desc->descr, 0);
++		cris_flush_cache_range(&np->ctxt_out, sizeof np->ctxt_out);
++
++		REG_WR(dma, np->dma_out_inst, rw_group_down,
++		       (int) virt_to_phys(&np->ctxt_out));
++		DMA_WR_CMD(np->dma_out_inst, regk_dma_load_c);
++		DMA_WR_CMD(np->dma_out_inst, regk_dma_load_d | regk_dma_burst);
++		crisv32_eth_roll_tx_timer(np);
++		np->sender_started = 1;
++	}
++
++	if (np->txpackets && crisv32_eth_tx_ring_full(np))
++		netif_stop_queue(dev);
++	else
++		netif_wake_queue(dev);
++
++	spin_unlock_irqrestore(&np->lock, flags);
++}
++
++/*
++ * Set or clear the multicast filter for this adaptor.
++ * num_addrs == -1	Promiscuous mode, receive all packets
++ * num_addrs == 0	Normal mode, clear multicast list
++ * num_addrs > 0	Multicast mode, receive normal and MC packets,
++ *			and do best-effort filtering.
++ */
++static void crisv32_eth_set_rx_mode(struct net_device *dev)
++{
++	int num_addr = netdev_mc_count(dev);
++	unsigned long int lo_bits;
++	unsigned long int hi_bits;
++	reg_eth_rw_rec_ctrl rec_ctrl = {0};
++	reg_eth_rw_ga_lo ga_lo = {0};
++	reg_eth_rw_ga_hi ga_hi = {0};
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	if (dev->flags & IFF_PROMISC) {
++		/* Promiscuous mode. */
++		lo_bits = 0xfffffffful;
++		hi_bits = 0xfffffffful;
++
++		/* Enable individual receive. */
++		rec_ctrl = (reg_eth_rw_rec_ctrl) REG_RD(eth, np->eth_inst,
++							rw_rec_ctrl);
++		rec_ctrl.individual = regk_eth_yes;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	} else if (dev->flags & IFF_ALLMULTI) {
++		/* Enable all multicasts. */
++		lo_bits = 0xfffffffful;
++		hi_bits = 0xfffffffful;
++
++		/* Disable individual receive */
++		rec_ctrl =
++		  (reg_eth_rw_rec_ctrl) REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++		rec_ctrl.individual = regk_eth_no;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	} else if (num_addr == 0) {
++		/* Normal, clear the mc list. */
++		lo_bits = 0x00000000ul;
++		hi_bits = 0x00000000ul;
++
++		/* Disable individual receive */
++		rec_ctrl =
++		  (reg_eth_rw_rec_ctrl) REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++		rec_ctrl.individual = regk_eth_no;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	} else {
++		/* MC mode, receive normal and MC packets. */
++		char hash_ix;
++		struct netdev_hw_addr *ha;
++		char *baddr;
++		lo_bits = 0x00000000ul;
++		hi_bits = 0x00000000ul;
++
++		netdev_for_each_mc_addr(ha, dev) {
++			/* Calculate the hash index for the GA registers. */
++			hash_ix = 0;
++			baddr = ha->addr;
++			hash_ix ^= (*baddr) & 0x3f;
++			hash_ix ^= ((*baddr) >> 6) & 0x03;
++			++baddr;
++			hash_ix ^= ((*baddr) << 2) & 0x03c;
++			hash_ix ^= ((*baddr) >> 4) & 0xf;
++			++baddr;
++			hash_ix ^= ((*baddr) << 4) & 0x30;
++			hash_ix ^= ((*baddr) >> 2) & 0x3f;
++			++baddr;
++			hash_ix ^= (*baddr) & 0x3f;
++			hash_ix ^= ((*baddr) >> 6) & 0x03;
++			++baddr;
++			hash_ix ^= ((*baddr) << 2) & 0x03c;
++			hash_ix ^= ((*baddr) >> 4) & 0xf;
++			++baddr;
++			hash_ix ^= ((*baddr) << 4) & 0x30;
++			hash_ix ^= ((*baddr) >> 2) & 0x3f;
++
++			hash_ix &= 0x3f;
++
++			if (hash_ix > 32)
++				hi_bits |= (1 << (hash_ix - 32));
++			else
++				lo_bits |= (1 << hash_ix);
++		}
++
++		/* Disable individual receive. */
++		rec_ctrl =
++		  (reg_eth_rw_rec_ctrl) REG_RD(eth, np->eth_inst, rw_rec_ctrl);
++		rec_ctrl.individual = regk_eth_no;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	}
++
++	ga_lo.table = (unsigned int) lo_bits;
++	ga_hi.table = (unsigned int) hi_bits;
++
++	REG_WR(eth, np->eth_inst, rw_ga_lo, ga_lo);
++	REG_WR(eth, np->eth_inst, rw_ga_hi, ga_hi);
++}
++
++static int
++crisv32_eth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
++{
++	struct mii_ioctl_data *data = if_mii(ifr);
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	int old_autoneg;
++	int rc = 0;
++
++	spin_lock(&np->lock); /* Preempt protection */
++	switch (cmd) {
++		case SET_ETH_ENABLE_LEDS:
++			np->use_leds = 1;
++			break;
++		case SET_ETH_DISABLE_LEDS:
++			np->use_leds = 0;
++			break;
++		case SET_ETH_AUTONEG:
++			old_autoneg = np->autoneg_normal;
++			np->autoneg_normal = *(int*)data;
++			if (np->autoneg_normal != old_autoneg)
++				crisv32_eth_negotiate(dev);
++			break;
++		default:
++			rc = generic_mii_ioctl(&np->mii_if,
++					       if_mii(ifr), cmd, NULL);
++			break;
++	}
++	spin_unlock(&np->lock);
++	return rc;
++}
++
++static int crisv32_eth_get_settings(struct net_device *dev,
++				    struct ethtool_cmd *cmd)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	int err;
++
++	spin_lock_irq(&np->lock);
++	err = mii_ethtool_gset(&np->mii_if, cmd);
++	spin_unlock_irq(&np->lock);
++
++	/* The PHY may support 1000baseT, but the EtraxFS does not.  */
++	cmd->supported &= ~(SUPPORTED_1000baseT_Half
++			    | SUPPORTED_1000baseT_Full);
++	return err;
++}
++
++static int crisv32_eth_set_settings(struct net_device *dev,
++				    struct ethtool_cmd *ecmd)
++{
++	if (ecmd->autoneg == AUTONEG_ENABLE) {
++		crisv32_eth_set_duplex(dev, autoneg);
++		crisv32_eth_set_speed(dev, 0);
++	} else {
++		crisv32_eth_set_duplex(dev, ecmd->duplex);
++		crisv32_eth_set_speed(dev, ecmd->speed);
++	}
++
++	return 0;
++}
++
++static void crisv32_eth_get_drvinfo(struct net_device *dev,
++				    struct ethtool_drvinfo *info)
++{
++#ifdef CONFIG_ETRAXFS
++	strncpy(info->driver, "ETRAX FS", sizeof(info->driver) - 1);
++#else
++	strncpy(info->driver, "ARTPEC-3", sizeof(info->driver) - 1);
++#endif
++	strncpy(info->version, "$Revision: 1.197 $", sizeof(info->version) - 1);
++	strncpy(info->fw_version, "N/A", sizeof(info->fw_version) - 1);
++	strncpy(info->bus_info, "N/A", sizeof(info->bus_info) - 1);
++}
++
++static int crisv32_eth_get_ethtool_sset_count(struct net_device *dev,
++					      int stringset)
++{
++	if (stringset != ETH_SS_STATS)
++		return -EINVAL;
++
++	return ARRAY_SIZE(ethtool_stats_keys);
++}
++
++static void crisv32_eth_get_ethtool_stats(struct net_device *dev,
++					  struct ethtool_stats *stats,
++					  u64 *data)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data[0] = np->tx_dma_restarts;
++	data[1] = np->tx_mac_resets;
++	data[2] = np->rx_dma_restarts;
++	data[3] = np->rx_dma_timeouts;
++	data[4] = np->rx_restarts_dropped;
++}
++
++static void crisv32_eth_get_strings(struct net_device *dev,
++				    u32 stringset, u8 *data)
++{
++	switch (stringset) {
++		case ETH_SS_STATS:
++			memcpy(data, &ethtool_stats_keys,
++			       sizeof(ethtool_stats_keys));
++			break;
++		default:
++			WARN_ON(1);
++			break;
++	}
++}
++
++static int crisv32_eth_nway_reset(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	if (np->current_duplex == autoneg && np->current_speed_selection == 0)
++		crisv32_eth_negotiate(dev);
++	return 0;
++}
++/* The FS/A3 ethernet block has 23 32-bit config registers.  */
++/* plus 2 dma_descr_context */
++/* plus 2 sets of ring pointers (active, prev, last) */
++/* plus 2 sets of DMA registers 40*4 bytes = 0xA0 */
++#define ETRAX_ETH_REGDUMP_LEN (23 * 4 + 2 * sizeof (dma_descr_context) + 2*3*4 + 2*0xA0)
++static int crisv32_eth_get_regs_len(struct net_device *dev)
++{
++	return ETRAX_ETH_REGDUMP_LEN;
++}
++
++static void crisv32_eth_get_regs(struct net_device *dev,
++				 struct ethtool_regs *regs, void *_p)
++{
++	u32 *p = _p;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	int i;
++
++	/* Let's call this major version 0, minor version 1 with some
++	 * undecided field separation in the version data.  Previously
++	 * only the eth regs were dumped (version=0: maj 0, min 0).*/
++	regs->version = 1;
++	memset(p, 0, ETRAX_ETH_REGDUMP_LEN);
++
++#define GET_REG32_LOOP(base, len)				\
++	do {							\
++		for (i = 0; i < len; i += 4)			\
++			*(p)++ = REG_READ(u32, (base) + i);	\
++	 } while (0)
++
++	GET_REG32_LOOP(np->eth_inst, 0x30);
++	/* Do not dump registers with read side effects.  */
++	GET_REG32_LOOP(np->eth_inst + 0x34, 1);
++	GET_REG32_LOOP(np->eth_inst + 0x3c, 1);
++	GET_REG32_LOOP(np->eth_inst + 0x44, 0x5c - 0x44);
++
++
++	memcpy(p, &np->ctxt_out, sizeof (dma_descr_context));
++	p += sizeof (dma_descr_context)/4;
++	*(p++) = (u32) np->active_tx_desc;
++	*(p++) = (u32) np->prev_tx_desc;
++	*(p++) = (u32) np->catch_tx_desc;
++
++	GET_REG32_LOOP(np->dma_out_inst, 0xa0);
++
++	memcpy(p, &np->ctxt_in, sizeof (dma_descr_context));
++	p += sizeof (dma_descr_context)/4;
++	*(p++) = (u32)np->active_rx_desc;
++	*(p++) = (u32)np->prev_rx_desc;
++	*(p++) = (u32)np->last_rx_desc;
++
++	GET_REG32_LOOP(np->dma_in_inst, 0xa0);
++#undef GET_REG32_LOOP
++}
++
++static struct ethtool_ops crisv32_ethtool_ops = {
++	.get_settings		= crisv32_eth_get_settings,
++	.set_settings		= crisv32_eth_set_settings,
++	.get_drvinfo		= crisv32_eth_get_drvinfo,
++	.get_regs_len		= crisv32_eth_get_regs_len,
++	.get_regs		= crisv32_eth_get_regs,
++	.nway_reset		= crisv32_eth_nway_reset,
++	.get_link		= ethtool_op_get_link,
++	.get_strings		= crisv32_eth_get_strings,
++	.get_ethtool_stats	= crisv32_eth_get_ethtool_stats,
++	.get_sset_count		= crisv32_eth_get_ethtool_sset_count
++};
++
++/* Is this function really needed? Use ethtool instead? */
++static int crisv32_eth_set_config(struct net_device *dev, struct ifmap *map)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	spin_lock(&np->lock); /* Preempt protection */
++
++	switch (map->port) {
++		case IF_PORT_UNKNOWN:
++			/* Use autoneg */
++			crisv32_eth_set_speed(dev, 0);
++			crisv32_eth_set_duplex(dev, autoneg);
++			break;
++		case IF_PORT_10BASET:
++			crisv32_eth_set_speed(dev, 10);
++			crisv32_eth_set_duplex(dev, autoneg);
++			break;
++		case IF_PORT_100BASET:
++		case IF_PORT_100BASETX:
++			crisv32_eth_set_speed(dev, 100);
++			crisv32_eth_set_duplex(dev, autoneg);
++			break;
++		case IF_PORT_100BASEFX:
++		case IF_PORT_10BASE2:
++		case IF_PORT_AUI:
++			spin_unlock(&np->lock);
++			return -EOPNOTSUPP;
++			break;
++		default:
++			printk(KERN_ERR "%s: Invalid media selected",
++			       dev->name);
++			spin_unlock(&np->lock);
++			return -EINVAL;
++	}
++	spin_unlock(&np->lock);
++	return 0;
++}
++
++static void crisv32_eth_negotiate(struct net_device *dev)
++{
++	unsigned short data;
++	unsigned short ctrl1000;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE);
++	ctrl1000 = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					    MII_CTRL1000);
++
++	/* Make all capabilities available */
++	data |= ADVERTISE_10HALF | ADVERTISE_10FULL |
++		ADVERTISE_100HALF | ADVERTISE_100FULL;
++	ctrl1000 |= ADVERTISE_1000HALF | ADVERTISE_1000FULL;
++
++	/* Remove the speed capabilities that we that do not want */
++	switch (np->current_speed_selection) {
++		case 10 :
++			data &= ~(ADVERTISE_100HALF | ADVERTISE_100FULL);
++			ctrl1000 &= ~(ADVERTISE_1000HALF | ADVERTISE_1000FULL);
++			break;
++		case 100 :
++			data &= ~(ADVERTISE_10HALF | ADVERTISE_10FULL);
++			ctrl1000 &= ~(ADVERTISE_1000HALF | ADVERTISE_1000FULL);
++			break;
++		case 1000 :
++			data &= ~(ADVERTISE_10HALF | ADVERTISE_10FULL |
++				  ADVERTISE_100HALF | ADVERTISE_100FULL);
++			break;
++	}
++
++	/* Remove the duplex capabilites that we do not want */
++	if (np->current_duplex == full) {
++		data &= ~(ADVERTISE_10HALF | ADVERTISE_100HALF);
++		ctrl1000 &= ~(ADVERTISE_1000HALF);
++	}
++	else if (np->current_duplex == half) {
++		data &= ~(ADVERTISE_10FULL | ADVERTISE_100FULL);
++		ctrl1000 &= ~(ADVERTISE_1000FULL);
++	}
++
++	crisv32_eth_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data);
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	crisv32_eth_set_mdio_reg(dev, np->mii_if.phy_id,
++				 MII_CTRL1000, ctrl1000);
++#endif
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
++	if (np->autoneg_normal) {
++		/* Renegotiate with link partner */
++		data |= BMCR_ANENABLE | BMCR_ANRESTART;
++	} else {
++		/* Don't negitiate speed or duplex */
++		data &= ~(BMCR_ANENABLE | BMCR_ANRESTART);
++
++		/* Set speed and duplex static */
++		if (np->current_speed_selection == 10) {
++			data &= ~(BMCR_SPEED100 | BMCR_SPEED1000);
++		}
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++		else if (np->current_speed_selection == 1000) {
++			data &= ~BMCR_SPEED100;
++			data |=  BMCR_SPEED1000;
++		}
++#endif
++		else {
++			data |= BMCR_SPEED100;
++			data &= ~BMCR_SPEED1000;
++		}
++
++		if (np->current_duplex != full) {
++			data &= ~BMCR_FULLDPLX;
++		} else {
++			data |= BMCR_FULLDPLX;
++		}
++	}
++	crisv32_eth_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data);
++}
++
++static void crisv32_eth_check_speed(unsigned long idev)
++{
++#ifndef CONFIG_ETRAX_NO_PHY
++	static int led_initiated = 0;
++	struct net_device *dev = (struct net_device *) idev;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	unsigned long data;
++	int old_speed;
++	unsigned long flags;
++
++	BUG_ON(!np);
++	BUG_ON(!np->transceiver);
++
++	spin_lock(&np->transceiver_lock);
++
++	old_speed = np->current_speed;
++
++	/* Do a fake read. This is needed for DM9161, otherwise the link will
++	 * go up and down all the time.
++	 */
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMSR);
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMSR);
++
++	if (!(data & BMSR_LSTATUS))
++		np->current_speed = 0;
++	else
++		np->transceiver->check_speed(dev);
++
++	spin_lock_irqsave(&np->leds->led_lock, flags);
++	if ((old_speed != np->current_speed) || !led_initiated) {
++		led_initiated = 1;
++		np->leds->clear_led_timer.data = (unsigned long) dev;
++		if (np->current_speed) {
++			if (!np->link)
++				netif_carrier_on(dev);
++			crisv32_set_network_leds(CRIS_LED_LINK, dev);
++			np->link = 1;
++		} else {
++			if (np->link)
++				netif_carrier_off(dev);
++			crisv32_set_network_leds(CRIS_LED_NOLINK, dev);
++			np->link = 0;
++		}
++	}
++	spin_unlock_irqrestore(&np->leds->led_lock, flags);
++
++	/* Reinitialize the timer. */
++	np->speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;
++	add_timer(&np->speed_timer);
++
++	spin_unlock(&np->transceiver_lock);
++#endif
++}
++
++static void crisv32_eth_set_speed(struct net_device *dev, unsigned long speed)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	spin_lock(&np->transceiver_lock);
++	if (np->current_speed_selection != speed) {
++		np->current_speed_selection = speed;
++		crisv32_eth_negotiate(dev);
++	}
++	spin_unlock(&np->transceiver_lock);
++}
++
++static void crisv32_eth_check_duplex(unsigned long idev)
++{
++#ifndef CONFIG_ETRAX_NO_PHY
++	struct net_device *dev = (struct net_device *) idev;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	reg_eth_rw_rec_ctrl rec_ctrl;
++	int old_duplex = np->full_duplex;
++
++	np->transceiver->check_duplex(dev);
++
++	if (old_duplex != np->full_duplex) {
++		/* Duplex changed. */
++		rec_ctrl = (reg_eth_rw_rec_ctrl) REG_RD(eth, np->eth_inst,
++							rw_rec_ctrl);
++		rec_ctrl.duplex = np->full_duplex;
++		REG_WR(eth, np->eth_inst, rw_rec_ctrl, rec_ctrl);
++	}
++
++	/* Reinitialize the timer. */
++	np->duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL;
++	add_timer(&np->duplex_timer);
++#endif
++}
++
++static void
++crisv32_eth_set_duplex(struct net_device *dev, enum duplex new_duplex)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	spin_lock(&np->transceiver_lock);
++	if (np->current_duplex != new_duplex) {
++		np->current_duplex = new_duplex;
++		crisv32_eth_negotiate(dev);
++	}
++	spin_unlock(&np->transceiver_lock);
++}
++
++static int crisv32_eth_probe_transceiver(struct net_device *dev)
++{
++#ifndef CONFIG_ETRAX_NO_PHY
++	unsigned int phyid_high;
++	unsigned int phyid_low;
++	unsigned int oui;
++	struct transceiver_ops *ops = NULL;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	/* Probe MDIO physical address. */
++	for (np->mii_if.phy_id = 0;
++	     np->mii_if.phy_id <= 31; np->mii_if.phy_id++) {
++		if (crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMSR)
++		    != 0xffff)
++			break;
++	}
++
++	if (np->mii_if.phy_id == 32)
++		return -ENODEV;
++
++	/* Get manufacturer. */
++	phyid_high = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					      MII_PHYSID1);
++	phyid_low = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					     MII_PHYSID2);
++
++	oui = (phyid_high << 6) | (phyid_low >> 10);
++
++	for (ops = &transceivers[0]; ops->oui; ops++) {
++		if (ops->oui == oui)
++			break;
++	}
++
++	np->transceiver = ops;
++
++	if (oui == DM9161_OUI) {
++		/* Do not bypass the scrambler/descrambler, this is needed
++		 * to make 10Mbit work.
++		 */
++		crisv32_eth_set_mdio_reg(dev, np->mii_if.phy_id,
++					 MII_DM9161_SCR,MII_DM9161_SCR_INIT);
++		/* Clear 10BTCSR to default */
++		crisv32_eth_set_mdio_reg(dev, np->mii_if.phy_id,
++					 MII_DM9161_10BTCSR,
++					 MII_DM9161_10BTCSR_INIT);
++	}
++	return 0;
++#else
++	return -ENODEV;
++#endif
++}
++
++#ifndef CONFIG_ETRAX_NO_PHY
++static void generic_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE);
++	if ((data & ADVERTISE_100FULL) ||
++	    (data & ADVERTISE_100HALF))
++		np->current_speed = 100;
++	else
++		np->current_speed = 10;
++}
++
++static void generic_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE);
++	if ((data & ADVERTISE_10FULL) ||
++	    (data & ADVERTISE_100FULL))
++		np->full_duplex = 1;
++	else
++		np->full_duplex = 0;
++}
++
++static void broadcom_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_AUX_CTRL_STATUS_REG);
++	np->current_speed = (data & MDIO_BC_SPEED ? 100 : 10);
++}
++
++static void broadcom_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_AUX_CTRL_STATUS_REG);
++	np->full_duplex = (data & MDIO_BC_FULL_DUPLEX_IND) ? 1 : 0;
++}
++
++static void tdk_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_TDK_DIAGNOSTIC_REG);
++	np->current_speed = (data & MDIO_TDK_DIAGNOSTIC_RATE ? 100 : 10);
++}
++
++static void tdk_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_TDK_DIAGNOSTIC_REG);
++	np->full_duplex = (data & MDIO_TDK_DIAGNOSTIC_DPLX) ? 1 : 0;
++
++}
++
++static void intel_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_INT_STATUS_REG_2);
++	np->current_speed = (data & MDIO_INT_SPEED ? 100 : 10);
++}
++
++static void intel_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_INT_STATUS_REG_2);
++	np->full_duplex = (data & MDIO_INT_FULL_DUPLEX_IND) ? 1 : 0;
++}
++
++static void national_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_NAT_LINK_AN_REG);
++	if (data & MDIO_NAT_1000)
++		np->current_speed = 1000;
++	else if (data & MDIO_NAT_100)
++		np->current_speed = 100;
++	else
++		np->current_speed = 10;
++}
++
++static void national_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_NAT_LINK_AN_REG);
++	if (data & MDIO_NAT_FULL_DUPLEX_IND)
++		np->full_duplex = 1;
++	else
++		np->full_duplex = 0;
++}
++
++static void vitesse_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_VIT_AUX_STAT);
++	if ((data & 0x18) == MDIO_VIT_1000)
++		np->current_speed = 1000;
++	else if ((data & 0x18) == MDIO_VIT_100)
++		np->current_speed = 100;
++	else
++		np->current_speed = 10;
++}
++
++static void vitesse_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++					MDIO_VIT_AUX_STAT);
++	if (data & 0x20)
++		np->full_duplex = 1;
++	else
++		np->full_duplex = 0;
++}
++
++static void davicom_check_speed(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
++	np->current_speed = (data & BMCR_SPEED100) ? 100 : 10;
++}
++
++static void davicom_check_duplex(struct net_device *dev)
++{
++	unsigned long data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
++	np->full_duplex = (data & BMCR_FULLDPLX) ? 1 : 0;
++}
++#endif
++
++#if 0
++static void crisv32_eth_reset_tranceiver(struct net_device *dev)
++{
++	int i;
++	unsigned short cmd;
++	unsigned short data;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
++
++	cmd = (MDIO_START << 14)
++		| (MDIO_WRITE << 12)
++		| (np->mii_if.phy_id << 7)
++		| (MII_BMCR << 2);
++
++	crisv32_eth_send_mdio_cmd(dev, cmd, 1);
++
++	data |= 0x8000;
++
++	/* Magic value is number of bits. */
++	for (i = 15; i >= 0; i--)
++		crisv32_eth_send_mdio_bit(dev, GET_BIT(i, data));
++}
++#endif
++
++static int
++crisv32_eth_get_mdio_reg(struct net_device *dev, int phyid, int reg_num)
++{
++	int i;
++	unsigned short cmd;	/* Data to be sent on MDIO port. */
++	unsigned short data;	/* Data read from MDIO. */
++
++#ifdef CONFIG_ETRAX_NO_PHY
++	return 0;
++#endif
++
++	/* Start of frame, OP Code, Physical Address, Register Address. */
++	cmd = (MDIO_START << 14)
++		| (MDIO_READ << 12)
++		| (phyid << 7)
++		| (reg_num << 2);
++
++	crisv32_eth_send_mdio_cmd(dev, cmd, 0);
++
++	data = 0;
++
++	/* Receive data. Magic value is number of bits. */
++	for (i = 15; i >= 0; i--)
++		data |= (crisv32_eth_receive_mdio_bit(dev) << i);
++
++	return data;
++}
++
++static void
++crisv32_eth_set_mdio_reg(struct net_device *dev, int phyid, int reg, int value)
++{
++	int bitCounter;
++	unsigned short cmd;
++
++#ifdef CONFIG_ETRAX_NO_PHY
++	return;
++#endif
++	cmd = (MDIO_START << 14)
++		| (MDIO_WRITE << 12)
++		| (phyid << 7)
++		| (reg << 2);
++
++	crisv32_eth_send_mdio_cmd(dev, cmd, 1);
++
++	/* Data... */
++	for (bitCounter=15; bitCounter>=0 ; bitCounter--) {
++		crisv32_eth_send_mdio_bit(dev, GET_BIT(bitCounter, value));
++	}
++}
++
++static void
++crisv32_eth_send_mdio_cmd(struct net_device *dev, unsigned short cmd,
++			  int write_cmd)
++{
++	int i;
++	unsigned char data = 0x2;
++
++	/* Preamble. Magic value is number of bits. */
++	for (i = 31; i >= 0; i--)
++		crisv32_eth_send_mdio_bit(dev, GET_BIT(i, MDIO_PREAMBLE));
++
++	for (i = 15; i >= 2; i--)
++		crisv32_eth_send_mdio_bit(dev, GET_BIT(i, cmd));
++
++	/* Turnaround. */
++	for (i = 1; i >= 0; i--)
++		if (write_cmd)
++			crisv32_eth_send_mdio_bit(dev, GET_BIT(i, data));
++		else
++			crisv32_eth_receive_mdio_bit(dev);
++}
++
++static void crisv32_eth_send_mdio_bit(struct net_device *dev, unsigned char bit)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	reg_eth_rw_mgm_ctrl mgm_ctrl = {
++		.mdoe = regk_eth_yes,
++		.mdio = bit & 1
++	};
++
++	REG_WR(eth, np->eth_inst, rw_mgm_ctrl, mgm_ctrl);
++
++	udelay(1);
++
++	mgm_ctrl.mdc = 1;
++	REG_WR(eth, np->eth_inst, rw_mgm_ctrl, mgm_ctrl);
++
++	udelay(1);
++}
++
++static unsigned char crisv32_eth_receive_mdio_bit(struct net_device *dev)
++{
++	reg_eth_r_stat stat;
++	reg_eth_rw_mgm_ctrl mgm_ctrl = {0};
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++
++	REG_WR(eth, np->eth_inst, rw_mgm_ctrl, mgm_ctrl);
++	stat = REG_RD(eth, np->eth_inst, r_stat);
++
++	udelay(1);
++
++	mgm_ctrl.mdc = 1;
++	REG_WR(eth, np->eth_inst, rw_mgm_ctrl, mgm_ctrl);
++
++	udelay(1);
++	return stat.mdio;
++}
++
++static void crisv32_clear_network_leds(unsigned long priv)
++{
++	struct net_device *dev = (struct net_device *)priv;
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	unsigned long flags;
++
++	spin_lock_irqsave(&np->leds->led_lock, flags);
++	if (np->leds->led_active && time_after(jiffies,
++					       np->leds->led_next_time)) {
++		crisv32_set_network_leds(CRIS_LED_NOACTIVITY, dev);
++
++		/* Set the earliest time we may set the LED */
++		np->leds->led_next_time = jiffies + NET_FLASH_PAUSE;
++		np->leds->led_active = 0;
++	}
++	spin_unlock_irqrestore(&np->leds->led_lock, flags);
++}
++
++static void crisv32_set_network_leds(int active, struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	int light_leds = 0;
++
++	if (np->leds->ledgrp == CRIS_LED_GRP_NONE)
++		return;
++
++	if (!np->use_leds)
++		return;
++
++	if (active == CRIS_LED_NOLINK) {
++		if (dev == crisv32_dev[0])
++			np->leds->ifisup[0] = 0;
++		else
++			np->leds->ifisup[1] = 0;
++	}
++	else if (active == CRIS_LED_LINK) {
++		if (dev == crisv32_dev[0])
++			np->leds->ifisup[0] = 1;
++		else
++			np->leds->ifisup[1] = 1;
++#if defined(CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK)
++		light_leds = 1;
++	} else {
++		light_leds = (active == CRIS_LED_NOACTIVITY);
++#elif defined(CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY)
++		light_leds = 0;
++	} else {
++		light_leds = (active == CRIS_LED_ACTIVITY);
++#else
++#error "Define either CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK or CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY"
++#endif
++	}
++
++	if (!np->current_speed) {
++		/* Set link down if none of the interfaces that use this led
++		   group is up */
++		if ((np->leds->ifisup[0] + np->leds->ifisup[1]) == 0) {
++#if defined(CONFIG_ETRAX_NETWORK_RED_ON_NO_CONNECTION)
++			/* Make LED red, link is down */
++			NET_LED_SET(np->leds->ledgrp, CRIS_LED_RED);
++#else
++			NET_LED_SET(np->leds->ledgrp, CRIS_LED_OFF);
++#endif
++		}
++	} else if (light_leds) {
++		if (np->current_speed == 10)
++			NET_LED_SET(np->leds->ledgrp, CRIS_LED_ORANGE);
++		else
++			NET_LED_SET(np->leds->ledgrp, CRIS_LED_GREEN);
++	} else
++		NET_LED_SET(np->leds->ledgrp, CRIS_LED_OFF);
++}
++
++#ifdef CONFIG_NET_POLL_CONTROLLER
++static void crisv32_netpoll(struct net_device *netdev)
++{
++	crisv32rx_eth_interrupt(DMA0_INTR_VECT, netdev);
++}
++#endif
++
++#ifdef CONFIG_CPU_FREQ
++static int crisv32_ethernet_freq_notifier(struct notifier_block *nb,
++					  unsigned long val, void *data)
++{
++	struct cpufreq_freqs *freqs = data;
++	int i;
++	if (val != CPUFREQ_POSTCHANGE)
++		return 0;
++
++	for (i = 0; i < 2; i++) {
++		struct net_device *dev = crisv32_dev[i];
++		unsigned short data;
++		if (dev == NULL)
++			continue;
++
++		data = crisv32_eth_get_mdio_reg(dev, np->mii_if.phy_id,
++				MII_BMCR);
++		if (freqs->new == 200000)
++			data &= ~BMCR_PDOWN;
++		else
++			data |= BMCR_PDOWN;
++		crisv32_eth_set_mdio_reg(dev, np->mii_if.phy_id,
++				MII_BMCR, data);
++	}
++	return 0;
++}
++#endif
++
++#if 0
++/*
++ * Must be called with the np->lock held.
++ */
++static void crisv32_ethernet_bug(struct net_device *dev)
++{
++	struct crisv32_ethernet_local *np = netdev_priv(dev);
++	dma_descr_data *dma_pos;
++	dma_descr_data *in_dma_pos;
++	reg_dma_rw_stat stat = {0};
++	reg_dma_rw_stat in_stat = {0};
++	int i;
++
++	/* Get the current output dma position. */
++	stat = REG_RD(dma, np->dma_out_inst, rw_stat);
++
++	dma_pos = phys_to_virt(REG_RD_INT(dma, np->dma_out_inst, rw_data));
++	in_dma_pos = phys_to_virt(REG_RD_INT(dma, np->dma_in_inst, rw_data));
++	in_stat = REG_RD(dma, np->dma_in_inst, rw_stat);
++
++	printk("%s:\n"
++	       "stat.list_state=%x\n"
++	       "stat.mode=%x\n"
++	       "stat.stream_cmd_src=%x\n"
++	       "dma_pos=%x\n"
++	       "tx catch=%x active=%x\n"
++	       "packets=%d queue=%d sender_started=%d\n"
++	       "intr_vect.r_vect=%x\n"
++	       "dma.r_masked_intr=%x dma.rw_ack_intr=%x "
++	       "dma.r_intr=%x dma.rw_intr_masked=%x\n"
++	       "eth.r_stat=%x\n",
++	       __func__,
++	       stat.list_state, stat.mode, stat.stream_cmd_src,
++	       (unsigned int)dma_pos,
++	       (unsigned int)&np->catch_tx_desc->descr,
++	       (unsigned int)&np->active_tx_desc->descr,
++	       np->txpackets,
++	       netif_queue_stopped(dev), np->sender_started,
++	       REG_RD_INT(intr_vect, regi_irq, r_vect),
++	       REG_RD_INT(dma, np->dma_out_inst, r_masked_intr),
++	       REG_RD_INT(dma, np->dma_out_inst, rw_ack_intr),
++	       REG_RD_INT(dma, np->dma_out_inst, r_intr),
++	       REG_RD_INT(dma, np->dma_out_inst, rw_intr_mask),
++	       REG_RD_INT(eth, np->eth_inst, r_stat));
++
++	printk("in_stat.list_state=%x\n"
++	       "in_stat.mode=%x\n"
++	       "in_stat.stream_cmd_src=%x\n"
++	       "in_dma_pos=%x\n"
++	       "rx last=%x prev=%x active=%x\n",
++	       in_stat.list_state, in_stat.mode, in_stat.stream_cmd_src,
++	       (unsigned int)in_dma_pos,
++	       (unsigned int)&np->last_rx_desc->descr,
++	       (unsigned int)&np->prev_rx_desc->descr,
++	       (unsigned int)&np->active_rx_desc->descr);
++
++#if 0
++	printk("rx-descriptors:\n");
++	for (i = 0; i < NBR_RX_DESC; i++) {
++		printk("rxdesc[%d]=0x%x\n", i, (unsigned int)
++		       virt_to_phys(&np->dma_rx_descr_list[i].descr));
++		printk("rxdesc[%d].skb=0x%x\n", i,
++		       (unsigned int)np->dma_rx_descr_list[i].skb);
++		printk("rxdesc[%d].buf=0x%x\n", i,
++		       (unsigned int)np->dma_rx_descr_list[i].descr.buf);
++		printk("rxdesc[%d].after=0x%x\n", i,
++		       (unsigned int)np->dma_rx_descr_list[i].descr.after);
++		printk("rxdesc[%d].intr=%x\n", i,
++		       np->dma_rx_descr_list[i].descr.intr);
++		printk("rxdesc[%d].eol=%x\n", i,
++		       np->dma_rx_descr_list[i].descr.eol);
++		printk("rxdesc[%d].out_eop=%x\n", i,
++		       np->dma_rx_descr_list[i].descr.out_eop);
++		printk("rxdesc[%d].in_eop=%x\n", i,
++		       np->dma_rx_descr_list[i].descr.in_eop);
++		printk("rxdesc[%d].wait=%x\n", i,
++		       np->dma_rx_descr_list[i].descr.wait);
++	}
++#endif
++
++#if 1
++	printk("tx-descriptors:\n");
++	for (i = 0; i < NBR_TX_DESC; i++) {
++		printk("txdesc[%d]=0x%x\n", i, (unsigned int)
++		       virt_to_phys(&np->dma_tx_descr_list[i].descr));
++		printk("txdesc[%d].skb=0x%x\n", i,
++		       (unsigned int)np->dma_tx_descr_list[i].skb);
++		printk("txdesc[%d].buf=0x%x\n", i,
++		       (unsigned int)np->dma_tx_descr_list[i].descr.buf);
++		printk("txdesc[%d].after=0x%x\n", i,
++		       (unsigned int)np->dma_tx_descr_list[i].descr.after);
++		printk("txdesc[%d].intr=%x\n", i,
++		       np->dma_tx_descr_list[i].descr.intr);
++		printk("txdesc[%d].eol=%x\n", i,
++		       np->dma_tx_descr_list[i].descr.eol);
++		printk("txdesc[%d].out_eop=%x\n", i,
++		       np->dma_tx_descr_list[i].descr.out_eop);
++		printk("txdesc[%d].in_eop=%x\n", i,
++		       np->dma_tx_descr_list[i].descr.in_eop);
++		printk("txdesc[%d].wait=%x\n", i,
++		       np->dma_tx_descr_list[i].descr.wait);
++	}
++#endif
++}
++#endif
++
++static int __init crisv32_boot_setup(char *str)
++{
++	struct sockaddr sa = {0};
++	int i;
++
++	/* Parse the colon separated Ethernet station address */
++	for (i = 0; i <  ETH_ALEN; i++) {
++		unsigned int tmp;
++		if (sscanf(str + 3*i, "%2x", &tmp) != 1) {
++			printk(KERN_WARNING "Malformed station address");
++			return 0;
++		}
++		sa.sa_data[i] = (char)tmp;
++	}
++
++	default_mac_iface0 = sa;
++	return 1;
++}
++
++__setup("crisv32_eth=", crisv32_boot_setup);
++
++module_init(crisv32_ethernet_init);
+diff --git a/drivers/net/cris/eth_v32.h b/drivers/net/cris/eth_v32.h
+new file mode 100644
+index 0000000..b6b0c7c
+--- /dev/null
++++ b/drivers/net/cris/eth_v32.h
+@@ -0,0 +1,297 @@
++/*
++ * Definitions for ETRAX FS ethernet driver.
++ *
++ * Copyright (C) 2003, 2004, 2005 Axis Communications.
++ */
++
++#ifndef _ETRAX_ETHERNET_H_
++#define _ETRAX_ETHERNET_H_
++
++#include <hwregs/dma.h>
++
++#define MAX_MEDIA_DATA_SIZE 1522	/* Max packet size. */
++
++#define NBR_RX_DESC 128		/* Number of RX descriptors. */
++#define NBR_TX_DESC 16		/* Number of TX descriptors. */
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++#define NBR_INTMEM_RX_DESC 16	/* Number of RX descriptors in int. mem.
++				 * when running in gigabit mode.
++				 * Should be less then NBR_RX_DESC
++				 */
++#define NBR_INTMEM_TX_BUF 4	/* Number of TX buffers in int. mem
++				 * when running in gigabit mode.
++				 * Should be less than NBR_TX_DESC
++				 */
++#endif
++
++/* Large packets are sent directly to upper layers while small packets
++ * are copied (to reduce memory waste).  The following constant
++ * decides the breakpoint.
++ */
++#define RX_COPYBREAK        (256)
++
++#define ETHER_HEAD_LEN      (14)
++
++/*
++ * MDIO constants.
++ */
++#define MDIO_START                          0x1
++#define MDIO_READ                           0x2
++#define MDIO_WRITE                          0x1
++#define MDIO_PREAMBLE              0xfffffffful
++
++/* Broadcom specific */
++#define MDIO_AUX_CTRL_STATUS_REG           0x18
++#define MDIO_BC_FULL_DUPLEX_IND             0x1
++#define MDIO_BC_SPEED                       0x2
++
++/* TDK specific */
++#define MDIO_TDK_DIAGNOSTIC_REG              18
++#define MDIO_TDK_DIAGNOSTIC_RATE          0x400
++#define MDIO_TDK_DIAGNOSTIC_DPLX          0x800
++
++/*Intel LXT972A specific*/
++#define MDIO_INT_STATUS_REG_2		   0x0011
++#define MDIO_INT_FULL_DUPLEX_IND ( 0x0001 << 9  )
++#define MDIO_INT_SPEED		 ( 0x0001 << 14 )
++
++/*National Semiconductor DP83865 specific*/
++#define MDIO_NAT_LINK_AN_REG              0x11
++#define MDIO_NAT_1000            (0x0001 << 4)
++#define MDIO_NAT_100             (0x0001 << 3)
++#define MDIO_NAT_FULL_DUPLEX_IND (0x0001 << 1)
++
++/* Vitesse VCS8641 specific */
++#define MDIO_VIT_AUX_STAT 0x1c
++#define MDIO_VIT_1000            (0x2 << 3)
++#define MDIO_VIT_100             (0x1 << 3)
++#define MDIO_VIT_10              0
++#define MDIO_VIT_FD              (0x1 << 5)
++
++/* Davicom DM9161 specific */
++#define DM9161_OUI               0x606E
++#define MII_DM9161_SCR           0x10
++#define MII_DM9161_SCR_INIT      0x0610
++#define MII_DM9161_SCR_RMII      0x0100
++#define MII_DM9161_10BTCSR       0x12
++#define MII_DM9161_10BTCSR_INIT  0x7800
++
++/* Network flash constants */
++#define NET_FLASH_TIME                  (HZ/50)	/* 20 ms */
++#define NET_FLASH_PAUSE                 (HZ/100)	/* 10 ms */
++#define NET_LINK_UP_CHECK_INTERVAL	(2*HZ)	/* 2 seconds. */
++#define NET_DUPLEX_CHECK_INTERVAL	(2*HZ)	/* 2 seconds. */
++
++/* Duplex settings. */
++enum duplex {
++	half,
++	full,
++	autoneg
++};
++
++/* Some transceivers requires special handling. */
++struct transceiver_ops {
++	unsigned int oui;
++	void (*check_speed) (struct net_device * dev);
++	void (*check_duplex) (struct net_device * dev);
++};
++
++typedef struct crisv32_eth_descr {
++	dma_descr_data descr __attribute__ ((__aligned__(32)));
++	struct sk_buff *skb;
++	unsigned char *linearized_packet;
++} crisv32_eth_descr;
++
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++struct tx_buffer_list {
++	struct tx_buffer_list *next;
++	unsigned char *buf;
++	char free;
++};
++#endif
++
++/* LED stuff */
++#define CRIS_LED_GRP_0 0
++#define CRIS_LED_GRP_1 1
++#define CRIS_LED_GRP_NONE 2
++
++#define CRIS_LED_ACTIVITY   0
++#define CRIS_LED_NOACTIVITY 1
++#define CRIS_LED_LINK       2
++#define CRIS_LED_NOLINK     3
++
++struct crisv32_eth_leds {
++	unsigned int ledgrp;
++	int led_active;
++	unsigned long led_next_time;
++	struct timer_list clear_led_timer;
++	spinlock_t led_lock;	/* Protect LED state */
++	int ifisup[2];
++};
++
++#define NET_LED_SET(x,y)				\
++	do {						\
++		if (x == 0) CRIS_LED_NETWORK_GRP0_SET(y);	\
++		if (x == 1) CRIS_LED_NETWORK_GRP1_SET(y);	\
++	} while (0)
++
++/* Information that need to be kept for each device. */
++struct crisv32_ethernet_local {
++	/* FIXME: These align attributes don't really help. If they are really
++	 * needed alignment has to be enforced at runtime, these objects
++	 * are dynamically allocated.  */
++	dma_descr_context ctxt_in __attribute__ ((__aligned__(32)));
++	dma_descr_context ctxt_out __attribute__ ((__aligned__(32)));
++
++	crisv32_eth_descr dma_rx_descr_list[NBR_RX_DESC];
++	crisv32_eth_descr dma_tx_descr_list[NBR_TX_DESC];
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++	struct tx_buffer_list tx_intmem_buf_list[NBR_INTMEM_TX_BUF];
++	struct tx_buffer_list *intmem_tx_buf_active;
++	struct tx_buffer_list *intmem_tx_buf_catch;
++	int gigabit_mode;
++#endif
++	/* Transmit data path.  */
++	int dma_out_inst;
++	int sender_started;
++
++	/* TX-ring state.  */
++	crisv32_eth_descr *active_tx_desc;
++	crisv32_eth_descr *prev_tx_desc;
++	crisv32_eth_descr *catch_tx_desc;
++	int txpackets;
++	int retrans;
++	int do_tx_recovery;
++	struct timer_list transmit_timer;
++
++	/* Receive data path.  */
++	struct napi_struct napi;
++	int dma_in_inst;
++
++	/* RX-ring state.  */
++	crisv32_eth_descr *active_rx_desc;
++	crisv32_eth_descr *prev_rx_desc;
++	crisv32_eth_descr *last_rx_desc;
++
++	unsigned long newbuf;
++	u8 new_rx_package;
++	u8 pending_overrun;
++	u8 overrun_set;
++	u8 link;
++	int napi_processing;
++	struct timer_list receive_timer;
++	struct work_struct receive_work;
++	reg_eth_rw_rec_ctrl saved_rec_ctrl;
++	int saved_ga_lo;
++	int saved_ga_hi;
++	int do_rx_recovery;
++
++	/* Control paths.  */
++	spinlock_t lock;
++	struct net_device *dev;
++	int eth_inst;
++
++	/* Toggle network LEDs usage at runtime */
++	int use_leds;
++	struct crisv32_eth_leds *leds;
++
++	/* PHY control.  */
++	int fixed_phy;
++	spinlock_t transceiver_lock;	/* Protect transceiver state. */
++	struct transceiver_ops *transceiver;
++	struct mii_if_info mii_if;
++
++	/* Specifies if we should do autonegotiation or not.
++	 * TODO: This ad-hoc hack should be removed. Ethtool already supports
++	 *       this kind of control.
++	 */
++	int autoneg_normal;
++
++	struct timer_list duplex_timer;
++	int full_duplex;
++	enum duplex current_duplex;
++
++	struct timer_list speed_timer;
++	int current_speed;	/* Speed read from tranceiver */
++	int current_speed_selection;	/* Speed selected by user */
++
++	/* Statistics.  */
++	u64 tx_dma_restarts;
++	u64 tx_mac_resets;
++	u64 rx_dma_restarts;
++	u64 rx_dma_timeouts;
++	u64 rx_restarts_dropped;
++
++	struct net_device_stats stats;
++};
++
++/* Function prototypes. */
++static int crisv32_ethernet_init(void);
++static int crisv32_ethernet_device_init(struct net_device *dev);
++static int crisv32_eth_open(struct net_device *dev);
++static int crisv32_eth_close(struct net_device *dev);
++static int crisv32_eth_set_mac_address(struct net_device *dev, void *vpntr);
++static irqreturn_t crisv32rx_eth_interrupt(int irq, void *dev_id);
++static irqreturn_t crisv32tx_eth_interrupt(int irq, void *dev_id);
++static irqreturn_t crisv32nw_eth_interrupt(int irq, void *dev_id);
++static int crisv32_eth_send_packet(struct sk_buff *skb, struct net_device *dev);
++static void crisv32_eth_hw_send_packet(unsigned char *buf, int length,
++				       void *priv);
++static void crisv32_eth_do_tx_recovery(struct net_device *dev);
++static void crisv32_eth_set_rx_mode(struct net_device *dev);
++static int crisv32_eth_ioctl(struct net_device *dev, struct ifreq *ifr,
++			     int cmd);
++static int crisv32_eth_set_config(struct net_device *dev, struct ifmap *map);
++#ifdef CONFIG_CRIS_MACH_ARTPEC3
++static void crisv32_eth_switch_intmem_usage(struct net_device *dev);
++#endif
++static void crisv32_eth_negotiate(struct net_device *dev);
++static void crisv32_eth_set_speed(struct net_device *dev, unsigned long speed);
++#ifndef CONFIG_ETRAX_NO_PHY
++static void crisv32_eth_check_duplex(unsigned long idev);
++static void crisv32_eth_check_speed(unsigned long idev);
++#endif
++
++static void crisv32_eth_set_duplex(struct net_device *dev, enum duplex);
++static int crisv32_eth_probe_transceiver(struct net_device *dev);
++
++static struct ethtool_ops crisv32_ethtool_ops;
++
++#ifndef CONFIG_ETRAX_NO_PHY
++static void generic_check_speed(struct net_device *dev);
++static void generic_check_duplex(struct net_device *dev);
++static void broadcom_check_speed(struct net_device *dev);
++static void broadcom_check_duplex(struct net_device *dev);
++static void tdk_check_speed(struct net_device *dev);
++static void tdk_check_duplex(struct net_device *dev);
++static void intel_check_speed(struct net_device *dev);
++static void intel_check_duplex(struct net_device *dev);
++static void national_check_speed(struct net_device *dev);
++static void national_check_duplex(struct net_device *dev);
++static void vitesse_check_speed(struct net_device *dev);
++static void vitesse_check_duplex(struct net_device *dev);
++static void davicom_check_speed(struct net_device *dev);
++static void davicom_check_duplex(struct net_device *dev);
++#endif
++
++#ifdef CONFIG_NET_POLL_CONTROLLER
++static void crisv32_netpoll(struct net_device *dev);
++#endif
++
++static void crisv32_clear_network_leds(unsigned long dummy);
++static void crisv32_set_network_leds(int active, struct net_device *dev);
++
++static int crisv32_eth_get_mdio_reg(struct net_device *dev,
++				    int phyid, int reg_num);
++static void crisv32_eth_set_mdio_reg(struct net_device *dev,
++				     int phyid, int reg_num, int val);
++static void crisv32_eth_send_mdio_cmd(struct net_device *dev,
++				      unsigned short cmd, int write_cmd);
++static void crisv32_eth_send_mdio_bit(struct net_device *dev,
++				      unsigned char bit);
++static unsigned char crisv32_eth_receive_mdio_bit(struct net_device *dev);
++
++static struct net_device_stats *crisv32_get_stats(struct net_device *dev);
++static void crisv32_start_dma_out(struct crisv32_ethernet_local *np);
++
++#endif /* _ETRAX_ETHERNET_H_ */

+ 0 - 2
target/linux/config/Config.in.ethernet

@@ -337,7 +337,6 @@ config ADK_KERNEL_E1000
 		ADK_TARGET_SYSTEM_QEMU_MIPS64 || \
 		ADK_TARGET_SYSTEM_QEMU_MIPS64 || \
 		ADK_TARGET_SYSTEM_QEMU_PPC_MACPPC || \
 		ADK_TARGET_SYSTEM_QEMU_PPC_MACPPC || \
 		ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO || \
 		ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO || \
-		ADK_TARGET_SYSTEM_QEMU_PPC_MPC8544DS || \
 		ADK_TARGET_SYSTEM_QEMU_ALPHA || \
 		ADK_TARGET_SYSTEM_QEMU_ALPHA || \
 		ADK_TARGET_SYSTEM_QEMU_SPARC64 || \
 		ADK_TARGET_SYSTEM_QEMU_SPARC64 || \
 		ADK_TARGET_VBOX || \
 		ADK_TARGET_VBOX || \
@@ -349,7 +348,6 @@ config ADK_KERNEL_E1000
 	default y if ADK_TARGET_SYSTEM_QEMU_MIPS64
 	default y if ADK_TARGET_SYSTEM_QEMU_MIPS64
 	default y if ADK_TARGET_SYSTEM_QEMU_PPC_MACPPC
 	default y if ADK_TARGET_SYSTEM_QEMU_PPC_MACPPC
 	default y if ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO
 	default y if ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO
-	default y if ADK_TARGET_SYSTEM_QEMU_PPC_MPC8544DS
 	default y if ADK_TARGET_SYSTEM_QEMU_ALPHA
 	default y if ADK_TARGET_SYSTEM_QEMU_ALPHA
 	default y if ADK_TARGET_SYSTEM_QEMU_SPARC64
 	default y if ADK_TARGET_SYSTEM_QEMU_SPARC64
 	default y if ADK_TARGET_VBOX
 	default y if ADK_TARGET_VBOX

+ 1 - 3
target/linux/config/Config.in.serial

@@ -86,7 +86,6 @@ config ADK_KERNEL_SERIAL_BFIN
 
 
 config ADK_KERNEL_SERIAL_8250
 config ADK_KERNEL_SERIAL_8250
 	bool "8250 serial driver"
 	bool "8250 serial driver"
-	select ADK_KERNEL_SERIAL_8250_CONSOLE
 	select ADK_KERNEL_SERIAL_OF_PLATFORM if ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
 	select ADK_KERNEL_SERIAL_OF_PLATFORM if ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
 						|| ADK_TARGET_SYSTEM_IMGTEC_CI20 \
 						|| ADK_TARGET_SYSTEM_IMGTEC_CI20 \
 						|| ADK_TARGET_SYSTEM_QEMU_XTENSA \
 						|| ADK_TARGET_SYSTEM_QEMU_XTENSA \
@@ -100,6 +99,7 @@ config ADK_KERNEL_SERIAL_8250
 	select ADK_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
 	select ADK_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
 	select ADK_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_ORANGE_PI0
 	select ADK_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_ORANGE_PI0
 	select ADK_KERNEL_SERIAL_8250_DMA if ADK_TARGET_SYSTEM_ORANGE_PI0
 	select ADK_KERNEL_SERIAL_8250_DMA if ADK_TARGET_SYSTEM_ORANGE_PI0
+	select ADK_KERNEL_SERIAL_8250_CONSOLE
 	select ADK_KERNEL_SERIAL_8250_INGENIC if ADK_TARGET_SYSTEM_IMGTEC_CI20
 	select ADK_KERNEL_SERIAL_8250_INGENIC if ADK_TARGET_SYSTEM_IMGTEC_CI20
 	depends on ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
 	depends on ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
 		|| ADK_TARGET_SYSTEM_IMGTEC_CI20 \
 		|| ADK_TARGET_SYSTEM_IMGTEC_CI20 \
@@ -115,7 +115,6 @@ config ADK_KERNEL_SERIAL_8250
 		|| ADK_TARGET_SYSTEM_QEMU_NIOS2 \
 		|| ADK_TARGET_SYSTEM_QEMU_NIOS2 \
 		|| ADK_TARGET_SYSTEM_QEMU_OR1K \
 		|| ADK_TARGET_SYSTEM_QEMU_OR1K \
 		|| ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO \
 		|| ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO \
-		|| ADK_TARGET_SYSTEM_QEMU_PPC_MPC8544DS \
 		|| ADK_TARGET_SYSTEM_QEMU_X86 \
 		|| ADK_TARGET_SYSTEM_QEMU_X86 \
 		|| ADK_TARGET_SYSTEM_QEMU_X86_64 \
 		|| ADK_TARGET_SYSTEM_QEMU_X86_64 \
 		|| ADK_TARGET_SYSTEM_QEMU_XTENSA \
 		|| ADK_TARGET_SYSTEM_QEMU_XTENSA \
@@ -142,7 +141,6 @@ config ADK_KERNEL_SERIAL_8250
 	default y if ADK_TARGET_SYSTEM_QEMU_NIOS2
 	default y if ADK_TARGET_SYSTEM_QEMU_NIOS2
 	default y if ADK_TARGET_SYSTEM_QEMU_OR1K
 	default y if ADK_TARGET_SYSTEM_QEMU_OR1K
 	default y if ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO
 	default y if ADK_TARGET_SYSTEM_QEMU_PPC_BAMBOO
-	default y if ADK_TARGET_SYSTEM_QEMU_PPC_MPC8544DS
 	default y if ADK_TARGET_SYSTEM_QEMU_X86
 	default y if ADK_TARGET_SYSTEM_QEMU_X86
 	default y if ADK_TARGET_SYSTEM_QEMU_X86_64
 	default y if ADK_TARGET_SYSTEM_QEMU_X86_64
 	default y if ADK_TARGET_SYSTEM_QEMU_XTENSA
 	default y if ADK_TARGET_SYSTEM_QEMU_XTENSA

+ 0 - 0
target/linux/patches/3.16.49/bsd-compatibility.patch → target/linux/patches/3.16.48/bsd-compatibility.patch


+ 0 - 0
target/linux/patches/3.16.49/cleankernel.patch → target/linux/patches/3.16.48/cleankernel.patch


+ 0 - 0
target/linux/patches/3.16.49/cris-header.patch → target/linux/patches/3.16.48/cris-header.patch


+ 0 - 0
target/linux/patches/3.16.49/cris-initramfs.patch → target/linux/patches/3.16.48/cris-initramfs.patch


+ 0 - 0
target/linux/patches/3.16.49/defaults.patch → target/linux/patches/3.16.48/defaults.patch


+ 0 - 0
target/linux/patches/3.16.49/export-symbol-for-exmap.patch → target/linux/patches/3.16.48/export-symbol-for-exmap.patch


+ 0 - 0
target/linux/patches/3.16.49/fblogo.patch → target/linux/patches/3.16.48/fblogo.patch


+ 0 - 0
target/linux/patches/3.16.49/gemalto.patch → target/linux/patches/3.16.48/gemalto.patch


+ 0 - 0
target/linux/patches/3.16.49/initramfs-nosizelimit.patch → target/linux/patches/3.16.48/initramfs-nosizelimit.patch


+ 0 - 0
target/linux/patches/3.16.49/lemote-rfkill.patch → target/linux/patches/3.16.48/lemote-rfkill.patch


+ 0 - 0
target/linux/patches/3.16.49/microblaze-ethernet.patch → target/linux/patches/3.16.48/microblaze-ethernet.patch


+ 0 - 0
target/linux/patches/3.16.49/mkpiggy.patch → target/linux/patches/3.16.48/mkpiggy.patch


+ 0 - 0
target/linux/patches/3.16.49/mtd-rootfs.patch → target/linux/patches/3.16.48/mtd-rootfs.patch


+ 0 - 0
target/linux/patches/3.16.49/nfsv3-tcp.patch → target/linux/patches/3.16.48/nfsv3-tcp.patch


+ 0 - 0
target/linux/patches/3.16.49/non-static.patch → target/linux/patches/3.16.48/non-static.patch


+ 0 - 0
target/linux/patches/3.16.49/ppc64-missing-zlib.patch → target/linux/patches/3.16.48/ppc64-missing-zlib.patch


+ 0 - 0
target/linux/patches/3.16.49/relocs.patch → target/linux/patches/3.16.48/relocs.patch


+ 0 - 0
target/linux/patches/3.16.49/sgidefs.patch → target/linux/patches/3.16.48/sgidefs.patch


+ 0 - 0
target/linux/patches/3.16.49/sortext.patch → target/linux/patches/3.16.48/sortext.patch


+ 0 - 0
target/linux/patches/3.16.49/startup.patch → target/linux/patches/3.16.48/startup.patch


+ 0 - 0
target/linux/patches/3.16.49/wlan-cf.patch → target/linux/patches/3.16.48/wlan-cf.patch


+ 0 - 0
target/linux/patches/3.16.49/xargs.patch → target/linux/patches/3.16.48/xargs.patch


+ 0 - 0
target/linux/patches/3.2.94/sparc-aout.patch → target/linux/patches/3.2.93/sparc-aout.patch


+ 2512 - 0
target/linux/patches/3.4.113/bsd-compatibility.patch

@@ -0,0 +1,2512 @@
+diff -Nur linux-2.6.36.orig/scripts/Makefile.lib linux-2.6.36/scripts/Makefile.lib
+--- linux-2.6.36.orig/scripts/Makefile.lib	2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/scripts/Makefile.lib	2010-11-28 18:34:22.000000000 +0100
+@@ -216,7 +216,12 @@
+ size_append = printf $(shell						\
+ dec_size=0;								\
+ for F in $1; do								\
+-	fsize=$$(stat -c "%s" $$F);					\
++	if stat -qs .>/dev/null 2>&1; then				\
++		statcmd='stat -f %z';					\
++	else								\
++		statcmd='stat -c %s';					\
++	fi;								\
++	fsize=$$($$statcmd $$F);					\
+ 	dec_size=$$(expr $$dec_size + $$fsize);				\
+ done;									\
+ printf "%08x\n" $$dec_size |						\
+diff -Nur linux-2.6.36.orig/scripts/mod/mk_elfconfig.c linux-2.6.36/scripts/mod/mk_elfconfig.c
+--- linux-2.6.36.orig/scripts/mod/mk_elfconfig.c	2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/scripts/mod/mk_elfconfig.c	2010-11-28 18:33:24.000000000 +0100
+@@ -1,7 +1,18 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <elf.h>
++
++#define EI_NIDENT (16)
++#define ELFMAG          "\177ELF"
++
++#define SELFMAG         4
++#define EI_CLASS        4
++#define ELFCLASS32      1               /* 32-bit objects */
++#define ELFCLASS64      2               /* 64-bit objects */
++
++#define EI_DATA         5               /* Data encoding byte index */
++#define ELFDATA2LSB     1               /* 2's complement, little endian */
++#define ELFDATA2MSB     2               /* 2's complement, big endian */
+ 
+ int
+ main(int argc, char **argv)
+diff -Nur linux-2.6.36.orig/scripts/mod/modpost.h linux-2.6.36/scripts/mod/modpost.h
+--- linux-2.6.36.orig/scripts/mod/modpost.h	2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/scripts/mod/modpost.h	2010-11-28 18:33:24.000000000 +0100
+@@ -7,7 +7,2453 @@
+ #include <sys/mman.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+-#include <elf.h>
++
++
++/* This file defines standard ELF types, structures, and macros.
++   Copyright (C) 1995-1999,2000,2001,2002,2003 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C 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.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _ELF_H
++#define	_ELF_H 1
++
++__BEGIN_DECLS
++
++/* Standard ELF types.  */
++
++#include <stdint.h>
++
++/* Type for a 16-bit quantity.  */
++typedef uint16_t Elf32_Half;
++typedef uint16_t Elf64_Half;
++
++/* Types for signed and unsigned 32-bit quantities.  */
++typedef uint32_t Elf32_Word;
++typedef	int32_t  Elf32_Sword;
++typedef uint32_t Elf64_Word;
++typedef	int32_t  Elf64_Sword;
++
++/* Types for signed and unsigned 64-bit quantities.  */
++typedef uint64_t Elf32_Xword;
++typedef	int64_t  Elf32_Sxword;
++typedef uint64_t Elf64_Xword;
++typedef	int64_t  Elf64_Sxword;
++
++/* Type of addresses.  */
++typedef uint32_t Elf32_Addr;
++typedef uint64_t Elf64_Addr;
++
++/* Type of file offsets.  */
++typedef uint32_t Elf32_Off;
++typedef uint64_t Elf64_Off;
++
++/* Type for section indices, which are 16-bit quantities.  */
++typedef uint16_t Elf32_Section;
++typedef uint16_t Elf64_Section;
++
++/* Type for version symbol information.  */
++typedef Elf32_Half Elf32_Versym;
++typedef Elf64_Half Elf64_Versym;
++
++
++/* The ELF file header.  This appears at the start of every ELF file.  */
++
++#define EI_NIDENT (16)
++
++typedef struct
++{
++  unsigned char	e_ident[EI_NIDENT];	/* Magic number and other info */
++  Elf32_Half	e_type;			/* Object file type */
++  Elf32_Half	e_machine;		/* Architecture */
++  Elf32_Word	e_version;		/* Object file version */
++  Elf32_Addr	e_entry;		/* Entry point virtual address */
++  Elf32_Off	e_phoff;		/* Program header table file offset */
++  Elf32_Off	e_shoff;		/* Section header table file offset */
++  Elf32_Word	e_flags;		/* Processor-specific flags */
++  Elf32_Half	e_ehsize;		/* ELF header size in bytes */
++  Elf32_Half	e_phentsize;		/* Program header table entry size */
++  Elf32_Half	e_phnum;		/* Program header table entry count */
++  Elf32_Half	e_shentsize;		/* Section header table entry size */
++  Elf32_Half	e_shnum;		/* Section header table entry count */
++  Elf32_Half	e_shstrndx;		/* Section header string table index */
++} Elf32_Ehdr;
++
++typedef struct
++{
++  unsigned char	e_ident[EI_NIDENT];	/* Magic number and other info */
++  Elf64_Half	e_type;			/* Object file type */
++  Elf64_Half	e_machine;		/* Architecture */
++  Elf64_Word	e_version;		/* Object file version */
++  Elf64_Addr	e_entry;		/* Entry point virtual address */
++  Elf64_Off	e_phoff;		/* Program header table file offset */
++  Elf64_Off	e_shoff;		/* Section header table file offset */
++  Elf64_Word	e_flags;		/* Processor-specific flags */
++  Elf64_Half	e_ehsize;		/* ELF header size in bytes */
++  Elf64_Half	e_phentsize;		/* Program header table entry size */
++  Elf64_Half	e_phnum;		/* Program header table entry count */
++  Elf64_Half	e_shentsize;		/* Section header table entry size */
++  Elf64_Half	e_shnum;		/* Section header table entry count */
++  Elf64_Half	e_shstrndx;		/* Section header string table index */
++} Elf64_Ehdr;
++
++/* Fields in the e_ident array.  The EI_* macros are indices into the
++   array.  The macros under each EI_* macro are the values the byte
++   may have.  */
++
++#define EI_MAG0		0		/* File identification byte 0 index */
++#define ELFMAG0		0x7f		/* Magic number byte 0 */
++
++#define EI_MAG1		1		/* File identification byte 1 index */
++#define ELFMAG1		'E'		/* Magic number byte 1 */
++
++#define EI_MAG2		2		/* File identification byte 2 index */
++#define ELFMAG2		'L'		/* Magic number byte 2 */
++
++#define EI_MAG3		3		/* File identification byte 3 index */
++#define ELFMAG3		'F'		/* Magic number byte 3 */
++
++/* Conglomeration of the identification bytes, for easy testing as a word.  */
++#define	ELFMAG		"\177ELF"
++#define	SELFMAG		4
++
++#define EI_CLASS	4		/* File class byte index */
++#define ELFCLASSNONE	0		/* Invalid class */
++#define ELFCLASS32	1		/* 32-bit objects */
++#define ELFCLASS64	2		/* 64-bit objects */
++#define ELFCLASSNUM	3
++
++#define EI_DATA		5		/* Data encoding byte index */
++#define ELFDATANONE	0		/* Invalid data encoding */
++#define ELFDATA2LSB	1		/* 2's complement, little endian */
++#define ELFDATA2MSB	2		/* 2's complement, big endian */
++#define ELFDATANUM	3
++
++#define EI_VERSION	6		/* File version byte index */
++					/* Value must be EV_CURRENT */
++
++#define EI_OSABI	7		/* OS ABI identification */
++#define ELFOSABI_NONE		0	/* UNIX System V ABI */
++#define ELFOSABI_SYSV		0	/* Alias.  */
++#define ELFOSABI_HPUX		1	/* HP-UX */
++#define ELFOSABI_NETBSD		2	/* NetBSD.  */
++#define ELFOSABI_LINUX		3	/* Linux.  */
++#define ELFOSABI_SOLARIS	6	/* Sun Solaris.  */
++#define ELFOSABI_AIX		7	/* IBM AIX.  */
++#define ELFOSABI_IRIX		8	/* SGI Irix.  */
++#define ELFOSABI_FREEBSD	9	/* FreeBSD.  */
++#define ELFOSABI_TRU64		10	/* Compaq TRU64 UNIX.  */
++#define ELFOSABI_MODESTO	11	/* Novell Modesto.  */
++#define ELFOSABI_OPENBSD	12	/* OpenBSD.  */
++#define ELFOSABI_ARM		97	/* ARM */
++#define ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
++
++#define EI_ABIVERSION	8		/* ABI version */
++
++#define EI_PAD		9		/* Byte index of padding bytes */
++
++/* Legal values for e_type (object file type).  */
++
++#define ET_NONE		0		/* No file type */
++#define ET_REL		1		/* Relocatable file */
++#define ET_EXEC		2		/* Executable file */
++#define ET_DYN		3		/* Shared object file */
++#define ET_CORE		4		/* Core file */
++#define	ET_NUM		5		/* Number of defined types */
++#define ET_LOOS		0xfe00		/* OS-specific range start */
++#define ET_HIOS		0xfeff		/* OS-specific range end */
++#define ET_LOPROC	0xff00		/* Processor-specific range start */
++#define ET_HIPROC	0xffff		/* Processor-specific range end */
++
++/* Legal values for e_machine (architecture).  */
++
++#define EM_NONE		 0		/* No machine */
++#define EM_M32		 1		/* AT&T WE 32100 */
++#define EM_SPARC	 2		/* SUN SPARC */
++#define EM_386		 3		/* Intel 80386 */
++#define EM_68K		 4		/* Motorola m68k family */
++#define EM_88K		 5		/* Motorola m88k family */
++#define EM_860		 7		/* Intel 80860 */
++#define EM_MIPS		 8		/* MIPS R3000 big-endian */
++#define EM_S370		 9		/* IBM System/370 */
++#define EM_MIPS_RS3_LE	10		/* MIPS R3000 little-endian */
++
++#define EM_PARISC	15		/* HPPA */
++#define EM_VPP500	17		/* Fujitsu VPP500 */
++#define EM_SPARC32PLUS	18		/* Sun's "v8plus" */
++#define EM_960		19		/* Intel 80960 */
++#define EM_PPC		20		/* PowerPC */
++#define EM_PPC64	21		/* PowerPC 64-bit */
++#define EM_S390		22		/* IBM S390 */
++
++#define EM_V800		36		/* NEC V800 series */
++#define EM_FR20		37		/* Fujitsu FR20 */
++#define EM_RH32		38		/* TRW RH-32 */
++#define EM_RCE		39		/* Motorola RCE */
++#define EM_ARM		40		/* ARM */
++#define EM_FAKE_ALPHA	41		/* Digital Alpha */
++#define EM_SH		42		/* Hitachi SH */
++#define EM_SPARCV9	43		/* SPARC v9 64-bit */
++#define EM_TRICORE	44		/* Siemens Tricore */
++#define EM_ARC		45		/* Argonaut RISC Core */
++#define EM_H8_300	46		/* Hitachi H8/300 */
++#define EM_H8_300H	47		/* Hitachi H8/300H */
++#define EM_H8S		48		/* Hitachi H8S */
++#define EM_H8_500	49		/* Hitachi H8/500 */
++#define EM_IA_64	50		/* Intel Merced */
++#define EM_MIPS_X	51		/* Stanford MIPS-X */
++#define EM_COLDFIRE	52		/* Motorola Coldfire */
++#define EM_68HC12	53		/* Motorola M68HC12 */
++#define EM_MMA		54		/* Fujitsu MMA Multimedia Accelerator*/
++#define EM_PCP		55		/* Siemens PCP */
++#define EM_NCPU		56		/* Sony nCPU embeeded RISC */
++#define EM_NDR1		57		/* Denso NDR1 microprocessor */
++#define EM_STARCORE	58		/* Motorola Start*Core processor */
++#define EM_ME16		59		/* Toyota ME16 processor */
++#define EM_ST100	60		/* STMicroelectronic ST100 processor */
++#define EM_TINYJ	61		/* Advanced Logic Corp. Tinyj emb.fam*/
++#define EM_X86_64	62		/* AMD x86-64 architecture */
++#define EM_PDSP		63		/* Sony DSP Processor */
++
++#define EM_FX66		66		/* Siemens FX66 microcontroller */
++#define EM_ST9PLUS	67		/* STMicroelectronics ST9+ 8/16 mc */
++#define EM_ST7		68		/* STmicroelectronics ST7 8 bit mc */
++#define EM_68HC16	69		/* Motorola MC68HC16 microcontroller */
++#define EM_68HC11	70		/* Motorola MC68HC11 microcontroller */
++#define EM_68HC08	71		/* Motorola MC68HC08 microcontroller */
++#define EM_68HC05	72		/* Motorola MC68HC05 microcontroller */
++#define EM_SVX		73		/* Silicon Graphics SVx */
++#define EM_ST19		74		/* STMicroelectronics ST19 8 bit mc */
++#define EM_VAX		75		/* Digital VAX */
++#define EM_CRIS		76		/* Axis Communications 32-bit embedded processor */
++#define EM_JAVELIN	77		/* Infineon Technologies 32-bit embedded processor */
++#define EM_FIREPATH	78		/* Element 14 64-bit DSP Processor */
++#define EM_ZSP		79		/* LSI Logic 16-bit DSP Processor */
++#define EM_MMIX		80		/* Donald Knuth's educational 64-bit processor */
++#define EM_HUANY	81		/* Harvard University machine-independent object files */
++#define EM_PRISM	82		/* SiTera Prism */
++#define EM_AVR		83		/* Atmel AVR 8-bit microcontroller */
++#define EM_FR30		84		/* Fujitsu FR30 */
++#define EM_D10V		85		/* Mitsubishi D10V */
++#define EM_D30V		86		/* Mitsubishi D30V */
++#define EM_V850		87		/* NEC v850 */
++#define EM_M32R		88		/* Mitsubishi M32R */
++#define EM_MN10300	89		/* Matsushita MN10300 */
++#define EM_MN10200	90		/* Matsushita MN10200 */
++#define EM_PJ		91		/* picoJava */
++#define EM_OPENRISC	92		/* OpenRISC 32-bit embedded processor */
++#define EM_ARC_A5	93		/* ARC Cores Tangent-A5 */
++#define EM_XTENSA	94		/* Tensilica Xtensa Architecture */
++#define EM_NUM		95
++
++/* If it is necessary to assign new unofficial EM_* values, please
++   pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
++   chances of collision with official or non-GNU unofficial values.  */
++
++#define EM_ALPHA	0x9026
++
++/* Legal values for e_version (version).  */
++
++#define EV_NONE		0		/* Invalid ELF version */
++#define EV_CURRENT	1		/* Current version */
++#define EV_NUM		2
++
++/* Section header.  */
++
++typedef struct
++{
++  Elf32_Word	sh_name;		/* Section name (string tbl index) */
++  Elf32_Word	sh_type;		/* Section type */
++  Elf32_Word	sh_flags;		/* Section flags */
++  Elf32_Addr	sh_addr;		/* Section virtual addr at execution */
++  Elf32_Off	sh_offset;		/* Section file offset */
++  Elf32_Word	sh_size;		/* Section size in bytes */
++  Elf32_Word	sh_link;		/* Link to another section */
++  Elf32_Word	sh_info;		/* Additional section information */
++  Elf32_Word	sh_addralign;		/* Section alignment */
++  Elf32_Word	sh_entsize;		/* Entry size if section holds table */
++} Elf32_Shdr;
++
++typedef struct
++{
++  Elf64_Word	sh_name;		/* Section name (string tbl index) */
++  Elf64_Word	sh_type;		/* Section type */
++  Elf64_Xword	sh_flags;		/* Section flags */
++  Elf64_Addr	sh_addr;		/* Section virtual addr at execution */
++  Elf64_Off	sh_offset;		/* Section file offset */
++  Elf64_Xword	sh_size;		/* Section size in bytes */
++  Elf64_Word	sh_link;		/* Link to another section */
++  Elf64_Word	sh_info;		/* Additional section information */
++  Elf64_Xword	sh_addralign;		/* Section alignment */
++  Elf64_Xword	sh_entsize;		/* Entry size if section holds table */
++} Elf64_Shdr;
++
++/* Special section indices.  */
++
++#define SHN_UNDEF	0		/* Undefined section */
++#define SHN_LORESERVE	0xff00		/* Start of reserved indices */
++#define SHN_LOPROC	0xff00		/* Start of processor-specific */
++#define SHN_HIPROC	0xff1f		/* End of processor-specific */
++#define SHN_LOOS	0xff20		/* Start of OS-specific */
++#define SHN_HIOS	0xff3f		/* End of OS-specific */
++#define SHN_ABS		0xfff1		/* Associated symbol is absolute */
++#define SHN_COMMON	0xfff2		/* Associated symbol is common */
++#define SHN_XINDEX	0xffff		/* Index is in extra table.  */
++#define SHN_HIRESERVE	0xffff		/* End of reserved indices */
++
++/* Legal values for sh_type (section type).  */
++
++#define SHT_NULL	  0		/* Section header table entry unused */
++#define SHT_PROGBITS	  1		/* Program data */
++#define SHT_SYMTAB	  2		/* Symbol table */
++#define SHT_STRTAB	  3		/* String table */
++#define SHT_RELA	  4		/* Relocation entries with addends */
++#define SHT_HASH	  5		/* Symbol hash table */
++#define SHT_DYNAMIC	  6		/* Dynamic linking information */
++#define SHT_NOTE	  7		/* Notes */
++#define SHT_NOBITS	  8		/* Program space with no data (bss) */
++#define SHT_REL		  9		/* Relocation entries, no addends */
++#define SHT_SHLIB	  10		/* Reserved */
++#define SHT_DYNSYM	  11		/* Dynamic linker symbol table */
++#define SHT_INIT_ARRAY	  14		/* Array of constructors */
++#define SHT_FINI_ARRAY	  15		/* Array of destructors */
++#define SHT_PREINIT_ARRAY 16		/* Array of pre-constructors */
++#define SHT_GROUP	  17		/* Section group */
++#define SHT_SYMTAB_SHNDX  18		/* Extended section indeces */
++#define	SHT_NUM		  19		/* Number of defined types.  */
++#define SHT_LOOS	  0x60000000	/* Start OS-specific */
++#define SHT_GNU_LIBLIST	  0x6ffffff7	/* Prelink library list */
++#define SHT_CHECKSUM	  0x6ffffff8	/* Checksum for DSO content.  */
++#define SHT_LOSUNW	  0x6ffffffa	/* Sun-specific low bound.  */
++#define SHT_SUNW_move	  0x6ffffffa
++#define SHT_SUNW_COMDAT   0x6ffffffb
++#define SHT_SUNW_syminfo  0x6ffffffc
++#define SHT_GNU_verdef	  0x6ffffffd	/* Version definition section.  */
++#define SHT_GNU_verneed	  0x6ffffffe	/* Version needs section.  */
++#define SHT_GNU_versym	  0x6fffffff	/* Version symbol table.  */
++#define SHT_HISUNW	  0x6fffffff	/* Sun-specific high bound.  */
++#define SHT_HIOS	  0x6fffffff	/* End OS-specific type */
++#define SHT_LOPROC	  0x70000000	/* Start of processor-specific */
++#define SHT_HIPROC	  0x7fffffff	/* End of processor-specific */
++#define SHT_LOUSER	  0x80000000	/* Start of application-specific */
++#define SHT_HIUSER	  0x8fffffff	/* End of application-specific */
++
++/* Legal values for sh_flags (section flags).  */
++
++#define SHF_WRITE	     (1 << 0)	/* Writable */
++#define SHF_ALLOC	     (1 << 1)	/* Occupies memory during execution */
++#define SHF_EXECINSTR	     (1 << 2)	/* Executable */
++#define SHF_MERGE	     (1 << 4)	/* Might be merged */
++#define SHF_STRINGS	     (1 << 5)	/* Contains nul-terminated strings */
++#define SHF_INFO_LINK	     (1 << 6)	/* `sh_info' contains SHT index */
++#define SHF_LINK_ORDER	     (1 << 7)	/* Preserve order after combining */
++#define SHF_OS_NONCONFORMING (1 << 8)	/* Non-standard OS specific handling
++					   required */
++#define SHF_GROUP	     (1 << 9)	/* Section is member of a group.  */
++#define SHF_TLS		     (1 << 10)	/* Section hold thread-local data.  */
++#define SHF_MASKOS	     0x0ff00000	/* OS-specific.  */
++#define SHF_MASKPROC	     0xf0000000	/* Processor-specific */
++
++/* Section group handling.  */
++#define GRP_COMDAT	0x1		/* Mark group as COMDAT.  */
++
++/* Symbol table entry.  */
++
++typedef struct
++{
++  Elf32_Word	st_name;		/* Symbol name (string tbl index) */
++  Elf32_Addr	st_value;		/* Symbol value */
++  Elf32_Word	st_size;		/* Symbol size */
++  unsigned char	st_info;		/* Symbol type and binding */
++  unsigned char	st_other;		/* Symbol visibility */
++  Elf32_Section	st_shndx;		/* Section index */
++} Elf32_Sym;
++
++typedef struct
++{
++  Elf64_Word	st_name;		/* Symbol name (string tbl index) */
++  unsigned char	st_info;		/* Symbol type and binding */
++  unsigned char st_other;		/* Symbol visibility */
++  Elf64_Section	st_shndx;		/* Section index */
++  Elf64_Addr	st_value;		/* Symbol value */
++  Elf64_Xword	st_size;		/* Symbol size */
++} Elf64_Sym;
++
++/* The syminfo section if available contains additional information about
++   every dynamic symbol.  */
++
++typedef struct
++{
++  Elf32_Half si_boundto;		/* Direct bindings, symbol bound to */
++  Elf32_Half si_flags;			/* Per symbol flags */
++} Elf32_Syminfo;
++
++typedef struct
++{
++  Elf64_Half si_boundto;		/* Direct bindings, symbol bound to */
++  Elf64_Half si_flags;			/* Per symbol flags */
++} Elf64_Syminfo;
++
++/* Possible values for si_boundto.  */
++#define SYMINFO_BT_SELF		0xffff	/* Symbol bound to self */
++#define SYMINFO_BT_PARENT	0xfffe	/* Symbol bound to parent */
++#define SYMINFO_BT_LOWRESERVE	0xff00	/* Beginning of reserved entries */
++
++/* Possible bitmasks for si_flags.  */
++#define SYMINFO_FLG_DIRECT	0x0001	/* Direct bound symbol */
++#define SYMINFO_FLG_PASSTHRU	0x0002	/* Pass-thru symbol for translator */
++#define SYMINFO_FLG_COPY	0x0004	/* Symbol is a copy-reloc */
++#define SYMINFO_FLG_LAZYLOAD	0x0008	/* Symbol bound to object to be lazy
++					   loaded */
++/* Syminfo version values.  */
++#define SYMINFO_NONE		0
++#define SYMINFO_CURRENT		1
++#define SYMINFO_NUM		2
++
++
++/* How to extract and insert information held in the st_info field.  */
++
++#define ELF32_ST_BIND(val)		(((unsigned char) (val)) >> 4)
++#define ELF32_ST_TYPE(val)		((val) & 0xf)
++#define ELF32_ST_INFO(bind, type)	(((bind) << 4) + ((type) & 0xf))
++
++/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field.  */
++#define ELF64_ST_BIND(val)		ELF32_ST_BIND (val)
++#define ELF64_ST_TYPE(val)		ELF32_ST_TYPE (val)
++#define ELF64_ST_INFO(bind, type)	ELF32_ST_INFO ((bind), (type))
++
++/* Legal values for ST_BIND subfield of st_info (symbol binding).  */
++
++#define STB_LOCAL	0		/* Local symbol */
++#define STB_GLOBAL	1		/* Global symbol */
++#define STB_WEAK	2		/* Weak symbol */
++#define	STB_NUM		3		/* Number of defined types.  */
++#define STB_LOOS	10		/* Start of OS-specific */
++#define STB_HIOS	12		/* End of OS-specific */
++#define STB_LOPROC	13		/* Start of processor-specific */
++#define STB_HIPROC	15		/* End of processor-specific */
++
++/* Legal values for ST_TYPE subfield of st_info (symbol type).  */
++
++#define STT_NOTYPE	0		/* Symbol type is unspecified */
++#define STT_OBJECT	1		/* Symbol is a data object */
++#define STT_FUNC	2		/* Symbol is a code object */
++#define STT_SECTION	3		/* Symbol associated with a section */
++#define STT_FILE	4		/* Symbol's name is file name */
++#define STT_COMMON	5		/* Symbol is a common data object */
++#define STT_TLS		6		/* Symbol is thread-local data object*/
++#define	STT_NUM		7		/* Number of defined types.  */
++#define STT_LOOS	10		/* Start of OS-specific */
++#define STT_HIOS	12		/* End of OS-specific */
++#define STT_LOPROC	13		/* Start of processor-specific */
++#define STT_HIPROC	15		/* End of processor-specific */
++
++
++/* Symbol table indices are found in the hash buckets and chain table
++   of a symbol hash table section.  This special index value indicates
++   the end of a chain, meaning no further symbols are found in that bucket.  */
++
++#define STN_UNDEF	0		/* End of a chain.  */
++
++
++/* How to extract and insert information held in the st_other field.  */
++
++#define ELF32_ST_VISIBILITY(o)	((o) & 0x03)
++
++/* For ELF64 the definitions are the same.  */
++#define ELF64_ST_VISIBILITY(o)	ELF32_ST_VISIBILITY (o)
++
++/* Symbol visibility specification encoded in the st_other field.  */
++#define STV_DEFAULT	0		/* Default symbol visibility rules */
++#define STV_INTERNAL	1		/* Processor specific hidden class */
++#define STV_HIDDEN	2		/* Sym unavailable in other modules */
++#define STV_PROTECTED	3		/* Not preemptible, not exported */
++
++
++/* Relocation table entry without addend (in section of type SHT_REL).  */
++
++typedef struct
++{
++  Elf32_Addr	r_offset;		/* Address */
++  Elf32_Word	r_info;			/* Relocation type and symbol index */
++} Elf32_Rel;
++
++/* I have seen two different definitions of the Elf64_Rel and
++   Elf64_Rela structures, so we'll leave them out until Novell (or
++   whoever) gets their act together.  */
++/* The following, at least, is used on Sparc v9, MIPS, and Alpha.  */
++
++typedef struct
++{
++  Elf64_Addr	r_offset;		/* Address */
++  Elf64_Xword	r_info;			/* Relocation type and symbol index */
++} Elf64_Rel;
++
++/* Relocation table entry with addend (in section of type SHT_RELA).  */
++
++typedef struct
++{
++  Elf32_Addr	r_offset;		/* Address */
++  Elf32_Word	r_info;			/* Relocation type and symbol index */
++  Elf32_Sword	r_addend;		/* Addend */
++} Elf32_Rela;
++
++typedef struct
++{
++  Elf64_Addr	r_offset;		/* Address */
++  Elf64_Xword	r_info;			/* Relocation type and symbol index */
++  Elf64_Sxword	r_addend;		/* Addend */
++} Elf64_Rela;
++
++/* How to extract and insert information held in the r_info field.  */
++
++#define ELF32_R_SYM(val)		((val) >> 8)
++#define ELF32_R_TYPE(val)		((val) & 0xff)
++#define ELF32_R_INFO(sym, type)		(((sym) << 8) + ((type) & 0xff))
++
++#define ELF64_R_SYM(i)			((i) >> 32)
++#define ELF64_R_TYPE(i)			((i) & 0xffffffff)
++#define ELF64_R_INFO(sym,type)		((((Elf64_Xword) (sym)) << 32) + (type))
++
++/* Program segment header.  */
++
++typedef struct
++{
++  Elf32_Word	p_type;			/* Segment type */
++  Elf32_Off	p_offset;		/* Segment file offset */
++  Elf32_Addr	p_vaddr;		/* Segment virtual address */
++  Elf32_Addr	p_paddr;		/* Segment physical address */
++  Elf32_Word	p_filesz;		/* Segment size in file */
++  Elf32_Word	p_memsz;		/* Segment size in memory */
++  Elf32_Word	p_flags;		/* Segment flags */
++  Elf32_Word	p_align;		/* Segment alignment */
++} Elf32_Phdr;
++
++typedef struct
++{
++  Elf64_Word	p_type;			/* Segment type */
++  Elf64_Word	p_flags;		/* Segment flags */
++  Elf64_Off	p_offset;		/* Segment file offset */
++  Elf64_Addr	p_vaddr;		/* Segment virtual address */
++  Elf64_Addr	p_paddr;		/* Segment physical address */
++  Elf64_Xword	p_filesz;		/* Segment size in file */
++  Elf64_Xword	p_memsz;		/* Segment size in memory */
++  Elf64_Xword	p_align;		/* Segment alignment */
++} Elf64_Phdr;
++
++/* Legal values for p_type (segment type).  */
++
++#define	PT_NULL		0		/* Program header table entry unused */
++#define PT_LOAD		1		/* Loadable program segment */
++#define PT_DYNAMIC	2		/* Dynamic linking information */
++#define PT_INTERP	3		/* Program interpreter */
++#define PT_NOTE		4		/* Auxiliary information */
++#define PT_SHLIB	5		/* Reserved */
++#define PT_PHDR		6		/* Entry for header table itself */
++#define PT_TLS		7		/* Thread-local storage segment */
++#define	PT_NUM		8		/* Number of defined types */
++#define PT_LOOS		0x60000000	/* Start of OS-specific */
++#define PT_GNU_EH_FRAME	0x6474e550	/* GCC .eh_frame_hdr segment */
++#define PT_GNU_STACK	0x6474e551	/* Indicates stack executability */
++#define PT_LOSUNW	0x6ffffffa
++#define PT_SUNWBSS	0x6ffffffa	/* Sun Specific segment */
++#define PT_SUNWSTACK	0x6ffffffb	/* Stack segment */
++#define PT_HISUNW	0x6fffffff
++#define PT_HIOS		0x6fffffff	/* End of OS-specific */
++#define PT_LOPROC	0x70000000	/* Start of processor-specific */
++#define PT_HIPROC	0x7fffffff	/* End of processor-specific */
++
++/* Legal values for p_flags (segment flags).  */
++
++#define PF_X		(1 << 0)	/* Segment is executable */
++#define PF_W		(1 << 1)	/* Segment is writable */
++#define PF_R		(1 << 2)	/* Segment is readable */
++#define PF_MASKOS	0x0ff00000	/* OS-specific */
++#define PF_MASKPROC	0xf0000000	/* Processor-specific */
++
++/* Legal values for note segment descriptor types for core files. */
++
++#define NT_PRSTATUS	1		/* Contains copy of prstatus struct */
++#define NT_FPREGSET	2		/* Contains copy of fpregset struct */
++#define NT_PRPSINFO	3		/* Contains copy of prpsinfo struct */
++#define NT_PRXREG	4		/* Contains copy of prxregset struct */
++#define NT_TASKSTRUCT	4		/* Contains copy of task structure */
++#define NT_PLATFORM	5		/* String from sysinfo(SI_PLATFORM) */
++#define NT_AUXV		6		/* Contains copy of auxv array */
++#define NT_GWINDOWS	7		/* Contains copy of gwindows struct */
++#define NT_ASRS		8		/* Contains copy of asrset struct */
++#define NT_PSTATUS	10		/* Contains copy of pstatus struct */
++#define NT_PSINFO	13		/* Contains copy of psinfo struct */
++#define NT_PRCRED	14		/* Contains copy of prcred struct */
++#define NT_UTSNAME	15		/* Contains copy of utsname struct */
++#define NT_LWPSTATUS	16		/* Contains copy of lwpstatus struct */
++#define NT_LWPSINFO	17		/* Contains copy of lwpinfo struct */
++#define NT_PRFPXREG	20		/* Contains copy of fprxregset struct*/
++
++/* Legal values for the note segment descriptor types for object files.  */
++
++#define NT_VERSION	1		/* Contains a version string.  */
++
++
++/* Dynamic section entry.  */
++
++typedef struct
++{
++  Elf32_Sword	d_tag;			/* Dynamic entry type */
++  union
++    {
++      Elf32_Word d_val;			/* Integer value */
++      Elf32_Addr d_ptr;			/* Address value */
++    } d_un;
++} Elf32_Dyn;
++
++typedef struct
++{
++  Elf64_Sxword	d_tag;			/* Dynamic entry type */
++  union
++    {
++      Elf64_Xword d_val;		/* Integer value */
++      Elf64_Addr d_ptr;			/* Address value */
++    } d_un;
++} Elf64_Dyn;
++
++/* Legal values for d_tag (dynamic entry type).  */
++
++#define DT_NULL		0		/* Marks end of dynamic section */
++#define DT_NEEDED	1		/* Name of needed library */
++#define DT_PLTRELSZ	2		/* Size in bytes of PLT relocs */
++#define DT_PLTGOT	3		/* Processor defined value */
++#define DT_HASH		4		/* Address of symbol hash table */
++#define DT_STRTAB	5		/* Address of string table */
++#define DT_SYMTAB	6		/* Address of symbol table */
++#define DT_RELA		7		/* Address of Rela relocs */
++#define DT_RELASZ	8		/* Total size of Rela relocs */
++#define DT_RELAENT	9		/* Size of one Rela reloc */
++#define DT_STRSZ	10		/* Size of string table */
++#define DT_SYMENT	11		/* Size of one symbol table entry */
++#define DT_INIT		12		/* Address of init function */
++#define DT_FINI		13		/* Address of termination function */
++#define DT_SONAME	14		/* Name of shared object */
++#define DT_RPATH	15		/* Library search path (deprecated) */
++#define DT_SYMBOLIC	16		/* Start symbol search here */
++#define DT_REL		17		/* Address of Rel relocs */
++#define DT_RELSZ	18		/* Total size of Rel relocs */
++#define DT_RELENT	19		/* Size of one Rel reloc */
++#define DT_PLTREL	20		/* Type of reloc in PLT */
++#define DT_DEBUG	21		/* For debugging; unspecified */
++#define DT_TEXTREL	22		/* Reloc might modify .text */
++#define DT_JMPREL	23		/* Address of PLT relocs */
++#define	DT_BIND_NOW	24		/* Process relocations of object */
++#define	DT_INIT_ARRAY	25		/* Array with addresses of init fct */
++#define	DT_FINI_ARRAY	26		/* Array with addresses of fini fct */
++#define	DT_INIT_ARRAYSZ	27		/* Size in bytes of DT_INIT_ARRAY */
++#define	DT_FINI_ARRAYSZ	28		/* Size in bytes of DT_FINI_ARRAY */
++#define DT_RUNPATH	29		/* Library search path */
++#define DT_FLAGS	30		/* Flags for the object being loaded */
++#define DT_ENCODING	32		/* Start of encoded range */
++#define DT_PREINIT_ARRAY 32		/* Array with addresses of preinit fct*/
++#define DT_PREINIT_ARRAYSZ 33		/* size in bytes of DT_PREINIT_ARRAY */
++#define	DT_NUM		34		/* Number used */
++#define DT_LOOS		0x6000000d	/* Start of OS-specific */
++#define DT_HIOS		0x6ffff000	/* End of OS-specific */
++#define DT_LOPROC	0x70000000	/* Start of processor-specific */
++#define DT_HIPROC	0x7fffffff	/* End of processor-specific */
++#define	DT_PROCNUM	DT_MIPS_NUM	/* Most used by any processor */
++
++/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
++   Dyn.d_un.d_val field of the Elf*_Dyn structure.  This follows Sun's
++   approach.  */
++#define DT_VALRNGLO	0x6ffffd00
++#define DT_GNU_PRELINKED 0x6ffffdf5	/* Prelinking timestamp */
++#define DT_GNU_CONFLICTSZ 0x6ffffdf6	/* Size of conflict section */
++#define DT_GNU_LIBLISTSZ 0x6ffffdf7	/* Size of library list */
++#define DT_CHECKSUM	0x6ffffdf8
++#define DT_PLTPADSZ	0x6ffffdf9
++#define DT_MOVEENT	0x6ffffdfa
++#define DT_MOVESZ	0x6ffffdfb
++#define DT_FEATURE_1	0x6ffffdfc	/* Feature selection (DTF_*).  */
++#define DT_POSFLAG_1	0x6ffffdfd	/* Flags for DT_* entries, effecting
++					   the following DT_* entry.  */
++#define DT_SYMINSZ	0x6ffffdfe	/* Size of syminfo table (in bytes) */
++#define DT_SYMINENT	0x6ffffdff	/* Entry size of syminfo */
++#define DT_VALRNGHI	0x6ffffdff
++#define DT_VALTAGIDX(tag)	(DT_VALRNGHI - (tag))	/* Reverse order! */
++#define DT_VALNUM 12
++
++/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
++   Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
++
++   If any adjustment is made to the ELF object after it has been
++   built these entries will need to be adjusted.  */
++#define DT_ADDRRNGLO	0x6ffffe00
++#define DT_GNU_CONFLICT	0x6ffffef8	/* Start of conflict section */
++#define DT_GNU_LIBLIST	0x6ffffef9	/* Library list */
++#define DT_CONFIG	0x6ffffefa	/* Configuration information.  */
++#define DT_DEPAUDIT	0x6ffffefb	/* Dependency auditing.  */
++#define DT_AUDIT	0x6ffffefc	/* Object auditing.  */
++#define	DT_PLTPAD	0x6ffffefd	/* PLT padding.  */
++#define	DT_MOVETAB	0x6ffffefe	/* Move table.  */
++#define DT_SYMINFO	0x6ffffeff	/* Syminfo table.  */
++#define DT_ADDRRNGHI	0x6ffffeff
++#define DT_ADDRTAGIDX(tag)	(DT_ADDRRNGHI - (tag))	/* Reverse order! */
++#define DT_ADDRNUM 10
++
++/* The versioning entry types.  The next are defined as part of the
++   GNU extension.  */
++#define DT_VERSYM	0x6ffffff0
++
++#define DT_RELACOUNT	0x6ffffff9
++#define DT_RELCOUNT	0x6ffffffa
++
++/* These were chosen by Sun.  */
++#define DT_FLAGS_1	0x6ffffffb	/* State flags, see DF_1_* below.  */
++#define	DT_VERDEF	0x6ffffffc	/* Address of version definition
++					   table */
++#define	DT_VERDEFNUM	0x6ffffffd	/* Number of version definitions */
++#define	DT_VERNEED	0x6ffffffe	/* Address of table with needed
++					   versions */
++#define	DT_VERNEEDNUM	0x6fffffff	/* Number of needed versions */
++#define DT_VERSIONTAGIDX(tag)	(DT_VERNEEDNUM - (tag))	/* Reverse order! */
++#define DT_VERSIONTAGNUM 16
++
++/* Sun added these machine-independent extensions in the "processor-specific"
++   range.  Be compatible.  */
++#define DT_AUXILIARY    0x7ffffffd      /* Shared object to load before self */
++#define DT_FILTER       0x7fffffff      /* Shared object to get values from */
++#define DT_EXTRATAGIDX(tag)	((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
++#define DT_EXTRANUM	3
++
++/* Values of `d_un.d_val' in the DT_FLAGS entry.  */
++#define DF_ORIGIN	0x00000001	/* Object may use DF_ORIGIN */
++#define DF_SYMBOLIC	0x00000002	/* Symbol resolutions starts here */
++#define DF_TEXTREL	0x00000004	/* Object contains text relocations */
++#define DF_BIND_NOW	0x00000008	/* No lazy binding for this object */
++#define DF_STATIC_TLS	0x00000010	/* Module uses the static TLS model */
++
++/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
++   entry in the dynamic section.  */
++#define DF_1_NOW	0x00000001	/* Set RTLD_NOW for this object.  */
++#define DF_1_GLOBAL	0x00000002	/* Set RTLD_GLOBAL for this object.  */
++#define DF_1_GROUP	0x00000004	/* Set RTLD_GROUP for this object.  */
++#define DF_1_NODELETE	0x00000008	/* Set RTLD_NODELETE for this object.*/
++#define DF_1_LOADFLTR	0x00000010	/* Trigger filtee loading at runtime.*/
++#define DF_1_INITFIRST	0x00000020	/* Set RTLD_INITFIRST for this object*/
++#define DF_1_NOOPEN	0x00000040	/* Set RTLD_NOOPEN for this object.  */
++#define DF_1_ORIGIN	0x00000080	/* $ORIGIN must be handled.  */
++#define DF_1_DIRECT	0x00000100	/* Direct binding enabled.  */
++#define DF_1_TRANS	0x00000200
++#define DF_1_INTERPOSE	0x00000400	/* Object is used to interpose.  */
++#define DF_1_NODEFLIB	0x00000800	/* Ignore default lib search path.  */
++#define DF_1_NODUMP	0x00001000	/* Object can't be dldump'ed.  */
++#define DF_1_CONFALT	0x00002000	/* Configuration alternative created.*/
++#define DF_1_ENDFILTEE	0x00004000	/* Filtee terminates filters search. */
++#define	DF_1_DISPRELDNE	0x00008000	/* Disp reloc applied at build time. */
++#define	DF_1_DISPRELPND	0x00010000	/* Disp reloc applied at run-time.  */
++
++/* Flags for the feature selection in DT_FEATURE_1.  */
++#define DTF_1_PARINIT	0x00000001
++#define DTF_1_CONFEXP	0x00000002
++
++/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry.  */
++#define DF_P1_LAZYLOAD	0x00000001	/* Lazyload following object.  */
++#define DF_P1_GROUPPERM	0x00000002	/* Symbols from next object are not
++					   generally available.  */
++
++/* Version definition sections.  */
++
++typedef struct
++{
++  Elf32_Half	vd_version;		/* Version revision */
++  Elf32_Half	vd_flags;		/* Version information */
++  Elf32_Half	vd_ndx;			/* Version Index */
++  Elf32_Half	vd_cnt;			/* Number of associated aux entries */
++  Elf32_Word	vd_hash;		/* Version name hash value */
++  Elf32_Word	vd_aux;			/* Offset in bytes to verdaux array */
++  Elf32_Word	vd_next;		/* Offset in bytes to next verdef
++					   entry */
++} Elf32_Verdef;
++
++typedef struct
++{
++  Elf64_Half	vd_version;		/* Version revision */
++  Elf64_Half	vd_flags;		/* Version information */
++  Elf64_Half	vd_ndx;			/* Version Index */
++  Elf64_Half	vd_cnt;			/* Number of associated aux entries */
++  Elf64_Word	vd_hash;		/* Version name hash value */
++  Elf64_Word	vd_aux;			/* Offset in bytes to verdaux array */
++  Elf64_Word	vd_next;		/* Offset in bytes to next verdef
++					   entry */
++} Elf64_Verdef;
++
++
++/* Legal values for vd_version (version revision).  */
++#define VER_DEF_NONE	0		/* No version */
++#define VER_DEF_CURRENT	1		/* Current version */
++#define VER_DEF_NUM	2		/* Given version number */
++
++/* Legal values for vd_flags (version information flags).  */
++#define VER_FLG_BASE	0x1		/* Version definition of file itself */
++#define VER_FLG_WEAK	0x2		/* Weak version identifier */
++
++/* Versym symbol index values.  */
++#define	VER_NDX_LOCAL		0	/* Symbol is local.  */
++#define	VER_NDX_GLOBAL		1	/* Symbol is global.  */
++#define	VER_NDX_LORESERVE	0xff00	/* Beginning of reserved entries.  */
++#define	VER_NDX_ELIMINATE	0xff01	/* Symbol is to be eliminated.  */
++
++/* Auxialiary version information.  */
++
++typedef struct
++{
++  Elf32_Word	vda_name;		/* Version or dependency names */
++  Elf32_Word	vda_next;		/* Offset in bytes to next verdaux
++					   entry */
++} Elf32_Verdaux;
++
++typedef struct
++{
++  Elf64_Word	vda_name;		/* Version or dependency names */
++  Elf64_Word	vda_next;		/* Offset in bytes to next verdaux
++					   entry */
++} Elf64_Verdaux;
++
++
++/* Version dependency section.  */
++
++typedef struct
++{
++  Elf32_Half	vn_version;		/* Version of structure */
++  Elf32_Half	vn_cnt;			/* Number of associated aux entries */
++  Elf32_Word	vn_file;		/* Offset of filename for this
++					   dependency */
++  Elf32_Word	vn_aux;			/* Offset in bytes to vernaux array */
++  Elf32_Word	vn_next;		/* Offset in bytes to next verneed
++					   entry */
++} Elf32_Verneed;
++
++typedef struct
++{
++  Elf64_Half	vn_version;		/* Version of structure */
++  Elf64_Half	vn_cnt;			/* Number of associated aux entries */
++  Elf64_Word	vn_file;		/* Offset of filename for this
++					   dependency */
++  Elf64_Word	vn_aux;			/* Offset in bytes to vernaux array */
++  Elf64_Word	vn_next;		/* Offset in bytes to next verneed
++					   entry */
++} Elf64_Verneed;
++
++
++/* Legal values for vn_version (version revision).  */
++#define VER_NEED_NONE	 0		/* No version */
++#define VER_NEED_CURRENT 1		/* Current version */
++#define VER_NEED_NUM	 2		/* Given version number */
++
++/* Auxiliary needed version information.  */
++
++typedef struct
++{
++  Elf32_Word	vna_hash;		/* Hash value of dependency name */
++  Elf32_Half	vna_flags;		/* Dependency specific information */
++  Elf32_Half	vna_other;		/* Unused */
++  Elf32_Word	vna_name;		/* Dependency name string offset */
++  Elf32_Word	vna_next;		/* Offset in bytes to next vernaux
++					   entry */
++} Elf32_Vernaux;
++
++typedef struct
++{
++  Elf64_Word	vna_hash;		/* Hash value of dependency name */
++  Elf64_Half	vna_flags;		/* Dependency specific information */
++  Elf64_Half	vna_other;		/* Unused */
++  Elf64_Word	vna_name;		/* Dependency name string offset */
++  Elf64_Word	vna_next;		/* Offset in bytes to next vernaux
++					   entry */
++} Elf64_Vernaux;
++
++
++/* Legal values for vna_flags.  */
++#define VER_FLG_WEAK	0x2		/* Weak version identifier */
++
++
++/* Auxiliary vector.  */
++
++/* This vector is normally only used by the program interpreter.  The
++   usual definition in an ABI supplement uses the name auxv_t.  The
++   vector is not usually defined in a standard <elf.h> file, but it
++   can't hurt.  We rename it to avoid conflicts.  The sizes of these
++   types are an arrangement between the exec server and the program
++   interpreter, so we don't fully specify them here.  */
++
++typedef struct
++{
++  int a_type;			/* Entry type */
++  union
++    {
++      long int a_val;		/* Integer value */
++      void *a_ptr;		/* Pointer value */
++      void (*a_fcn) (void);	/* Function pointer value */
++    } a_un;
++} Elf32_auxv_t;
++
++typedef struct
++{
++  long int a_type;		/* Entry type */
++  union
++    {
++      long int a_val;		/* Integer value */
++      void *a_ptr;		/* Pointer value */
++      void (*a_fcn) (void);	/* Function pointer value */
++    } a_un;
++} Elf64_auxv_t;
++
++/* Legal values for a_type (entry type).  */
++
++#define AT_NULL		0		/* End of vector */
++#define AT_IGNORE	1		/* Entry should be ignored */
++#define AT_EXECFD	2		/* File descriptor of program */
++#define AT_PHDR		3		/* Program headers for program */
++#define AT_PHENT	4		/* Size of program header entry */
++#define AT_PHNUM	5		/* Number of program headers */
++#define AT_PAGESZ	6		/* System page size */
++#define AT_BASE		7		/* Base address of interpreter */
++#define AT_FLAGS	8		/* Flags */
++#define AT_ENTRY	9		/* Entry point of program */
++#define AT_NOTELF	10		/* Program is not ELF */
++#define AT_UID		11		/* Real uid */
++#define AT_EUID		12		/* Effective uid */
++#define AT_GID		13		/* Real gid */
++#define AT_EGID		14		/* Effective gid */
++#define AT_CLKTCK	17		/* Frequency of times() */
++
++/* Some more special a_type values describing the hardware.  */
++#define AT_PLATFORM	15		/* String identifying platform.  */
++#define AT_HWCAP	16		/* Machine dependent hints about
++					   processor capabilities.  */
++
++/* This entry gives some information about the FPU initialization
++   performed by the kernel.  */
++#define AT_FPUCW	18		/* Used FPU control word.  */
++
++/* Cache block sizes.  */
++#define AT_DCACHEBSIZE	19		/* Data cache block size.  */
++#define AT_ICACHEBSIZE	20		/* Instruction cache block size.  */
++#define AT_UCACHEBSIZE	21		/* Unified cache block size.  */
++
++/* A special ignored value for PPC, used by the kernel to control the
++   interpretation of the AUXV. Must be > 16.  */
++#define AT_IGNOREPPC	22		/* Entry should be ignored.  */
++
++#define	AT_SECURE	23		/* Boolean, was exec setuid-like?  */
++
++/* Pointer to the global system page used for system calls and other
++   nice things.  */
++#define AT_SYSINFO	32
++#define AT_SYSINFO_EHDR	33
++
++
++/* Note section contents.  Each entry in the note section begins with
++   a header of a fixed form.  */
++
++typedef struct
++{
++  Elf32_Word n_namesz;			/* Length of the note's name.  */
++  Elf32_Word n_descsz;			/* Length of the note's descriptor.  */
++  Elf32_Word n_type;			/* Type of the note.  */
++} Elf32_Nhdr;
++
++typedef struct
++{
++  Elf64_Word n_namesz;			/* Length of the note's name.  */
++  Elf64_Word n_descsz;			/* Length of the note's descriptor.  */
++  Elf64_Word n_type;			/* Type of the note.  */
++} Elf64_Nhdr;
++
++/* Known names of notes.  */
++
++/* Solaris entries in the note section have this name.  */
++#define ELF_NOTE_SOLARIS	"SUNW Solaris"
++
++/* Note entries for GNU systems have this name.  */
++#define ELF_NOTE_GNU		"GNU"
++
++
++/* Defined types of notes for Solaris.  */
++
++/* Value of descriptor (one word) is desired pagesize for the binary.  */
++#define ELF_NOTE_PAGESIZE_HINT	1
++
++
++/* Defined note types for GNU systems.  */
++
++/* ABI information.  The descriptor consists of words:
++   word 0: OS descriptor
++   word 1: major version of the ABI
++   word 2: minor version of the ABI
++   word 3: subminor version of the ABI
++*/
++#define ELF_NOTE_ABI		1
++
++/* Known OSes.  These value can appear in word 0 of an ELF_NOTE_ABI
++   note section entry.  */
++#define ELF_NOTE_OS_LINUX	0
++#define ELF_NOTE_OS_GNU		1
++#define ELF_NOTE_OS_SOLARIS2	2
++#define ELF_NOTE_OS_FREEBSD	3
++
++
++/* Move records.  */
++typedef struct
++{
++  Elf32_Xword m_value;		/* Symbol value.  */
++  Elf32_Word m_info;		/* Size and index.  */
++  Elf32_Word m_poffset;		/* Symbol offset.  */
++  Elf32_Half m_repeat;		/* Repeat count.  */
++  Elf32_Half m_stride;		/* Stride info.  */
++} Elf32_Move;
++
++typedef struct
++{
++  Elf64_Xword m_value;		/* Symbol value.  */
++  Elf64_Xword m_info;		/* Size and index.  */
++  Elf64_Xword m_poffset;	/* Symbol offset.  */
++  Elf64_Half m_repeat;		/* Repeat count.  */
++  Elf64_Half m_stride;		/* Stride info.  */
++} Elf64_Move;
++
++/* Macro to construct move records.  */
++#define ELF32_M_SYM(info)	((info) >> 8)
++#define ELF32_M_SIZE(info)	((unsigned char) (info))
++#define ELF32_M_INFO(sym, size)	(((sym) << 8) + (unsigned char) (size))
++
++#define ELF64_M_SYM(info)	ELF32_M_SYM (info)
++#define ELF64_M_SIZE(info)	ELF32_M_SIZE (info)
++#define ELF64_M_INFO(sym, size)	ELF32_M_INFO (sym, size)
++
++
++/* Motorola 68k specific definitions.  */
++
++/* Values for Elf32_Ehdr.e_flags.  */
++#define EF_CPU32	0x00810000
++
++/* m68k relocs.  */
++
++#define R_68K_NONE	0		/* No reloc */
++#define R_68K_32	1		/* Direct 32 bit  */
++#define R_68K_16	2		/* Direct 16 bit  */
++#define R_68K_8		3		/* Direct 8 bit  */
++#define R_68K_PC32	4		/* PC relative 32 bit */
++#define R_68K_PC16	5		/* PC relative 16 bit */
++#define R_68K_PC8	6		/* PC relative 8 bit */
++#define R_68K_GOT32	7		/* 32 bit PC relative GOT entry */
++#define R_68K_GOT16	8		/* 16 bit PC relative GOT entry */
++#define R_68K_GOT8	9		/* 8 bit PC relative GOT entry */
++#define R_68K_GOT32O	10		/* 32 bit GOT offset */
++#define R_68K_GOT16O	11		/* 16 bit GOT offset */
++#define R_68K_GOT8O	12		/* 8 bit GOT offset */
++#define R_68K_PLT32	13		/* 32 bit PC relative PLT address */
++#define R_68K_PLT16	14		/* 16 bit PC relative PLT address */
++#define R_68K_PLT8	15		/* 8 bit PC relative PLT address */
++#define R_68K_PLT32O	16		/* 32 bit PLT offset */
++#define R_68K_PLT16O	17		/* 16 bit PLT offset */
++#define R_68K_PLT8O	18		/* 8 bit PLT offset */
++#define R_68K_COPY	19		/* Copy symbol at runtime */
++#define R_68K_GLOB_DAT	20		/* Create GOT entry */
++#define R_68K_JMP_SLOT	21		/* Create PLT entry */
++#define R_68K_RELATIVE	22		/* Adjust by program base */
++/* Keep this the last entry.  */
++#define R_68K_NUM	23
++
++/* Intel 80386 specific definitions.  */
++
++/* i386 relocs.  */
++
++#define R_386_NONE	   0		/* No reloc */
++#define R_386_32	   1		/* Direct 32 bit  */
++#define R_386_PC32	   2		/* PC relative 32 bit */
++#define R_386_GOT32	   3		/* 32 bit GOT entry */
++#define R_386_PLT32	   4		/* 32 bit PLT address */
++#define R_386_COPY	   5		/* Copy symbol at runtime */
++#define R_386_GLOB_DAT	   6		/* Create GOT entry */
++#define R_386_JMP_SLOT	   7		/* Create PLT entry */
++#define R_386_RELATIVE	   8		/* Adjust by program base */
++#define R_386_GOTOFF	   9		/* 32 bit offset to GOT */
++#define R_386_GOTPC	   10		/* 32 bit PC relative offset to GOT */
++#define R_386_32PLT	   11
++#define R_386_TLS_TPOFF	   14		/* Offset in static TLS block */
++#define R_386_TLS_IE	   15		/* Address of GOT entry for static TLS
++					   block offset */
++#define R_386_TLS_GOTIE	   16		/* GOT entry for static TLS block
++					   offset */
++#define R_386_TLS_LE	   17		/* Offset relative to static TLS
++					   block */
++#define R_386_TLS_GD	   18		/* Direct 32 bit for GNU version of
++					   general dynamic thread local data */
++#define R_386_TLS_LDM	   19		/* Direct 32 bit for GNU version of
++					   local dynamic thread local data
++					   in LE code */
++#define R_386_16	   20
++#define R_386_PC16	   21
++#define R_386_8		   22
++#define R_386_PC8	   23
++#define R_386_TLS_GD_32	   24		/* Direct 32 bit for general dynamic
++					   thread local data */
++#define R_386_TLS_GD_PUSH  25		/* Tag for pushl in GD TLS code */
++#define R_386_TLS_GD_CALL  26		/* Relocation for call to
++					   __tls_get_addr() */
++#define R_386_TLS_GD_POP   27		/* Tag for popl in GD TLS code */
++#define R_386_TLS_LDM_32   28		/* Direct 32 bit for local dynamic
++					   thread local data in LE code */
++#define R_386_TLS_LDM_PUSH 29		/* Tag for pushl in LDM TLS code */
++#define R_386_TLS_LDM_CALL 30		/* Relocation for call to
++					   __tls_get_addr() in LDM code */
++#define R_386_TLS_LDM_POP  31		/* Tag for popl in LDM TLS code */
++#define R_386_TLS_LDO_32   32		/* Offset relative to TLS block */
++#define R_386_TLS_IE_32	   33		/* GOT entry for negated static TLS
++					   block offset */
++#define R_386_TLS_LE_32	   34		/* Negated offset relative to static
++					   TLS block */
++#define R_386_TLS_DTPMOD32 35		/* ID of module containing symbol */
++#define R_386_TLS_DTPOFF32 36		/* Offset in TLS block */
++#define R_386_TLS_TPOFF32  37		/* Negated offset in static TLS block */
++/* Keep this the last entry.  */
++#define R_386_NUM	   38
++
++/* SUN SPARC specific definitions.  */
++
++/* Legal values for ST_TYPE subfield of st_info (symbol type).  */
++
++#define STT_REGISTER	13		/* Global register reserved to app. */
++
++/* Values for Elf64_Ehdr.e_flags.  */
++
++#define EF_SPARCV9_MM		3
++#define EF_SPARCV9_TSO		0
++#define EF_SPARCV9_PSO		1
++#define EF_SPARCV9_RMO		2
++#define EF_SPARC_LEDATA		0x800000 /* little endian data */
++#define EF_SPARC_EXT_MASK	0xFFFF00
++#define EF_SPARC_32PLUS		0x000100 /* generic V8+ features */
++#define EF_SPARC_SUN_US1	0x000200 /* Sun UltraSPARC1 extensions */
++#define EF_SPARC_HAL_R1		0x000400 /* HAL R1 extensions */
++#define EF_SPARC_SUN_US3	0x000800 /* Sun UltraSPARCIII extensions */
++
++/* SPARC relocs.  */
++
++#define R_SPARC_NONE		0	/* No reloc */
++#define R_SPARC_8		1	/* Direct 8 bit */
++#define R_SPARC_16		2	/* Direct 16 bit */
++#define R_SPARC_32		3	/* Direct 32 bit */
++#define R_SPARC_DISP8		4	/* PC relative 8 bit */
++#define R_SPARC_DISP16		5	/* PC relative 16 bit */
++#define R_SPARC_DISP32		6	/* PC relative 32 bit */
++#define R_SPARC_WDISP30		7	/* PC relative 30 bit shifted */
++#define R_SPARC_WDISP22		8	/* PC relative 22 bit shifted */
++#define R_SPARC_HI22		9	/* High 22 bit */
++#define R_SPARC_22		10	/* Direct 22 bit */
++#define R_SPARC_13		11	/* Direct 13 bit */
++#define R_SPARC_LO10		12	/* Truncated 10 bit */
++#define R_SPARC_GOT10		13	/* Truncated 10 bit GOT entry */
++#define R_SPARC_GOT13		14	/* 13 bit GOT entry */
++#define R_SPARC_GOT22		15	/* 22 bit GOT entry shifted */
++#define R_SPARC_PC10		16	/* PC relative 10 bit truncated */
++#define R_SPARC_PC22		17	/* PC relative 22 bit shifted */
++#define R_SPARC_WPLT30		18	/* 30 bit PC relative PLT address */
++#define R_SPARC_COPY		19	/* Copy symbol at runtime */
++#define R_SPARC_GLOB_DAT	20	/* Create GOT entry */
++#define R_SPARC_JMP_SLOT	21	/* Create PLT entry */
++#define R_SPARC_RELATIVE	22	/* Adjust by program base */
++#define R_SPARC_UA32		23	/* Direct 32 bit unaligned */
++
++/* Additional Sparc64 relocs.  */
++
++#define R_SPARC_PLT32		24	/* Direct 32 bit ref to PLT entry */
++#define R_SPARC_HIPLT22		25	/* High 22 bit PLT entry */
++#define R_SPARC_LOPLT10		26	/* Truncated 10 bit PLT entry */
++#define R_SPARC_PCPLT32		27	/* PC rel 32 bit ref to PLT entry */
++#define R_SPARC_PCPLT22		28	/* PC rel high 22 bit PLT entry */
++#define R_SPARC_PCPLT10		29	/* PC rel trunc 10 bit PLT entry */
++#define R_SPARC_10		30	/* Direct 10 bit */
++#define R_SPARC_11		31	/* Direct 11 bit */
++#define R_SPARC_64		32	/* Direct 64 bit */
++#define R_SPARC_OLO10		33	/* 10bit with secondary 13bit addend */
++#define R_SPARC_HH22		34	/* Top 22 bits of direct 64 bit */
++#define R_SPARC_HM10		35	/* High middle 10 bits of ... */
++#define R_SPARC_LM22		36	/* Low middle 22 bits of ... */
++#define R_SPARC_PC_HH22		37	/* Top 22 bits of pc rel 64 bit */
++#define R_SPARC_PC_HM10		38	/* High middle 10 bit of ... */
++#define R_SPARC_PC_LM22		39	/* Low miggle 22 bits of ... */
++#define R_SPARC_WDISP16		40	/* PC relative 16 bit shifted */
++#define R_SPARC_WDISP19		41	/* PC relative 19 bit shifted */
++#define R_SPARC_7		43	/* Direct 7 bit */
++#define R_SPARC_5		44	/* Direct 5 bit */
++#define R_SPARC_6		45	/* Direct 6 bit */
++#define R_SPARC_DISP64		46	/* PC relative 64 bit */
++#define R_SPARC_PLT64		47	/* Direct 64 bit ref to PLT entry */
++#define R_SPARC_HIX22		48	/* High 22 bit complemented */
++#define R_SPARC_LOX10		49	/* Truncated 11 bit complemented */
++#define R_SPARC_H44		50	/* Direct high 12 of 44 bit */
++#define R_SPARC_M44		51	/* Direct mid 22 of 44 bit */
++#define R_SPARC_L44		52	/* Direct low 10 of 44 bit */
++#define R_SPARC_REGISTER	53	/* Global register usage */
++#define R_SPARC_UA64		54	/* Direct 64 bit unaligned */
++#define R_SPARC_UA16		55	/* Direct 16 bit unaligned */
++#define R_SPARC_TLS_GD_HI22	56
++#define R_SPARC_TLS_GD_LO10	57
++#define R_SPARC_TLS_GD_ADD	58
++#define R_SPARC_TLS_GD_CALL	59
++#define R_SPARC_TLS_LDM_HI22	60
++#define R_SPARC_TLS_LDM_LO10	61
++#define R_SPARC_TLS_LDM_ADD	62
++#define R_SPARC_TLS_LDM_CALL	63
++#define R_SPARC_TLS_LDO_HIX22	64
++#define R_SPARC_TLS_LDO_LOX10	65
++#define R_SPARC_TLS_LDO_ADD	66
++#define R_SPARC_TLS_IE_HI22	67
++#define R_SPARC_TLS_IE_LO10	68
++#define R_SPARC_TLS_IE_LD	69
++#define R_SPARC_TLS_IE_LDX	70
++#define R_SPARC_TLS_IE_ADD	71
++#define R_SPARC_TLS_LE_HIX22	72
++#define R_SPARC_TLS_LE_LOX10	73
++#define R_SPARC_TLS_DTPMOD32	74
++#define R_SPARC_TLS_DTPMOD64	75
++#define R_SPARC_TLS_DTPOFF32	76
++#define R_SPARC_TLS_DTPOFF64	77
++#define R_SPARC_TLS_TPOFF32	78
++#define R_SPARC_TLS_TPOFF64	79
++/* Keep this the last entry.  */
++#define R_SPARC_NUM		80
++
++/* For Sparc64, legal values for d_tag of Elf64_Dyn.  */
++
++#define DT_SPARC_REGISTER 0x70000001
++#define DT_SPARC_NUM	2
++
++/* Bits present in AT_HWCAP, primarily for Sparc32.  */
++
++#define HWCAP_SPARC_FLUSH	1	/* The cpu supports flush insn.  */
++#define HWCAP_SPARC_STBAR	2
++#define HWCAP_SPARC_SWAP	4
++#define HWCAP_SPARC_MULDIV	8
++#define HWCAP_SPARC_V9		16	/* The cpu is v9, so v8plus is ok.  */
++#define HWCAP_SPARC_ULTRA3	32
++
++/* MIPS R3000 specific definitions.  */
++
++/* Legal values for e_flags field of Elf32_Ehdr.  */
++
++#define EF_MIPS_NOREORDER   1		/* A .noreorder directive was used */
++#define EF_MIPS_PIC	    2		/* Contains PIC code */
++#define EF_MIPS_CPIC	    4		/* Uses PIC calling sequence */
++#define EF_MIPS_XGOT	    8
++#define EF_MIPS_64BIT_WHIRL 16
++#define EF_MIPS_ABI2	    32
++#define EF_MIPS_ABI_ON32    64
++#define EF_MIPS_ARCH	    0xf0000000	/* MIPS architecture level */
++
++/* Legal values for MIPS architecture level.  */
++
++#define EF_MIPS_ARCH_1	    0x00000000	/* -mips1 code.  */
++#define EF_MIPS_ARCH_2	    0x10000000	/* -mips2 code.  */
++#define EF_MIPS_ARCH_3	    0x20000000	/* -mips3 code.  */
++#define EF_MIPS_ARCH_4	    0x30000000	/* -mips4 code.  */
++#define EF_MIPS_ARCH_5	    0x40000000	/* -mips5 code.  */
++#define EF_MIPS_ARCH_32	    0x60000000	/* MIPS32 code.  */
++#define EF_MIPS_ARCH_64	    0x70000000	/* MIPS64 code.  */
++
++/* The following are non-official names and should not be used.  */
++
++#define E_MIPS_ARCH_1	  0x00000000	/* -mips1 code.  */
++#define E_MIPS_ARCH_2	  0x10000000	/* -mips2 code.  */
++#define E_MIPS_ARCH_3	  0x20000000	/* -mips3 code.  */
++#define E_MIPS_ARCH_4	  0x30000000	/* -mips4 code.  */
++#define E_MIPS_ARCH_5	  0x40000000	/* -mips5 code.  */
++#define E_MIPS_ARCH_32	  0x60000000	/* MIPS32 code.  */
++#define E_MIPS_ARCH_64	  0x70000000	/* MIPS64 code.  */
++
++/* Special section indices.  */
++
++#define SHN_MIPS_ACOMMON    0xff00	/* Allocated common symbols */
++#define SHN_MIPS_TEXT	    0xff01	/* Allocated test symbols.  */
++#define SHN_MIPS_DATA	    0xff02	/* Allocated data symbols.  */
++#define SHN_MIPS_SCOMMON    0xff03	/* Small common symbols */
++#define SHN_MIPS_SUNDEFINED 0xff04	/* Small undefined symbols */
++
++/* Legal values for sh_type field of Elf32_Shdr.  */
++
++#define SHT_MIPS_LIBLIST       0x70000000 /* Shared objects used in link */
++#define SHT_MIPS_MSYM	       0x70000001
++#define SHT_MIPS_CONFLICT      0x70000002 /* Conflicting symbols */
++#define SHT_MIPS_GPTAB	       0x70000003 /* Global data area sizes */
++#define SHT_MIPS_UCODE	       0x70000004 /* Reserved for SGI/MIPS compilers */
++#define SHT_MIPS_DEBUG	       0x70000005 /* MIPS ECOFF debugging information*/
++#define SHT_MIPS_REGINFO       0x70000006 /* Register usage information */
++#define SHT_MIPS_PACKAGE       0x70000007
++#define SHT_MIPS_PACKSYM       0x70000008
++#define SHT_MIPS_RELD	       0x70000009
++#define SHT_MIPS_IFACE         0x7000000b
++#define SHT_MIPS_CONTENT       0x7000000c
++#define SHT_MIPS_OPTIONS       0x7000000d /* Miscellaneous options.  */
++#define SHT_MIPS_SHDR	       0x70000010
++#define SHT_MIPS_FDESC	       0x70000011
++#define SHT_MIPS_EXTSYM	       0x70000012
++#define SHT_MIPS_DENSE	       0x70000013
++#define SHT_MIPS_PDESC	       0x70000014
++#define SHT_MIPS_LOCSYM	       0x70000015
++#define SHT_MIPS_AUXSYM	       0x70000016
++#define SHT_MIPS_OPTSYM	       0x70000017
++#define SHT_MIPS_LOCSTR	       0x70000018
++#define SHT_MIPS_LINE	       0x70000019
++#define SHT_MIPS_RFDESC	       0x7000001a
++#define SHT_MIPS_DELTASYM      0x7000001b
++#define SHT_MIPS_DELTAINST     0x7000001c
++#define SHT_MIPS_DELTACLASS    0x7000001d
++#define SHT_MIPS_DWARF         0x7000001e /* DWARF debugging information.  */
++#define SHT_MIPS_DELTADECL     0x7000001f
++#define SHT_MIPS_SYMBOL_LIB    0x70000020
++#define SHT_MIPS_EVENTS	       0x70000021 /* Event section.  */
++#define SHT_MIPS_TRANSLATE     0x70000022
++#define SHT_MIPS_PIXIE	       0x70000023
++#define SHT_MIPS_XLATE	       0x70000024
++#define SHT_MIPS_XLATE_DEBUG   0x70000025
++#define SHT_MIPS_WHIRL	       0x70000026
++#define SHT_MIPS_EH_REGION     0x70000027
++#define SHT_MIPS_XLATE_OLD     0x70000028
++#define SHT_MIPS_PDR_EXCEPTION 0x70000029
++
++/* Legal values for sh_flags field of Elf32_Shdr.  */
++
++#define SHF_MIPS_GPREL	 0x10000000	/* Must be part of global data area */
++#define SHF_MIPS_MERGE	 0x20000000
++#define SHF_MIPS_ADDR	 0x40000000
++#define SHF_MIPS_STRINGS 0x80000000
++#define SHF_MIPS_NOSTRIP 0x08000000
++#define SHF_MIPS_LOCAL	 0x04000000
++#define SHF_MIPS_NAMES	 0x02000000
++#define SHF_MIPS_NODUPE	 0x01000000
++
++
++/* Symbol tables.  */
++
++/* MIPS specific values for `st_other'.  */
++#define STO_MIPS_DEFAULT		0x0
++#define STO_MIPS_INTERNAL		0x1
++#define STO_MIPS_HIDDEN			0x2
++#define STO_MIPS_PROTECTED		0x3
++#define STO_MIPS_SC_ALIGN_UNUSED	0xff
++
++/* MIPS specific values for `st_info'.  */
++#define STB_MIPS_SPLIT_COMMON		13
++
++/* Entries found in sections of type SHT_MIPS_GPTAB.  */
++
++typedef union
++{
++  struct
++    {
++      Elf32_Word gt_current_g_value;	/* -G value used for compilation */
++      Elf32_Word gt_unused;		/* Not used */
++    } gt_header;			/* First entry in section */
++  struct
++    {
++      Elf32_Word gt_g_value;		/* If this value were used for -G */
++      Elf32_Word gt_bytes;		/* This many bytes would be used */
++    } gt_entry;				/* Subsequent entries in section */
++} Elf32_gptab;
++
++/* Entry found in sections of type SHT_MIPS_REGINFO.  */
++
++typedef struct
++{
++  Elf32_Word	ri_gprmask;		/* General registers used */
++  Elf32_Word	ri_cprmask[4];		/* Coprocessor registers used */
++  Elf32_Sword	ri_gp_value;		/* $gp register value */
++} Elf32_RegInfo;
++
++/* Entries found in sections of type SHT_MIPS_OPTIONS.  */
++
++typedef struct
++{
++  unsigned char kind;		/* Determines interpretation of the
++				   variable part of descriptor.  */
++  unsigned char size;		/* Size of descriptor, including header.  */
++  Elf32_Section section;	/* Section header index of section affected,
++				   0 for global options.  */
++  Elf32_Word info;		/* Kind-specific information.  */
++} Elf_Options;
++
++/* Values for `kind' field in Elf_Options.  */
++
++#define ODK_NULL	0	/* Undefined.  */
++#define ODK_REGINFO	1	/* Register usage information.  */
++#define ODK_EXCEPTIONS	2	/* Exception processing options.  */
++#define ODK_PAD		3	/* Section padding options.  */
++#define ODK_HWPATCH	4	/* Hardware workarounds performed */
++#define ODK_FILL	5	/* record the fill value used by the linker. */
++#define ODK_TAGS	6	/* reserve space for desktop tools to write. */
++#define ODK_HWAND	7	/* HW workarounds.  'AND' bits when merging. */
++#define ODK_HWOR	8	/* HW workarounds.  'OR' bits when merging.  */
++
++/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries.  */
++
++#define OEX_FPU_MIN	0x1f	/* FPE's which MUST be enabled.  */
++#define OEX_FPU_MAX	0x1f00	/* FPE's which MAY be enabled.  */
++#define OEX_PAGE0	0x10000	/* page zero must be mapped.  */
++#define OEX_SMM		0x20000	/* Force sequential memory mode?  */
++#define OEX_FPDBUG	0x40000	/* Force floating point debug mode?  */
++#define OEX_PRECISEFP	OEX_FPDBUG
++#define OEX_DISMISS	0x80000	/* Dismiss invalid address faults?  */
++
++#define OEX_FPU_INVAL	0x10
++#define OEX_FPU_DIV0	0x08
++#define OEX_FPU_OFLO	0x04
++#define OEX_FPU_UFLO	0x02
++#define OEX_FPU_INEX	0x01
++
++/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry.  */
++
++#define OHW_R4KEOP	0x1	/* R4000 end-of-page patch.  */
++#define OHW_R8KPFETCH	0x2	/* may need R8000 prefetch patch.  */
++#define OHW_R5KEOP	0x4	/* R5000 end-of-page patch.  */
++#define OHW_R5KCVTL	0x8	/* R5000 cvt.[ds].l bug.  clean=1.  */
++
++#define OPAD_PREFIX	0x1
++#define OPAD_POSTFIX	0x2
++#define OPAD_SYMBOL	0x4
++
++/* Entry found in `.options' section.  */
++
++typedef struct
++{
++  Elf32_Word hwp_flags1;	/* Extra flags.  */
++  Elf32_Word hwp_flags2;	/* Extra flags.  */
++} Elf_Options_Hw;
++
++/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries.  */
++
++#define OHWA0_R4KEOP_CHECKED	0x00000001
++#define OHWA1_R4KEOP_CLEAN	0x00000002
++
++/* MIPS relocs.  */
++
++#define R_MIPS_NONE		0	/* No reloc */
++#define R_MIPS_16		1	/* Direct 16 bit */
++#define R_MIPS_32		2	/* Direct 32 bit */
++#define R_MIPS_REL32		3	/* PC relative 32 bit */
++#define R_MIPS_26		4	/* Direct 26 bit shifted */
++#define R_MIPS_HI16		5	/* High 16 bit */
++#define R_MIPS_LO16		6	/* Low 16 bit */
++#define R_MIPS_GPREL16		7	/* GP relative 16 bit */
++#define R_MIPS_LITERAL		8	/* 16 bit literal entry */
++#define R_MIPS_GOT16		9	/* 16 bit GOT entry */
++#define R_MIPS_PC16		10	/* PC relative 16 bit */
++#define R_MIPS_CALL16		11	/* 16 bit GOT entry for function */
++#define R_MIPS_GPREL32		12	/* GP relative 32 bit */
++
++#define R_MIPS_SHIFT5		16
++#define R_MIPS_SHIFT6		17
++#define R_MIPS_64		18
++#define R_MIPS_GOT_DISP		19
++#define R_MIPS_GOT_PAGE		20
++#define R_MIPS_GOT_OFST		21
++#define R_MIPS_GOT_HI16		22
++#define R_MIPS_GOT_LO16		23
++#define R_MIPS_SUB		24
++#define R_MIPS_INSERT_A		25
++#define R_MIPS_INSERT_B		26
++#define R_MIPS_DELETE		27
++#define R_MIPS_HIGHER		28
++#define R_MIPS_HIGHEST		29
++#define R_MIPS_CALL_HI16	30
++#define R_MIPS_CALL_LO16	31
++#define R_MIPS_SCN_DISP		32
++#define R_MIPS_REL16		33
++#define R_MIPS_ADD_IMMEDIATE	34
++#define R_MIPS_PJUMP		35
++#define R_MIPS_RELGOT		36
++#define R_MIPS_JALR		37
++/* Keep this the last entry.  */
++#define R_MIPS_NUM		38
++
++/* Legal values for p_type field of Elf32_Phdr.  */
++
++#define PT_MIPS_REGINFO	0x70000000	/* Register usage information */
++#define PT_MIPS_RTPROC  0x70000001	/* Runtime procedure table. */
++#define PT_MIPS_OPTIONS 0x70000002
++
++/* Special program header types.  */
++
++#define PF_MIPS_LOCAL	0x10000000
++
++/* Legal values for d_tag field of Elf32_Dyn.  */
++
++#define DT_MIPS_RLD_VERSION  0x70000001	/* Runtime linker interface version */
++#define DT_MIPS_TIME_STAMP   0x70000002	/* Timestamp */
++#define DT_MIPS_ICHECKSUM    0x70000003	/* Checksum */
++#define DT_MIPS_IVERSION     0x70000004	/* Version string (string tbl index) */
++#define DT_MIPS_FLAGS	     0x70000005	/* Flags */
++#define DT_MIPS_BASE_ADDRESS 0x70000006	/* Base address */
++#define DT_MIPS_MSYM	     0x70000007
++#define DT_MIPS_CONFLICT     0x70000008	/* Address of CONFLICT section */
++#define DT_MIPS_LIBLIST	     0x70000009	/* Address of LIBLIST section */
++#define DT_MIPS_LOCAL_GOTNO  0x7000000a	/* Number of local GOT entries */
++#define DT_MIPS_CONFLICTNO   0x7000000b	/* Number of CONFLICT entries */
++#define DT_MIPS_LIBLISTNO    0x70000010	/* Number of LIBLIST entries */
++#define DT_MIPS_SYMTABNO     0x70000011	/* Number of DYNSYM entries */
++#define DT_MIPS_UNREFEXTNO   0x70000012	/* First external DYNSYM */
++#define DT_MIPS_GOTSYM	     0x70000013	/* First GOT entry in DYNSYM */
++#define DT_MIPS_HIPAGENO     0x70000014	/* Number of GOT page table entries */
++#define DT_MIPS_RLD_MAP	     0x70000016	/* Address of run time loader map.  */
++#define DT_MIPS_DELTA_CLASS  0x70000017	/* Delta C++ class definition.  */
++#define DT_MIPS_DELTA_CLASS_NO    0x70000018 /* Number of entries in
++						DT_MIPS_DELTA_CLASS.  */
++#define DT_MIPS_DELTA_INSTANCE    0x70000019 /* Delta C++ class instances.  */
++#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in
++						DT_MIPS_DELTA_INSTANCE.  */
++#define DT_MIPS_DELTA_RELOC  0x7000001b /* Delta relocations.  */
++#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in
++					     DT_MIPS_DELTA_RELOC.  */
++#define DT_MIPS_DELTA_SYM    0x7000001d /* Delta symbols that Delta
++					   relocations refer to.  */
++#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in
++					   DT_MIPS_DELTA_SYM.  */
++#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the
++					     class declaration.  */
++#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in
++						DT_MIPS_DELTA_CLASSSYM.  */
++#define DT_MIPS_CXX_FLAGS    0x70000022 /* Flags indicating for C++ flavor.  */
++#define DT_MIPS_PIXIE_INIT   0x70000023
++#define DT_MIPS_SYMBOL_LIB   0x70000024
++#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
++#define DT_MIPS_LOCAL_GOTIDX 0x70000026
++#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
++#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
++#define DT_MIPS_OPTIONS	     0x70000029 /* Address of .options.  */
++#define DT_MIPS_INTERFACE    0x7000002a /* Address of .interface.  */
++#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
++#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */
++#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve
++						    function stored in GOT.  */
++#define DT_MIPS_PERF_SUFFIX  0x7000002e /* Default suffix of dso to be added
++					   by rld on dlopen() calls.  */
++#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
++#define DT_MIPS_GP_VALUE     0x70000030 /* GP value for aux GOTs.  */
++#define DT_MIPS_AUX_DYNAMIC  0x70000031 /* Address of aux .dynamic.  */
++#define DT_MIPS_NUM	     0x32
++
++/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry.  */
++
++#define RHF_NONE		   0		/* No flags */
++#define RHF_QUICKSTART		   (1 << 0)	/* Use quickstart */
++#define RHF_NOTPOT		   (1 << 1)	/* Hash size not power of 2 */
++#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)	/* Ignore LD_LIBRARY_PATH */
++#define RHF_NO_MOVE		   (1 << 3)
++#define RHF_SGI_ONLY		   (1 << 4)
++#define RHF_GUARANTEE_INIT	   (1 << 5)
++#define RHF_DELTA_C_PLUS_PLUS	   (1 << 6)
++#define RHF_GUARANTEE_START_INIT   (1 << 7)
++#define RHF_PIXIE		   (1 << 8)
++#define RHF_DEFAULT_DELAY_LOAD	   (1 << 9)
++#define RHF_REQUICKSTART	   (1 << 10)
++#define RHF_REQUICKSTARTED	   (1 << 11)
++#define RHF_CORD		   (1 << 12)
++#define RHF_NO_UNRES_UNDEF	   (1 << 13)
++#define RHF_RLD_ORDER_SAFE	   (1 << 14)
++
++/* Entries found in sections of type SHT_MIPS_LIBLIST.  */
++
++typedef struct
++{
++  Elf32_Word l_name;		/* Name (string table index) */
++  Elf32_Word l_time_stamp;	/* Timestamp */
++  Elf32_Word l_checksum;	/* Checksum */
++  Elf32_Word l_version;		/* Interface version */
++  Elf32_Word l_flags;		/* Flags */
++} Elf32_Lib;
++
++typedef struct
++{
++  Elf64_Word l_name;		/* Name (string table index) */
++  Elf64_Word l_time_stamp;	/* Timestamp */
++  Elf64_Word l_checksum;	/* Checksum */
++  Elf64_Word l_version;		/* Interface version */
++  Elf64_Word l_flags;		/* Flags */
++} Elf64_Lib;
++
++
++/* Legal values for l_flags.  */
++
++#define LL_NONE		  0
++#define LL_EXACT_MATCH	  (1 << 0)	/* Require exact match */
++#define LL_IGNORE_INT_VER (1 << 1)	/* Ignore interface version */
++#define LL_REQUIRE_MINOR  (1 << 2)
++#define LL_EXPORTS	  (1 << 3)
++#define LL_DELAY_LOAD	  (1 << 4)
++#define LL_DELTA	  (1 << 5)
++
++/* Entries found in sections of type SHT_MIPS_CONFLICT.  */
++
++typedef Elf32_Addr Elf32_Conflict;
++
++
++/* HPPA specific definitions.  */
++
++/* Legal values for e_flags field of Elf32_Ehdr.  */
++
++#define EF_PARISC_TRAPNIL	0x00010000 /* Trap nil pointer dereference.  */
++#define EF_PARISC_EXT		0x00020000 /* Program uses arch. extensions. */
++#define EF_PARISC_LSB		0x00040000 /* Program expects little endian. */
++#define EF_PARISC_WIDE		0x00080000 /* Program expects wide mode.  */
++#define EF_PARISC_NO_KABP	0x00100000 /* No kernel assisted branch
++					      prediction.  */
++#define EF_PARISC_LAZYSWAP	0x00400000 /* Allow lazy swapping.  */
++#define EF_PARISC_ARCH		0x0000ffff /* Architecture version.  */
++
++/* Defined values for `e_flags & EF_PARISC_ARCH' are:  */
++
++#define EFA_PARISC_1_0		    0x020b /* PA-RISC 1.0 big-endian.  */
++#define EFA_PARISC_1_1		    0x0210 /* PA-RISC 1.1 big-endian.  */
++#define EFA_PARISC_2_0		    0x0214 /* PA-RISC 2.0 big-endian.  */
++
++/* Additional section indeces.  */
++
++#define SHN_PARISC_ANSI_COMMON	0xff00	   /* Section for tenatively declared
++					      symbols in ANSI C.  */
++#define SHN_PARISC_HUGE_COMMON	0xff01	   /* Common blocks in huge model.  */
++
++/* Legal values for sh_type field of Elf32_Shdr.  */
++
++#define SHT_PARISC_EXT		0x70000000 /* Contains product specific ext. */
++#define SHT_PARISC_UNWIND	0x70000001 /* Unwind information.  */
++#define SHT_PARISC_DOC		0x70000002 /* Debug info for optimized code. */
++
++/* Legal values for sh_flags field of Elf32_Shdr.  */
++
++#define SHF_PARISC_SHORT	0x20000000 /* Section with short addressing. */
++#define SHF_PARISC_HUGE		0x40000000 /* Section far from gp.  */
++#define SHF_PARISC_SBP		0x80000000 /* Static branch prediction code. */
++
++/* Legal values for ST_TYPE subfield of st_info (symbol type).  */
++
++#define STT_PARISC_MILLICODE	13	/* Millicode function entry point.  */
++
++#define STT_HP_OPAQUE		(STT_LOOS + 0x1)
++#define STT_HP_STUB		(STT_LOOS + 0x2)
++
++/* HPPA relocs.  */
++
++#define R_PARISC_NONE		0	/* No reloc.  */
++#define R_PARISC_DIR32		1	/* Direct 32-bit reference.  */
++#define R_PARISC_DIR21L		2	/* Left 21 bits of eff. address.  */
++#define R_PARISC_DIR17R		3	/* Right 17 bits of eff. address.  */
++#define R_PARISC_DIR17F		4	/* 17 bits of eff. address.  */
++#define R_PARISC_DIR14R		6	/* Right 14 bits of eff. address.  */
++#define R_PARISC_PCREL32	9	/* 32-bit rel. address.  */
++#define R_PARISC_PCREL21L	10	/* Left 21 bits of rel. address.  */
++#define R_PARISC_PCREL17R	11	/* Right 17 bits of rel. address.  */
++#define R_PARISC_PCREL17F	12	/* 17 bits of rel. address.  */
++#define R_PARISC_PCREL14R	14	/* Right 14 bits of rel. address.  */
++#define R_PARISC_DPREL21L	18	/* Left 21 bits of rel. address.  */
++#define R_PARISC_DPREL14R	22	/* Right 14 bits of rel. address.  */
++#define R_PARISC_GPREL21L	26	/* GP-relative, left 21 bits.  */
++#define R_PARISC_GPREL14R	30	/* GP-relative, right 14 bits.  */
++#define R_PARISC_LTOFF21L	34	/* LT-relative, left 21 bits.  */
++#define R_PARISC_LTOFF14R	38	/* LT-relative, right 14 bits.  */
++#define R_PARISC_SECREL32	41	/* 32 bits section rel. address.  */
++#define R_PARISC_SEGBASE	48	/* No relocation, set segment base.  */
++#define R_PARISC_SEGREL32	49	/* 32 bits segment rel. address.  */
++#define R_PARISC_PLTOFF21L	50	/* PLT rel. address, left 21 bits.  */
++#define R_PARISC_PLTOFF14R	54	/* PLT rel. address, right 14 bits.  */
++#define R_PARISC_LTOFF_FPTR32	57	/* 32 bits LT-rel. function pointer. */
++#define R_PARISC_LTOFF_FPTR21L	58	/* LT-rel. fct ptr, left 21 bits. */
++#define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
++#define R_PARISC_FPTR64		64	/* 64 bits function address.  */
++#define R_PARISC_PLABEL32	65	/* 32 bits function address.  */
++#define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
++#define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
++#define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
++#define R_PARISC_PCREL14DR	76	/* PC rel. address, right 14 bits.  */
++#define R_PARISC_PCREL16F	77	/* 16 bits PC-rel. address.  */
++#define R_PARISC_PCREL16WF	78	/* 16 bits PC-rel. address.  */
++#define R_PARISC_PCREL16DF	79	/* 16 bits PC-rel. address.  */
++#define R_PARISC_DIR64		80	/* 64 bits of eff. address.  */
++#define R_PARISC_DIR14WR	83	/* 14 bits of eff. address.  */
++#define R_PARISC_DIR14DR	84	/* 14 bits of eff. address.  */
++#define R_PARISC_DIR16F		85	/* 16 bits of eff. address.  */
++#define R_PARISC_DIR16WF	86	/* 16 bits of eff. address.  */
++#define R_PARISC_DIR16DF	87	/* 16 bits of eff. address.  */
++#define R_PARISC_GPREL64	88	/* 64 bits of GP-rel. address.  */
++#define R_PARISC_GPREL14WR	91	/* GP-rel. address, right 14 bits.  */
++#define R_PARISC_GPREL14DR	92	/* GP-rel. address, right 14 bits.  */
++#define R_PARISC_GPREL16F	93	/* 16 bits GP-rel. address.  */
++#define R_PARISC_GPREL16WF	94	/* 16 bits GP-rel. address.  */
++#define R_PARISC_GPREL16DF	95	/* 16 bits GP-rel. address.  */
++#define R_PARISC_LTOFF64	96	/* 64 bits LT-rel. address.  */
++#define R_PARISC_LTOFF14WR	99	/* LT-rel. address, right 14 bits.  */
++#define R_PARISC_LTOFF14DR	100	/* LT-rel. address, right 14 bits.  */
++#define R_PARISC_LTOFF16F	101	/* 16 bits LT-rel. address.  */
++#define R_PARISC_LTOFF16WF	102	/* 16 bits LT-rel. address.  */
++#define R_PARISC_LTOFF16DF	103	/* 16 bits LT-rel. address.  */
++#define R_PARISC_SECREL64	104	/* 64 bits section rel. address.  */
++#define R_PARISC_SEGREL64	112	/* 64 bits segment rel. address.  */
++#define R_PARISC_PLTOFF14WR	115	/* PLT-rel. address, right 14 bits.  */
++#define R_PARISC_PLTOFF14DR	116	/* PLT-rel. address, right 14 bits.  */
++#define R_PARISC_PLTOFF16F	117	/* 16 bits LT-rel. address.  */
++#define R_PARISC_PLTOFF16WF	118	/* 16 bits PLT-rel. address.  */
++#define R_PARISC_PLTOFF16DF	119	/* 16 bits PLT-rel. address.  */
++#define R_PARISC_LTOFF_FPTR64	120	/* 64 bits LT-rel. function ptr.  */
++#define R_PARISC_LTOFF_FPTR14WR	123	/* LT-rel. fct. ptr., right 14 bits. */
++#define R_PARISC_LTOFF_FPTR14DR	124	/* LT-rel. fct. ptr., right 14 bits. */
++#define R_PARISC_LTOFF_FPTR16F	125	/* 16 bits LT-rel. function ptr.  */
++#define R_PARISC_LTOFF_FPTR16WF	126	/* 16 bits LT-rel. function ptr.  */
++#define R_PARISC_LTOFF_FPTR16DF	127	/* 16 bits LT-rel. function ptr.  */
++#define R_PARISC_LORESERVE	128
++#define R_PARISC_COPY		128	/* Copy relocation.  */
++#define R_PARISC_IPLT		129	/* Dynamic reloc, imported PLT */
++#define R_PARISC_EPLT		130	/* Dynamic reloc, exported PLT */
++#define R_PARISC_TPREL32	153	/* 32 bits TP-rel. address.  */
++#define R_PARISC_TPREL21L	154	/* TP-rel. address, left 21 bits.  */
++#define R_PARISC_TPREL14R	158	/* TP-rel. address, right 14 bits.  */
++#define R_PARISC_LTOFF_TP21L	162	/* LT-TP-rel. address, left 21 bits. */
++#define R_PARISC_LTOFF_TP14R	166	/* LT-TP-rel. address, right 14 bits.*/
++#define R_PARISC_LTOFF_TP14F	167	/* 14 bits LT-TP-rel. address.  */
++#define R_PARISC_TPREL64	216	/* 64 bits TP-rel. address.  */
++#define R_PARISC_TPREL14WR	219	/* TP-rel. address, right 14 bits.  */
++#define R_PARISC_TPREL14DR	220	/* TP-rel. address, right 14 bits.  */
++#define R_PARISC_TPREL16F	221	/* 16 bits TP-rel. address.  */
++#define R_PARISC_TPREL16WF	222	/* 16 bits TP-rel. address.  */
++#define R_PARISC_TPREL16DF	223	/* 16 bits TP-rel. address.  */
++#define R_PARISC_LTOFF_TP64	224	/* 64 bits LT-TP-rel. address.  */
++#define R_PARISC_LTOFF_TP14WR	227	/* LT-TP-rel. address, right 14 bits.*/
++#define R_PARISC_LTOFF_TP14DR	228	/* LT-TP-rel. address, right 14 bits.*/
++#define R_PARISC_LTOFF_TP16F	229	/* 16 bits LT-TP-rel. address.  */
++#define R_PARISC_LTOFF_TP16WF	230	/* 16 bits LT-TP-rel. address.  */
++#define R_PARISC_LTOFF_TP16DF	231	/* 16 bits LT-TP-rel. address.  */
++#define R_PARISC_HIRESERVE	255
++
++/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr.  */
++
++#define PT_HP_TLS		(PT_LOOS + 0x0)
++#define PT_HP_CORE_NONE		(PT_LOOS + 0x1)
++#define PT_HP_CORE_VERSION	(PT_LOOS + 0x2)
++#define PT_HP_CORE_KERNEL	(PT_LOOS + 0x3)
++#define PT_HP_CORE_COMM		(PT_LOOS + 0x4)
++#define PT_HP_CORE_PROC		(PT_LOOS + 0x5)
++#define PT_HP_CORE_LOADABLE	(PT_LOOS + 0x6)
++#define PT_HP_CORE_STACK	(PT_LOOS + 0x7)
++#define PT_HP_CORE_SHM		(PT_LOOS + 0x8)
++#define PT_HP_CORE_MMF		(PT_LOOS + 0x9)
++#define PT_HP_PARALLEL		(PT_LOOS + 0x10)
++#define PT_HP_FASTBIND		(PT_LOOS + 0x11)
++#define PT_HP_OPT_ANNOT		(PT_LOOS + 0x12)
++#define PT_HP_HSL_ANNOT		(PT_LOOS + 0x13)
++#define PT_HP_STACK		(PT_LOOS + 0x14)
++
++#define PT_PARISC_ARCHEXT	0x70000000
++#define PT_PARISC_UNWIND	0x70000001
++
++/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr.  */
++
++#define PF_PARISC_SBP		0x08000000
++
++#define PF_HP_PAGE_SIZE		0x00100000
++#define PF_HP_FAR_SHARED	0x00200000
++#define PF_HP_NEAR_SHARED	0x00400000
++#define PF_HP_CODE		0x01000000
++#define PF_HP_MODIFY		0x02000000
++#define PF_HP_LAZYSWAP		0x04000000
++#define PF_HP_SBP		0x08000000
++
++
++/* Alpha specific definitions.  */
++
++/* Legal values for e_flags field of Elf64_Ehdr.  */
++
++#define EF_ALPHA_32BIT		1	/* All addresses must be < 2GB.  */
++#define EF_ALPHA_CANRELAX	2	/* Relocations for relaxing exist.  */
++
++/* Legal values for sh_type field of Elf64_Shdr.  */
++
++/* These two are primerily concerned with ECOFF debugging info.  */
++#define SHT_ALPHA_DEBUG		0x70000001
++#define SHT_ALPHA_REGINFO	0x70000002
++
++/* Legal values for sh_flags field of Elf64_Shdr.  */
++
++#define SHF_ALPHA_GPREL		0x10000000
++
++/* Legal values for st_other field of Elf64_Sym.  */
++#define STO_ALPHA_NOPV		0x80	/* No PV required.  */
++#define STO_ALPHA_STD_GPLOAD	0x88	/* PV only used for initial ldgp.  */
++
++/* Alpha relocs.  */
++
++#define R_ALPHA_NONE		0	/* No reloc */
++#define R_ALPHA_REFLONG		1	/* Direct 32 bit */
++#define R_ALPHA_REFQUAD		2	/* Direct 64 bit */
++#define R_ALPHA_GPREL32		3	/* GP relative 32 bit */
++#define R_ALPHA_LITERAL		4	/* GP relative 16 bit w/optimization */
++#define R_ALPHA_LITUSE		5	/* Optimization hint for LITERAL */
++#define R_ALPHA_GPDISP		6	/* Add displacement to GP */
++#define R_ALPHA_BRADDR		7	/* PC+4 relative 23 bit shifted */
++#define R_ALPHA_HINT		8	/* PC+4 relative 16 bit shifted */
++#define R_ALPHA_SREL16		9	/* PC relative 16 bit */
++#define R_ALPHA_SREL32		10	/* PC relative 32 bit */
++#define R_ALPHA_SREL64		11	/* PC relative 64 bit */
++#define R_ALPHA_GPRELHIGH	17	/* GP relative 32 bit, high 16 bits */
++#define R_ALPHA_GPRELLOW	18	/* GP relative 32 bit, low 16 bits */
++#define R_ALPHA_GPREL16		19	/* GP relative 16 bit */
++#define R_ALPHA_COPY		24	/* Copy symbol at runtime */
++#define R_ALPHA_GLOB_DAT	25	/* Create GOT entry */
++#define R_ALPHA_JMP_SLOT	26	/* Create PLT entry */
++#define R_ALPHA_RELATIVE	27	/* Adjust by program base */
++#define R_ALPHA_TLS_GD_HI	28
++#define R_ALPHA_TLSGD		29
++#define R_ALPHA_TLS_LDM		30
++#define R_ALPHA_DTPMOD64	31
++#define R_ALPHA_GOTDTPREL	32
++#define R_ALPHA_DTPREL64	33
++#define R_ALPHA_DTPRELHI	34
++#define R_ALPHA_DTPRELLO	35
++#define R_ALPHA_DTPREL16	36
++#define R_ALPHA_GOTTPREL	37
++#define R_ALPHA_TPREL64		38
++#define R_ALPHA_TPRELHI		39
++#define R_ALPHA_TPRELLO		40
++#define R_ALPHA_TPREL16		41
++/* Keep this the last entry.  */
++#define R_ALPHA_NUM		46
++
++/* Magic values of the LITUSE relocation addend.  */
++#define LITUSE_ALPHA_ADDR	0
++#define LITUSE_ALPHA_BASE	1
++#define LITUSE_ALPHA_BYTOFF	2
++#define LITUSE_ALPHA_JSR	3
++#define LITUSE_ALPHA_TLS_GD	4
++#define LITUSE_ALPHA_TLS_LDM	5
++
++
++/* PowerPC specific declarations */
++
++/* Values for Elf32/64_Ehdr.e_flags.  */
++#define EF_PPC_EMB		0x80000000	/* PowerPC embedded flag */
++
++/* Cygnus local bits below */
++#define EF_PPC_RELOCATABLE	0x00010000	/* PowerPC -mrelocatable flag*/
++#define EF_PPC_RELOCATABLE_LIB	0x00008000	/* PowerPC -mrelocatable-lib
++						   flag */
++
++/* PowerPC relocations defined by the ABIs */
++#define R_PPC_NONE		0
++#define R_PPC_ADDR32		1	/* 32bit absolute address */
++#define R_PPC_ADDR24		2	/* 26bit address, 2 bits ignored.  */
++#define R_PPC_ADDR16		3	/* 16bit absolute address */
++#define R_PPC_ADDR16_LO		4	/* lower 16bit of absolute address */
++#define R_PPC_ADDR16_HI		5	/* high 16bit of absolute address */
++#define R_PPC_ADDR16_HA		6	/* adjusted high 16bit */
++#define R_PPC_ADDR14		7	/* 16bit address, 2 bits ignored */
++#define R_PPC_ADDR14_BRTAKEN	8
++#define R_PPC_ADDR14_BRNTAKEN	9
++#define R_PPC_REL24		10	/* PC relative 26 bit */
++#define R_PPC_REL14		11	/* PC relative 16 bit */
++#define R_PPC_REL14_BRTAKEN	12
++#define R_PPC_REL14_BRNTAKEN	13
++#define R_PPC_GOT16		14
++#define R_PPC_GOT16_LO		15
++#define R_PPC_GOT16_HI		16
++#define R_PPC_GOT16_HA		17
++#define R_PPC_PLTREL24		18
++#define R_PPC_COPY		19
++#define R_PPC_GLOB_DAT		20
++#define R_PPC_JMP_SLOT		21
++#define R_PPC_RELATIVE		22
++#define R_PPC_LOCAL24PC		23
++#define R_PPC_UADDR32		24
++#define R_PPC_UADDR16		25
++#define R_PPC_REL32		26
++#define R_PPC_PLT32		27
++#define R_PPC_PLTREL32		28
++#define R_PPC_PLT16_LO		29
++#define R_PPC_PLT16_HI		30
++#define R_PPC_PLT16_HA		31
++#define R_PPC_SDAREL16		32
++#define R_PPC_SECTOFF		33
++#define R_PPC_SECTOFF_LO	34
++#define R_PPC_SECTOFF_HI	35
++#define R_PPC_SECTOFF_HA	36
++
++/* PowerPC relocations defined for the TLS access ABI.  */
++#define R_PPC_TLS		67 /* none	(sym+add)@tls */
++#define R_PPC_DTPMOD32		68 /* word32	(sym+add)@dtpmod */
++#define R_PPC_TPREL16		69 /* half16*	(sym+add)@tprel */
++#define R_PPC_TPREL16_LO	70 /* half16	(sym+add)@tprel@l */
++#define R_PPC_TPREL16_HI	71 /* half16	(sym+add)@tprel@h */
++#define R_PPC_TPREL16_HA	72 /* half16	(sym+add)@tprel@ha */
++#define R_PPC_TPREL32		73 /* word32	(sym+add)@tprel */
++#define R_PPC_DTPREL16		74 /* half16*	(sym+add)@dtprel */
++#define R_PPC_DTPREL16_LO	75 /* half16	(sym+add)@dtprel@l */
++#define R_PPC_DTPREL16_HI	76 /* half16	(sym+add)@dtprel@h */
++#define R_PPC_DTPREL16_HA	77 /* half16	(sym+add)@dtprel@ha */
++#define R_PPC_DTPREL32		78 /* word32	(sym+add)@dtprel */
++#define R_PPC_GOT_TLSGD16	79 /* half16*	(sym+add)@got@tlsgd */
++#define R_PPC_GOT_TLSGD16_LO	80 /* half16	(sym+add)@got@tlsgd@l */
++#define R_PPC_GOT_TLSGD16_HI	81 /* half16	(sym+add)@got@tlsgd@h */
++#define R_PPC_GOT_TLSGD16_HA	82 /* half16	(sym+add)@got@tlsgd@ha */
++#define R_PPC_GOT_TLSLD16	83 /* half16*	(sym+add)@got@tlsld */
++#define R_PPC_GOT_TLSLD16_LO	84 /* half16	(sym+add)@got@tlsld@l */
++#define R_PPC_GOT_TLSLD16_HI	85 /* half16	(sym+add)@got@tlsld@h */
++#define R_PPC_GOT_TLSLD16_HA	86 /* half16	(sym+add)@got@tlsld@ha */
++#define R_PPC_GOT_TPREL16	87 /* half16*	(sym+add)@got@tprel */
++#define R_PPC_GOT_TPREL16_LO	88 /* half16	(sym+add)@got@tprel@l */
++#define R_PPC_GOT_TPREL16_HI	89 /* half16	(sym+add)@got@tprel@h */
++#define R_PPC_GOT_TPREL16_HA	90 /* half16	(sym+add)@got@tprel@ha */
++#define R_PPC_GOT_DTPREL16	91 /* half16*	(sym+add)@got@dtprel */
++#define R_PPC_GOT_DTPREL16_LO	92 /* half16*	(sym+add)@got@dtprel@l */
++#define R_PPC_GOT_DTPREL16_HI	93 /* half16*	(sym+add)@got@dtprel@h */
++#define R_PPC_GOT_DTPREL16_HA	94 /* half16*	(sym+add)@got@dtprel@ha */
++
++/* Keep this the last entry.  */
++#define R_PPC_NUM		95
++
++/* The remaining relocs are from the Embedded ELF ABI, and are not
++   in the SVR4 ELF ABI.  */
++#define R_PPC_EMB_NADDR32	101
++#define R_PPC_EMB_NADDR16	102
++#define R_PPC_EMB_NADDR16_LO	103
++#define R_PPC_EMB_NADDR16_HI	104
++#define R_PPC_EMB_NADDR16_HA	105
++#define R_PPC_EMB_SDAI16	106
++#define R_PPC_EMB_SDA2I16	107
++#define R_PPC_EMB_SDA2REL	108
++#define R_PPC_EMB_SDA21		109	/* 16 bit offset in SDA */
++#define R_PPC_EMB_MRKREF	110
++#define R_PPC_EMB_RELSEC16	111
++#define R_PPC_EMB_RELST_LO	112
++#define R_PPC_EMB_RELST_HI	113
++#define R_PPC_EMB_RELST_HA	114
++#define R_PPC_EMB_BIT_FLD	115
++#define R_PPC_EMB_RELSDA	116	/* 16 bit relative offset in SDA */
++
++/* Diab tool relocations.  */
++#define R_PPC_DIAB_SDA21_LO	180	/* like EMB_SDA21, but lower 16 bit */
++#define R_PPC_DIAB_SDA21_HI	181	/* like EMB_SDA21, but high 16 bit */
++#define R_PPC_DIAB_SDA21_HA	182	/* like EMB_SDA21, adjusted high 16 */
++#define R_PPC_DIAB_RELSDA_LO	183	/* like EMB_RELSDA, but lower 16 bit */
++#define R_PPC_DIAB_RELSDA_HI	184	/* like EMB_RELSDA, but high 16 bit */
++#define R_PPC_DIAB_RELSDA_HA	185	/* like EMB_RELSDA, adjusted high 16 */
++
++/* This is a phony reloc to handle any old fashioned TOC16 references
++   that may still be in object files.  */
++#define R_PPC_TOC16		255
++
++
++/* PowerPC64 relocations defined by the ABIs */
++#define R_PPC64_NONE		R_PPC_NONE
++#define R_PPC64_ADDR32		R_PPC_ADDR32 /* 32bit absolute address */
++#define R_PPC64_ADDR24		R_PPC_ADDR24 /* 26bit address, word aligned */
++#define R_PPC64_ADDR16		R_PPC_ADDR16 /* 16bit absolute address */
++#define R_PPC64_ADDR16_LO	R_PPC_ADDR16_LO	/* lower 16bits of address */
++#define R_PPC64_ADDR16_HI	R_PPC_ADDR16_HI	/* high 16bits of address. */
++#define R_PPC64_ADDR16_HA	R_PPC_ADDR16_HA /* adjusted high 16bits.  */
++#define R_PPC64_ADDR14		R_PPC_ADDR14 /* 16bit address, word aligned */
++#define R_PPC64_ADDR14_BRTAKEN	R_PPC_ADDR14_BRTAKEN
++#define R_PPC64_ADDR14_BRNTAKEN	R_PPC_ADDR14_BRNTAKEN
++#define R_PPC64_REL24		R_PPC_REL24 /* PC-rel. 26 bit, word aligned */
++#define R_PPC64_REL14		R_PPC_REL14 /* PC relative 16 bit */
++#define R_PPC64_REL14_BRTAKEN	R_PPC_REL14_BRTAKEN
++#define R_PPC64_REL14_BRNTAKEN	R_PPC_REL14_BRNTAKEN
++#define R_PPC64_GOT16		R_PPC_GOT16
++#define R_PPC64_GOT16_LO	R_PPC_GOT16_LO
++#define R_PPC64_GOT16_HI	R_PPC_GOT16_HI
++#define R_PPC64_GOT16_HA	R_PPC_GOT16_HA
++
++#define R_PPC64_COPY		R_PPC_COPY
++#define R_PPC64_GLOB_DAT	R_PPC_GLOB_DAT
++#define R_PPC64_JMP_SLOT	R_PPC_JMP_SLOT
++#define R_PPC64_RELATIVE	R_PPC_RELATIVE
++
++#define R_PPC64_UADDR32		R_PPC_UADDR32
++#define R_PPC64_UADDR16		R_PPC_UADDR16
++#define R_PPC64_REL32		R_PPC_REL32
++#define R_PPC64_PLT32		R_PPC_PLT32
++#define R_PPC64_PLTREL32	R_PPC_PLTREL32
++#define R_PPC64_PLT16_LO	R_PPC_PLT16_LO
++#define R_PPC64_PLT16_HI	R_PPC_PLT16_HI
++#define R_PPC64_PLT16_HA	R_PPC_PLT16_HA
++
++#define R_PPC64_SECTOFF		R_PPC_SECTOFF
++#define R_PPC64_SECTOFF_LO	R_PPC_SECTOFF_LO
++#define R_PPC64_SECTOFF_HI	R_PPC_SECTOFF_HI
++#define R_PPC64_SECTOFF_HA	R_PPC_SECTOFF_HA
++#define R_PPC64_ADDR30		37 /* word30 (S + A - P) >> 2 */
++#define R_PPC64_ADDR64		38 /* doubleword64 S + A */
++#define R_PPC64_ADDR16_HIGHER	39 /* half16 #higher(S + A) */
++#define R_PPC64_ADDR16_HIGHERA	40 /* half16 #highera(S + A) */
++#define R_PPC64_ADDR16_HIGHEST	41 /* half16 #highest(S + A) */
++#define R_PPC64_ADDR16_HIGHESTA	42 /* half16 #highesta(S + A) */
++#define R_PPC64_UADDR64		43 /* doubleword64 S + A */
++#define R_PPC64_REL64		44 /* doubleword64 S + A - P */
++#define R_PPC64_PLT64		45 /* doubleword64 L + A */
++#define R_PPC64_PLTREL64	46 /* doubleword64 L + A - P */
++#define R_PPC64_TOC16		47 /* half16* S + A - .TOC */
++#define R_PPC64_TOC16_LO	48 /* half16 #lo(S + A - .TOC.) */
++#define R_PPC64_TOC16_HI	49 /* half16 #hi(S + A - .TOC.) */
++#define R_PPC64_TOC16_HA	50 /* half16 #ha(S + A - .TOC.) */
++#define R_PPC64_TOC		51 /* doubleword64 .TOC */
++#define R_PPC64_PLTGOT16	52 /* half16* M + A */
++#define R_PPC64_PLTGOT16_LO	53 /* half16 #lo(M + A) */
++#define R_PPC64_PLTGOT16_HI	54 /* half16 #hi(M + A) */
++#define R_PPC64_PLTGOT16_HA	55 /* half16 #ha(M + A) */
++
++#define R_PPC64_ADDR16_DS	56 /* half16ds* (S + A) >> 2 */
++#define R_PPC64_ADDR16_LO_DS	57 /* half16ds  #lo(S + A) >> 2 */
++#define R_PPC64_GOT16_DS	58 /* half16ds* (G + A) >> 2 */
++#define R_PPC64_GOT16_LO_DS	59 /* half16ds  #lo(G + A) >> 2 */
++#define R_PPC64_PLT16_LO_DS	60 /* half16ds  #lo(L + A) >> 2 */
++#define R_PPC64_SECTOFF_DS	61 /* half16ds* (R + A) >> 2 */
++#define R_PPC64_SECTOFF_LO_DS	62 /* half16ds  #lo(R + A) >> 2 */
++#define R_PPC64_TOC16_DS	63 /* half16ds* (S + A - .TOC.) >> 2 */
++#define R_PPC64_TOC16_LO_DS	64 /* half16ds  #lo(S + A - .TOC.) >> 2 */
++#define R_PPC64_PLTGOT16_DS	65 /* half16ds* (M + A) >> 2 */
++#define R_PPC64_PLTGOT16_LO_DS	66 /* half16ds  #lo(M + A) >> 2 */
++
++/* PowerPC64 relocations defined for the TLS access ABI.  */
++#define R_PPC64_TLS		67 /* none	(sym+add)@tls */
++#define R_PPC64_DTPMOD64	68 /* doubleword64 (sym+add)@dtpmod */
++#define R_PPC64_TPREL16		69 /* half16*	(sym+add)@tprel */
++#define R_PPC64_TPREL16_LO	70 /* half16	(sym+add)@tprel@l */
++#define R_PPC64_TPREL16_HI	71 /* half16	(sym+add)@tprel@h */
++#define R_PPC64_TPREL16_HA	72 /* half16	(sym+add)@tprel@ha */
++#define R_PPC64_TPREL64		73 /* doubleword64 (sym+add)@tprel */
++#define R_PPC64_DTPREL16	74 /* half16*	(sym+add)@dtprel */
++#define R_PPC64_DTPREL16_LO	75 /* half16	(sym+add)@dtprel@l */
++#define R_PPC64_DTPREL16_HI	76 /* half16	(sym+add)@dtprel@h */
++#define R_PPC64_DTPREL16_HA	77 /* half16	(sym+add)@dtprel@ha */
++#define R_PPC64_DTPREL64	78 /* doubleword64 (sym+add)@dtprel */
++#define R_PPC64_GOT_TLSGD16	79 /* half16*	(sym+add)@got@tlsgd */
++#define R_PPC64_GOT_TLSGD16_LO	80 /* half16	(sym+add)@got@tlsgd@l */
++#define R_PPC64_GOT_TLSGD16_HI	81 /* half16	(sym+add)@got@tlsgd@h */
++#define R_PPC64_GOT_TLSGD16_HA	82 /* half16	(sym+add)@got@tlsgd@ha */
++#define R_PPC64_GOT_TLSLD16	83 /* half16*	(sym+add)@got@tlsld */
++#define R_PPC64_GOT_TLSLD16_LO	84 /* half16	(sym+add)@got@tlsld@l */
++#define R_PPC64_GOT_TLSLD16_HI	85 /* half16	(sym+add)@got@tlsld@h */
++#define R_PPC64_GOT_TLSLD16_HA	86 /* half16	(sym+add)@got@tlsld@ha */
++#define R_PPC64_GOT_TPREL16_DS	87 /* half16ds*	(sym+add)@got@tprel */
++#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
++#define R_PPC64_GOT_TPREL16_HI	89 /* half16	(sym+add)@got@tprel@h */
++#define R_PPC64_GOT_TPREL16_HA	90 /* half16	(sym+add)@got@tprel@ha */
++#define R_PPC64_GOT_DTPREL16_DS	91 /* half16ds*	(sym+add)@got@dtprel */
++#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
++#define R_PPC64_GOT_DTPREL16_HI	93 /* half16	(sym+add)@got@dtprel@h */
++#define R_PPC64_GOT_DTPREL16_HA	94 /* half16	(sym+add)@got@dtprel@ha */
++#define R_PPC64_TPREL16_DS	95 /* half16ds*	(sym+add)@tprel */
++#define R_PPC64_TPREL16_LO_DS	96 /* half16ds	(sym+add)@tprel@l */
++#define R_PPC64_TPREL16_HIGHER	97 /* half16	(sym+add)@tprel@higher */
++#define R_PPC64_TPREL16_HIGHERA	98 /* half16	(sym+add)@tprel@highera */
++#define R_PPC64_TPREL16_HIGHEST	99 /* half16	(sym+add)@tprel@highest */
++#define R_PPC64_TPREL16_HIGHESTA 100 /* half16	(sym+add)@tprel@highesta */
++#define R_PPC64_DTPREL16_DS	101 /* half16ds* (sym+add)@dtprel */
++#define R_PPC64_DTPREL16_LO_DS	102 /* half16ds	(sym+add)@dtprel@l */
++#define R_PPC64_DTPREL16_HIGHER	103 /* half16	(sym+add)@dtprel@higher */
++#define R_PPC64_DTPREL16_HIGHERA 104 /* half16	(sym+add)@dtprel@highera */
++#define R_PPC64_DTPREL16_HIGHEST 105 /* half16	(sym+add)@dtprel@highest */
++#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16	(sym+add)@dtprel@highesta */
++
++/* Keep this the last entry.  */
++#define R_PPC64_NUM		107
++
++/* PowerPC64 specific values for the Dyn d_tag field.  */
++#define DT_PPC64_GLINK  (DT_LOPROC + 0)
++#define DT_PPC64_NUM    1
++
++
++/* ARM specific declarations */
++
++/* Processor specific flags for the ELF header e_flags field.  */
++#define EF_ARM_RELEXEC     0x01
++#define EF_ARM_HASENTRY    0x02
++#define EF_ARM_INTERWORK   0x04
++#define EF_ARM_APCS_26     0x08
++#define EF_ARM_APCS_FLOAT  0x10
++#define EF_ARM_PIC         0x20
++#define EF_ARM_ALIGN8      0x40		/* 8-bit structure alignment is in use */
++#define EF_ARM_NEW_ABI     0x80
++#define EF_ARM_OLD_ABI     0x100
++
++/* Other constants defined in the ARM ELF spec. version B-01.  */
++/* NB. These conflict with values defined above.  */
++#define EF_ARM_SYMSARESORTED	0x04
++#define EF_ARM_DYNSYMSUSESEGIDX 0x08
++#define EF_ARM_MAPSYMSFIRST	0x10
++#define EF_ARM_EABIMASK		0XFF000000
++
++#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
++#define EF_ARM_EABI_UNKNOWN  0x00000000
++#define EF_ARM_EABI_VER1     0x01000000
++#define EF_ARM_EABI_VER2     0x02000000
++
++/* Additional symbol types for Thumb */
++#define STT_ARM_TFUNC      0xd
++
++/* ARM-specific values for sh_flags */
++#define SHF_ARM_ENTRYSECT  0x10000000   /* Section contains an entry point */
++#define SHF_ARM_COMDEF     0x80000000   /* Section may be multiply defined
++					   in the input to a link step */
++
++/* ARM-specific program header flags */
++#define PF_ARM_SB          0x10000000   /* Segment contains the location
++					   addressed by the static base */
++
++/* ARM relocs.  */
++#define R_ARM_NONE		0	/* No reloc */
++#define R_ARM_PC24		1	/* PC relative 26 bit branch */
++#define R_ARM_ABS32		2	/* Direct 32 bit  */
++#define R_ARM_REL32		3	/* PC relative 32 bit */
++#define R_ARM_PC13		4
++#define R_ARM_ABS16		5	/* Direct 16 bit */
++#define R_ARM_ABS12		6	/* Direct 12 bit */
++#define R_ARM_THM_ABS5		7
++#define R_ARM_ABS8		8	/* Direct 8 bit */
++#define R_ARM_SBREL32		9
++#define R_ARM_THM_PC22		10
++#define R_ARM_THM_PC8		11
++#define R_ARM_AMP_VCALL9	12
++#define R_ARM_SWI24		13
++#define R_ARM_THM_SWI8		14
++#define R_ARM_XPC25		15
++#define R_ARM_THM_XPC22		16
++#define R_ARM_COPY		20	/* Copy symbol at runtime */
++#define R_ARM_GLOB_DAT		21	/* Create GOT entry */
++#define R_ARM_JUMP_SLOT		22	/* Create PLT entry */
++#define R_ARM_RELATIVE		23	/* Adjust by program base */
++#define R_ARM_GOTOFF		24	/* 32 bit offset to GOT */
++#define R_ARM_GOTPC		25	/* 32 bit PC relative offset to GOT */
++#define R_ARM_GOT32		26	/* 32 bit GOT entry */
++#define R_ARM_PLT32		27	/* 32 bit PLT address */
++#define R_ARM_ALU_PCREL_7_0	32
++#define R_ARM_ALU_PCREL_15_8	33
++#define R_ARM_ALU_PCREL_23_15	34
++#define R_ARM_LDR_SBREL_11_0	35
++#define R_ARM_ALU_SBREL_19_12	36
++#define R_ARM_ALU_SBREL_27_20	37
++#define R_ARM_GNU_VTENTRY	100
++#define R_ARM_GNU_VTINHERIT	101
++#define R_ARM_THM_PC11		102	/* thumb unconditional branch */
++#define R_ARM_THM_PC9		103	/* thumb conditional branch */
++#define R_ARM_RXPC25		249
++#define R_ARM_RSBREL32		250
++#define R_ARM_THM_RPC22		251
++#define R_ARM_RREL32		252
++#define R_ARM_RABS22		253
++#define R_ARM_RPC24		254
++#define R_ARM_RBASE		255
++/* Keep this the last entry.  */
++#define R_ARM_NUM		256
++
++/* IA-64 specific declarations.  */
++
++/* Processor specific flags for the Ehdr e_flags field.  */
++#define EF_IA_64_MASKOS		0x0000000f	/* os-specific flags */
++#define EF_IA_64_ABI64		0x00000010	/* 64-bit ABI */
++#define EF_IA_64_ARCH		0xff000000	/* arch. version mask */
++
++/* Processor specific values for the Phdr p_type field.  */
++#define PT_IA_64_ARCHEXT	(PT_LOPROC + 0)	/* arch extension bits */
++#define PT_IA_64_UNWIND		(PT_LOPROC + 1)	/* ia64 unwind bits */
++
++/* Processor specific flags for the Phdr p_flags field.  */
++#define PF_IA_64_NORECOV	0x80000000	/* spec insns w/o recovery */
++
++/* Processor specific values for the Shdr sh_type field.  */
++#define SHT_IA_64_EXT		(SHT_LOPROC + 0) /* extension bits */
++#define SHT_IA_64_UNWIND	(SHT_LOPROC + 1) /* unwind bits */
++
++/* Processor specific flags for the Shdr sh_flags field.  */
++#define SHF_IA_64_SHORT		0x10000000	/* section near gp */
++#define SHF_IA_64_NORECOV	0x20000000	/* spec insns w/o recovery */
++
++/* Processor specific values for the Dyn d_tag field.  */
++#define DT_IA_64_PLT_RESERVE	(DT_LOPROC + 0)
++#define DT_IA_64_NUM		1
++
++/* IA-64 relocations.  */
++#define R_IA64_NONE		0x00	/* none */
++#define R_IA64_IMM14		0x21	/* symbol + addend, add imm14 */
++#define R_IA64_IMM22		0x22	/* symbol + addend, add imm22 */
++#define R_IA64_IMM64		0x23	/* symbol + addend, mov imm64 */
++#define R_IA64_DIR32MSB		0x24	/* symbol + addend, data4 MSB */
++#define R_IA64_DIR32LSB		0x25	/* symbol + addend, data4 LSB */
++#define R_IA64_DIR64MSB		0x26	/* symbol + addend, data8 MSB */
++#define R_IA64_DIR64LSB		0x27	/* symbol + addend, data8 LSB */
++#define R_IA64_GPREL22		0x2a	/* @gprel(sym + add), add imm22 */
++#define R_IA64_GPREL64I		0x2b	/* @gprel(sym + add), mov imm64 */
++#define R_IA64_GPREL32MSB	0x2c	/* @gprel(sym + add), data4 MSB */
++#define R_IA64_GPREL32LSB	0x2d	/* @gprel(sym + add), data4 LSB */
++#define R_IA64_GPREL64MSB	0x2e	/* @gprel(sym + add), data8 MSB */
++#define R_IA64_GPREL64LSB	0x2f	/* @gprel(sym + add), data8 LSB */
++#define R_IA64_LTOFF22		0x32	/* @ltoff(sym + add), add imm22 */
++#define R_IA64_LTOFF64I		0x33	/* @ltoff(sym + add), mov imm64 */
++#define R_IA64_PLTOFF22		0x3a	/* @pltoff(sym + add), add imm22 */
++#define R_IA64_PLTOFF64I	0x3b	/* @pltoff(sym + add), mov imm64 */
++#define R_IA64_PLTOFF64MSB	0x3e	/* @pltoff(sym + add), data8 MSB */
++#define R_IA64_PLTOFF64LSB	0x3f	/* @pltoff(sym + add), data8 LSB */
++#define R_IA64_FPTR64I		0x43	/* @fptr(sym + add), mov imm64 */
++#define R_IA64_FPTR32MSB	0x44	/* @fptr(sym + add), data4 MSB */
++#define R_IA64_FPTR32LSB	0x45	/* @fptr(sym + add), data4 LSB */
++#define R_IA64_FPTR64MSB	0x46	/* @fptr(sym + add), data8 MSB */
++#define R_IA64_FPTR64LSB	0x47	/* @fptr(sym + add), data8 LSB */
++#define R_IA64_PCREL60B		0x48	/* @pcrel(sym + add), brl */
++#define R_IA64_PCREL21B		0x49	/* @pcrel(sym + add), ptb, call */
++#define R_IA64_PCREL21M		0x4a	/* @pcrel(sym + add), chk.s */
++#define R_IA64_PCREL21F		0x4b	/* @pcrel(sym + add), fchkf */
++#define R_IA64_PCREL32MSB	0x4c	/* @pcrel(sym + add), data4 MSB */
++#define R_IA64_PCREL32LSB	0x4d	/* @pcrel(sym + add), data4 LSB */
++#define R_IA64_PCREL64MSB	0x4e	/* @pcrel(sym + add), data8 MSB */
++#define R_IA64_PCREL64LSB	0x4f	/* @pcrel(sym + add), data8 LSB */
++#define R_IA64_LTOFF_FPTR22	0x52	/* @ltoff(@fptr(s+a)), imm22 */
++#define R_IA64_LTOFF_FPTR64I	0x53	/* @ltoff(@fptr(s+a)), imm64 */
++#define R_IA64_LTOFF_FPTR32MSB	0x54	/* @ltoff(@fptr(s+a)), data4 MSB */
++#define R_IA64_LTOFF_FPTR32LSB	0x55	/* @ltoff(@fptr(s+a)), data4 LSB */
++#define R_IA64_LTOFF_FPTR64MSB	0x56	/* @ltoff(@fptr(s+a)), data8 MSB */
++#define R_IA64_LTOFF_FPTR64LSB	0x57	/* @ltoff(@fptr(s+a)), data8 LSB */
++#define R_IA64_SEGREL32MSB	0x5c	/* @segrel(sym + add), data4 MSB */
++#define R_IA64_SEGREL32LSB	0x5d	/* @segrel(sym + add), data4 LSB */
++#define R_IA64_SEGREL64MSB	0x5e	/* @segrel(sym + add), data8 MSB */
++#define R_IA64_SEGREL64LSB	0x5f	/* @segrel(sym + add), data8 LSB */
++#define R_IA64_SECREL32MSB	0x64	/* @secrel(sym + add), data4 MSB */
++#define R_IA64_SECREL32LSB	0x65	/* @secrel(sym + add), data4 LSB */
++#define R_IA64_SECREL64MSB	0x66	/* @secrel(sym + add), data8 MSB */
++#define R_IA64_SECREL64LSB	0x67	/* @secrel(sym + add), data8 LSB */
++#define R_IA64_REL32MSB		0x6c	/* data 4 + REL */
++#define R_IA64_REL32LSB		0x6d	/* data 4 + REL */
++#define R_IA64_REL64MSB		0x6e	/* data 8 + REL */
++#define R_IA64_REL64LSB		0x6f	/* data 8 + REL */
++#define R_IA64_LTV32MSB		0x74	/* symbol + addend, data4 MSB */
++#define R_IA64_LTV32LSB		0x75	/* symbol + addend, data4 LSB */
++#define R_IA64_LTV64MSB		0x76	/* symbol + addend, data8 MSB */
++#define R_IA64_LTV64LSB		0x77	/* symbol + addend, data8 LSB */
++#define R_IA64_PCREL21BI	0x79	/* @pcrel(sym + add), 21bit inst */
++#define R_IA64_PCREL22		0x7a	/* @pcrel(sym + add), 22bit inst */
++#define R_IA64_PCREL64I		0x7b	/* @pcrel(sym + add), 64bit inst */
++#define R_IA64_IPLTMSB		0x80	/* dynamic reloc, imported PLT, MSB */
++#define R_IA64_IPLTLSB		0x81	/* dynamic reloc, imported PLT, LSB */
++#define R_IA64_COPY		0x84	/* copy relocation */
++#define R_IA64_SUB		0x85	/* Addend and symbol difference */
++#define R_IA64_LTOFF22X		0x86	/* LTOFF22, relaxable.  */
++#define R_IA64_LDXMOV		0x87	/* Use of LTOFF22X.  */
++#define R_IA64_TPREL14		0x91	/* @tprel(sym + add), imm14 */
++#define R_IA64_TPREL22		0x92	/* @tprel(sym + add), imm22 */
++#define R_IA64_TPREL64I		0x93	/* @tprel(sym + add), imm64 */
++#define R_IA64_TPREL64MSB	0x96	/* @tprel(sym + add), data8 MSB */
++#define R_IA64_TPREL64LSB	0x97	/* @tprel(sym + add), data8 LSB */
++#define R_IA64_LTOFF_TPREL22	0x9a	/* @ltoff(@tprel(s+a)), imm2 */
++#define R_IA64_DTPMOD64MSB	0xa6	/* @dtpmod(sym + add), data8 MSB */
++#define R_IA64_DTPMOD64LSB	0xa7	/* @dtpmod(sym + add), data8 LSB */
++#define R_IA64_LTOFF_DTPMOD22	0xaa	/* @ltoff(@dtpmod(sym + add)), imm22 */
++#define R_IA64_DTPREL14		0xb1	/* @dtprel(sym + add), imm14 */
++#define R_IA64_DTPREL22		0xb2	/* @dtprel(sym + add), imm22 */
++#define R_IA64_DTPREL64I	0xb3	/* @dtprel(sym + add), imm64 */
++#define R_IA64_DTPREL32MSB	0xb4	/* @dtprel(sym + add), data4 MSB */
++#define R_IA64_DTPREL32LSB	0xb5	/* @dtprel(sym + add), data4 LSB */
++#define R_IA64_DTPREL64MSB	0xb6	/* @dtprel(sym + add), data8 MSB */
++#define R_IA64_DTPREL64LSB	0xb7	/* @dtprel(sym + add), data8 LSB */
++#define R_IA64_LTOFF_DTPREL22	0xba	/* @ltoff(@dtprel(s+a)), imm22 */
++
++/* SH specific declarations */
++
++/* SH relocs.  */
++#define	R_SH_NONE		0
++#define	R_SH_DIR32		1
++#define	R_SH_REL32		2
++#define	R_SH_DIR8WPN		3
++#define	R_SH_IND12W		4
++#define	R_SH_DIR8WPL		5
++#define	R_SH_DIR8WPZ		6
++#define	R_SH_DIR8BP		7
++#define	R_SH_DIR8W		8
++#define	R_SH_DIR8L		9
++#define	R_SH_SWITCH16		25
++#define	R_SH_SWITCH32		26
++#define	R_SH_USES		27
++#define	R_SH_COUNT		28
++#define	R_SH_ALIGN		29
++#define	R_SH_CODE		30
++#define	R_SH_DATA		31
++#define	R_SH_LABEL		32
++#define	R_SH_SWITCH8		33
++#define	R_SH_GNU_VTINHERIT	34
++#define	R_SH_GNU_VTENTRY	35
++#define	R_SH_TLS_GD_32		144
++#define	R_SH_TLS_LD_32		145
++#define	R_SH_TLS_LDO_32		146
++#define	R_SH_TLS_IE_32		147
++#define	R_SH_TLS_LE_32		148
++#define	R_SH_TLS_DTPMOD32	149
++#define	R_SH_TLS_DTPOFF32	150
++#define	R_SH_TLS_TPOFF32	151
++#define	R_SH_GOT32		160
++#define	R_SH_PLT32		161
++#define	R_SH_COPY		162
++#define	R_SH_GLOB_DAT		163
++#define	R_SH_JMP_SLOT		164
++#define	R_SH_RELATIVE		165
++#define	R_SH_GOTOFF		166
++#define	R_SH_GOTPC		167
++/* Keep this the last entry.  */
++#define	R_SH_NUM		256
++
++/* Additional s390 relocs */
++
++#define R_390_NONE		0	/* No reloc.  */
++#define R_390_8			1	/* Direct 8 bit.  */
++#define R_390_12		2	/* Direct 12 bit.  */
++#define R_390_16		3	/* Direct 16 bit.  */
++#define R_390_32		4	/* Direct 32 bit.  */
++#define R_390_PC32		5	/* PC relative 32 bit.	*/
++#define R_390_GOT12		6	/* 12 bit GOT offset.  */
++#define R_390_GOT32		7	/* 32 bit GOT offset.  */
++#define R_390_PLT32		8	/* 32 bit PC relative PLT address.  */
++#define R_390_COPY		9	/* Copy symbol at runtime.  */
++#define R_390_GLOB_DAT		10	/* Create GOT entry.  */
++#define R_390_JMP_SLOT		11	/* Create PLT entry.  */
++#define R_390_RELATIVE		12	/* Adjust by program base.  */
++#define R_390_GOTOFF32		13	/* 32 bit offset to GOT.	 */
++#define R_390_GOTPC		14	/* 32 bit PC relative offset to GOT.  */
++#define R_390_GOT16		15	/* 16 bit GOT offset.  */
++#define R_390_PC16		16	/* PC relative 16 bit.	*/
++#define R_390_PC16DBL		17	/* PC relative 16 bit shifted by 1.  */
++#define R_390_PLT16DBL		18	/* 16 bit PC rel. PLT shifted by 1.  */
++#define R_390_PC32DBL		19	/* PC relative 32 bit shifted by 1.  */
++#define R_390_PLT32DBL		20	/* 32 bit PC rel. PLT shifted by 1.  */
++#define R_390_GOTPCDBL		21	/* 32 bit PC rel. GOT shifted by 1.  */
++#define R_390_64		22	/* Direct 64 bit.  */
++#define R_390_PC64		23	/* PC relative 64 bit.	*/
++#define R_390_GOT64		24	/* 64 bit GOT offset.  */
++#define R_390_PLT64		25	/* 64 bit PC relative PLT address.  */
++#define R_390_GOTENT		26	/* 32 bit PC rel. to GOT entry >> 1. */
++#define R_390_GOTOFF16		27	/* 16 bit offset to GOT. */
++#define R_390_GOTOFF64		28	/* 64 bit offset to GOT. */
++#define R_390_GOTPLT12		29	/* 12 bit offset to jump slot.	*/
++#define R_390_GOTPLT16		30	/* 16 bit offset to jump slot.	*/
++#define R_390_GOTPLT32		31	/* 32 bit offset to jump slot.	*/
++#define R_390_GOTPLT64		32	/* 64 bit offset to jump slot.	*/
++#define R_390_GOTPLTENT		33	/* 32 bit rel. offset to jump slot.  */
++#define R_390_PLTOFF16		34	/* 16 bit offset from GOT to PLT. */
++#define R_390_PLTOFF32		35	/* 32 bit offset from GOT to PLT. */
++#define R_390_PLTOFF64		36	/* 16 bit offset from GOT to PLT. */
++#define R_390_TLS_LOAD		37	/* Tag for load insn in TLS code.  */
++#define R_390_TLS_GDCALL	38	/* Tag for function call in general
++					   dynamic TLS code. */
++#define R_390_TLS_LDCALL	39	/* Tag for function call in local
++					   dynamic TLS code. */
++#define R_390_TLS_GD32		40	/* Direct 32 bit for general dynamic
++					   thread local data.  */
++#define R_390_TLS_GD64		41	/* Direct 64 bit for general dynamic
++					  thread local data.  */
++#define R_390_TLS_GOTIE12	42	/* 12 bit GOT offset for static TLS
++					   block offset.  */
++#define R_390_TLS_GOTIE32	43	/* 32 bit GOT offset for static TLS
++					   block offset.  */
++#define R_390_TLS_GOTIE64	44	/* 64 bit GOT offset for static TLS
++					   block offset. */
++#define R_390_TLS_LDM32		45	/* Direct 32 bit for local dynamic
++					   thread local data in LE code.  */
++#define R_390_TLS_LDM64		46	/* Direct 64 bit for local dynamic
++					   thread local data in LE code.  */
++#define R_390_TLS_IE32		47	/* 32 bit address of GOT entry for
++					   negated static TLS block offset.  */
++#define R_390_TLS_IE64		48	/* 64 bit address of GOT entry for
++					   negated static TLS block offset.  */
++#define R_390_TLS_IEENT		49	/* 32 bit rel. offset to GOT entry for
++					   negated static TLS block offset.  */
++#define R_390_TLS_LE32		50	/* 32 bit negated offset relative to
++					   static TLS block.  */
++#define R_390_TLS_LE64		51	/* 64 bit negated offset relative to
++					   static TLS block.  */
++#define R_390_TLS_LDO32		52	/* 32 bit offset relative to TLS
++					   block.  */
++#define R_390_TLS_LDO64		53	/* 64 bit offset relative to TLS
++					   block.  */
++#define R_390_TLS_DTPMOD	54	/* ID of module containing symbol.  */
++#define R_390_TLS_DTPOFF	55	/* Offset in TLS block.	 */
++#define R_390_TLS_TPOFF		56	/* Negated offset in static TLS
++					   block.  */
++
++/* Keep this the last entry.  */
++#define R_390_NUM		57
++
++/* CRIS relocations.  */
++#define R_CRIS_NONE		0
++#define R_CRIS_8		1
++#define R_CRIS_16		2
++#define R_CRIS_32		3
++#define R_CRIS_8_PCREL		4
++#define R_CRIS_16_PCREL		5
++#define R_CRIS_32_PCREL		6
++#define R_CRIS_GNU_VTINHERIT	7
++#define R_CRIS_GNU_VTENTRY	8
++#define R_CRIS_COPY		9
++#define R_CRIS_GLOB_DAT		10
++#define R_CRIS_JUMP_SLOT	11
++#define R_CRIS_RELATIVE		12
++#define R_CRIS_16_GOT		13
++#define R_CRIS_32_GOT		14
++#define R_CRIS_16_GOTPLT	15
++#define R_CRIS_32_GOTPLT	16
++#define R_CRIS_32_GOTREL	17
++#define R_CRIS_32_PLT_GOTREL	18
++#define R_CRIS_32_PLT_PCREL	19
++
++#define R_CRIS_NUM		20
++
++/* AMD x86-64 relocations.  */
++#define R_X86_64_NONE		0	/* No reloc */
++#define R_X86_64_64		1	/* Direct 64 bit  */
++#define R_X86_64_PC32		2	/* PC relative 32 bit signed */
++#define R_X86_64_GOT32		3	/* 32 bit GOT entry */
++#define R_X86_64_PLT32		4	/* 32 bit PLT address */
++#define R_X86_64_COPY		5	/* Copy symbol at runtime */
++#define R_X86_64_GLOB_DAT	6	/* Create GOT entry */
++#define R_X86_64_JUMP_SLOT	7	/* Create PLT entry */
++#define R_X86_64_RELATIVE	8	/* Adjust by program base */
++#define R_X86_64_GOTPCREL	9	/* 32 bit signed PC relative
++					   offset to GOT */
++#define R_X86_64_32		10	/* Direct 32 bit zero extended */
++#define R_X86_64_32S		11	/* Direct 32 bit sign extended */
++#define R_X86_64_16		12	/* Direct 16 bit zero extended */
++#define R_X86_64_PC16		13	/* 16 bit sign extended pc relative */
++#define R_X86_64_8		14	/* Direct 8 bit sign extended  */
++#define R_X86_64_PC8		15	/* 8 bit sign extended pc relative */
++#define R_X86_64_DTPMOD64	16	/* ID of module containing symbol */
++#define R_X86_64_DTPOFF64	17	/* Offset in module's TLS block */
++#define R_X86_64_TPOFF64	18	/* Offset in initial TLS block */
++#define R_X86_64_TLSGD		19	/* 32 bit signed PC relative offset
++					   to two GOT entries for GD symbol */
++#define R_X86_64_TLSLD		20	/* 32 bit signed PC relative offset
++					   to two GOT entries for LD symbol */
++#define R_X86_64_DTPOFF32	21	/* Offset in TLS block */
++#define R_X86_64_GOTTPOFF	22	/* 32 bit signed PC relative offset
++					   to GOT entry for IE symbol */
++#define R_X86_64_TPOFF32	23	/* Offset in initial TLS block */
++
++#define R_X86_64_NUM		24
++
++__END_DECLS
++
++#endif	/* elf.h */
+ 
+ #include "elfconfig.h"
+ 
+@@ -195,3 +2641,4 @@
+ void fatal(const char *fmt, ...);
+ void warn(const char *fmt, ...);
+ void merror(const char *fmt, ...);
++
+diff -Nur linux-2.6.36.orig/scripts/mod/sumversion.c linux-2.6.36/scripts/mod/sumversion.c
+--- linux-2.6.36.orig/scripts/mod/sumversion.c	2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/scripts/mod/sumversion.c	2010-11-28 18:33:24.000000000 +0100
+@@ -1,4 +1,4 @@
+-#include <netinet/in.h>
++/* #include <netinet/in.h> */
+ #ifdef __sun__
+ #include <inttypes.h>
+ #else

+ 22 - 0
target/linux/patches/3.4.113/defaults.patch

@@ -0,0 +1,22 @@
+diff -Nur linux-3.0.4.orig/fs/Kconfig linux-3.0.4/fs/Kconfig
+--- linux-3.0.4.orig/fs/Kconfig	2011-08-29 22:56:30.000000000 +0200
++++ linux-3.0.4/fs/Kconfig	2011-10-15 22:08:44.000000000 +0200
+@@ -47,7 +47,7 @@
+ 	def_bool n
+ 
+ config EXPORTFS
+-	tristate
++	def_bool y
+ 
+ config FILE_LOCKING
+ 	bool "Enable POSIX file locking API" if EXPERT
+diff -Nur linux-3.0.4.orig/fs/notify/Kconfig linux-3.0.4/fs/notify/Kconfig
+--- linux-3.0.4.orig/fs/notify/Kconfig	2011-08-29 22:56:30.000000000 +0200
++++ linux-3.0.4/fs/notify/Kconfig	2011-10-15 22:02:00.000000000 +0200
+@@ -1,5 +1,5 @@
+ config FSNOTIFY
+-	def_bool n
++	def_bool y
+ 
+ source "fs/notify/dnotify/Kconfig"
+ source "fs/notify/inotify/Kconfig"

Some files were not shown because too many files changed in this diff