Hi,

this is my patch to boot android. The PAN display ioctl is only for openmoko, 
hope that can help
some user.

The overall performance are not good but the keyboard is three time faster from 
cupcake version :)

Michael

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
project bionic/
diff --git a/libc/Android.mk b/libc/Android.mk
index 5718d18..775980a 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -286,20 +286,26 @@ libc_common_src_files += \
 	arch-arm/bionic/_setjmp.S \
 	arch-arm/bionic/atomics_arm.S \
 	arch-arm/bionic/clone.S \
-	arch-arm/bionic/ffs.S \
 	arch-arm/bionic/kill.S \
 	arch-arm/bionic/libgcc_compat.c \
 	arch-arm/bionic/tkill.S \
-	arch-arm/bionic/memcmp.S \
 	arch-arm/bionic/memcmp16.S \
-	arch-arm/bionic/memcpy.S \
 	arch-arm/bionic/memset.S \
 	arch-arm/bionic/setjmp.S \
 	arch-arm/bionic/sigsetjmp.S \
-	arch-arm/bionic/strlen.c.arm \
 	arch-arm/bionic/syscall.S \
+	arch-arm/bionic/ffs.S \
 	unistd/socketcalls.c
 
+ifneq ($(TARGET_ARCH_VERSION),armv4t)
+libc_common_src_files += arch-arm/bionic/memcmp.S \
+		arch-arm/bionic/memcpy.S \
+		arch-arm/bionic/strlen.c.arm
+else
+libc_common_src_files += string/memcmp.c string/memcpy.c string/strlen.c
+endif
+
+
 # These files need to be arm so that gdbserver
 # can set breakpoints in them without messing
 # up any thumb code.
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index 2e7a82b..b1ef9cc 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -98,7 +98,8 @@ extern int __set_tls(void *ptr);
        asm ("mrc p15, 0, r0, c13, c0, 3" : "=r"(__val) ); \
        (volatile void*)__val; })
 #  else /* !HAVE_ARM_TLS_REGISTER */
-#    define __get_tls() ( *((volatile void **) 0xffff0ff0) )
+typedef void* (__get_tls_t)(void);
+static const __get_tls_t* __get_tls = (const __get_tls_t *)0xffff0fe0;
 #  endif
 #else
 extern void*  __get_tls( void );
diff --git a/libc/string/memcpy.c b/libc/string/memcpy.c
index 4cd4a80..dea78b2 100644
--- a/libc/string/memcpy.c
+++ b/libc/string/memcpy.c
@@ -25,5 +25,5 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-#define MEM_COPY
+#define MEMCOPY
 #include "bcopy.c"
diff --git a/libc/unistd/abort.c b/libc/unistd/abort.c
index 3e3aab0..f323941 100644
--- a/libc/unistd/abort.c
+++ b/libc/unistd/abort.c
@@ -39,13 +39,8 @@
 #define debug_log(format, ...)  \
     __libc_android_log_print(ANDROID_LOG_DEBUG, "libc-abort", (format), ##__VA_ARGS__ )
 
-#ifdef __arm__
-void
-__libc_android_abort(void)
-#else
 void
 abort(void)
-#endif
 {
 	struct atexit *p = __atexit;
 	static int cleanup_called = 0;
@@ -102,29 +97,3 @@ abort(void)
 	(void)kill(getpid(), SIGABRT);
 	_exit(1);
 }
-
-#ifdef __arm__
-/*
- * abort() does not return, which gcc interprets to mean that it doesn't
- * need to preserve any of the callee-save registers.  Unfortunately this
- * includes the link register, so if LR is used there is no way to determine
- * which function called abort().
- *
- * We work around this by inserting a trivial stub that doesn't alter
- * any of the "interesting" registers and thus doesn't need to save them.
- * We can't just call __libc_android_abort from C because gcc uses "bl"
- * without first saving LR, so we use an asm statement.  This also has
- * the side-effect of replacing abort() with __libc_android_abort() in
- * the stack trace.
- *
- * Ideally __libc_android_abort would be static, but I haven't figured out
- * how to tell gcc to call a static function from an asm statement.
- */
-void
-abort(void)
-{
-    asm ("b __libc_android_abort");
-    _exit(1);       /* suppress gcc noreturn warnings */
-}
-#endif
-

project build/
diff --git a/core/combo/arch/arm/armv4t.mk b/core/combo/arch/arm/armv4t.mk
index abc8fa2..70d236e 100644
--- a/core/combo/arch/arm/armv4t.mk
+++ b/core/combo/arch/arm/armv4t.mk
@@ -10,6 +10,7 @@
 $(warning ARMv4t support is currently a work in progress. It does not work right now!)
 ARCH_ARM_HAVE_THUMB_SUPPORT := false
 ARCH_ARM_HAVE_THUMB_INTERWORKING := false
+ARCH_ARM_HAVE_FAST_INTERWORKING := false
 ARCH_ARM_HAVE_64BIT_DATA := false
 ARCH_ARM_HAVE_HALFWORD_MULTIPLY := false
 ARCH_ARM_HAVE_CLZ := false
diff --git a/core/combo/linux-arm.mk b/core/combo/linux-arm.mk
index 6011351..f23cb25 100644
--- a/core/combo/linux-arm.mk
+++ b/core/combo/linux-arm.mk
@@ -28,6 +28,8 @@ $(info This variable has been renamed TARGET_ARCH_VARIANT, please update your bu
 $(error Aborting the build.)
 endif
 
+TARGET_ARCH_VERSION := $(TARGET_ARCH_VARIANT)
+
 TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT).mk
 ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),)
 $(error Unknown ARM architecture version: $(TARGET_ARCH_VARIANT))
@@ -38,7 +40,7 @@ include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
 # You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
 ifeq ($(strip $($(combo_target)TOOLS_PREFIX)),)
 $(combo_target)TOOLS_PREFIX := \
-	prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
+	prebuilt/$(HOST_PREBUILT_TAG)/toolchain/armv4t-android-eabi-4.2.1/bin/armv4t-android-eabi-
 endif
 
 $(combo_target)CC := $($(combo_target)TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)
@@ -90,7 +92,6 @@ $(combo_target)GLOBAL_CFLAGS += \
 			-msoft-float -fpic \
 			-ffunction-sections \
 			-funwind-tables \
-			-fstack-protector \
 			-fno-short-enums \
 			$(arch_variant_cflags) \
 			-include $(android_config_h) \
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 6d14753..cc80a7e 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -329,6 +329,7 @@ $(info   TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
 $(info   TARGET_SIMULATOR=$(TARGET_SIMULATOR))
 $(info   TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
 $(info   TARGET_ARCH=$(TARGET_ARCH))
+$(info   TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT))
 $(info   HOST_ARCH=$(HOST_ARCH))
 $(info   HOST_OS=$(HOST_OS))
 $(info   HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
diff --git a/core/prelink-linux-arm.map b/core/prelink-linux-arm.map
index 30fa378..a884cf3 100644
--- a/core/prelink-linux-arm.map
+++ b/core/prelink-linux-arm.map
@@ -162,4 +162,5 @@ librpc.so               0x9A400000
 libtrace_test.so        0x9A300000
 libsrec_jni.so          0x9A200000
 libcerttool_jni.so      0x9A100000
+libfreerunner_gps.so	0x9A000000
 

project external/alsa-lib/
diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c
index 4ad1d09..bcba353 100644
--- a/src/alisp/alisp.c
+++ b/src/alisp/alisp.c
@@ -1021,6 +1021,7 @@ static const char *obj_type_str(struct alisp_object * p)
 	case ALISP_OBJ_CONS: return "cons";
 	default: assert(0);
 	}
+	return "nil";
 }
 
 static void print_obj_lists(struct alisp_instance *instance, snd_output_t *out)

project external/opencore/
diff --git a/Config.mk b/Config.mk
index 2334eab..36375b2 100644
--- a/Config.mk
+++ b/Config.mk
@@ -3,7 +3,7 @@ ifndef EXTERNAL_OPENCORE_CONFIG_ONCE
   EXTERNAL_OPENCORE_CONFIG_ONCE := true
 
   PV_TOP := $(my-dir)
-    PV_CFLAGS := -Wno-non-virtual-dtor -DENABLE_SHAREDFD_PLAYBACK -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_CML2_CONFIG
+  PV_CFLAGS := -Wno-non-virtual-dtor -DENABLE_SHAREDFD_PLAYBACK -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_CML2_CONFIG
 
   FORMAT := android
 
@@ -12,8 +12,10 @@ ifeq ($(ENABLE_PV_LOGGING),1)
 endif
 
 ifeq ($(TARGET_ARCH),arm)
+ifneq ($(TARGET_ARCH_VERSION),armv4t)
   PV_CFLAGS += -DPV_ARM_GCC_V5
 endif
+endif
 
   # HAS_OSCL_LIB_SUPPORT turns on PV's OSCL dynamic loader.
   # Set PV_OSCL_LIB to true to enable it (default in release mode).
@@ -32,7 +34,7 @@ include $(CLEAR_VARS)
 # Use PV_CFLAGS_MINUS_VISIBILITY instead of PV_CFLAGS until we figure out the reason.
 # JJ 06/05/09
     PV_CFLAGS_MINUS_VISIBILITY := $(PV_CFLAGS)
-    PV_CFLAGS += -fvisibility=hidden
+#    PV_CFLAGS += -fvisibility=hidden
 
   PV_INCLUDES := \
 	$(PV_TOP)/android \
diff --git a/codecs_v2/audio/mp3/dec/Android.mk b/codecs_v2/audio/mp3/dec/Android.mk
index 26e69b0..b9e03b4 100644
--- a/codecs_v2/audio/mp3/dec/Android.mk
+++ b/codecs_v2/audio/mp3/dec/Android.mk
@@ -27,11 +27,7 @@ LOCAL_SRC_FILES := \
  	src/pvmp3_equalizer.cpp \
  	src/pvmp3_seek_synch.cpp \
  	src/pvmp3_stereo_proc.cpp \
- 	src/pvmp3_reorder.cpp \
- 	src/pvmp3_polyphase_filter_window.cpp \
- 	src/pvmp3_mdct_18.cpp \
- 	src/pvmp3_dct_9.cpp \
- 	src/pvmp3_dct_16.cpp
+ 	src/pvmp3_reorder.cpp
 
 ifeq ($(TARGET_ARCH),arm)
 LOCAL_SRC_FILES += \
@@ -39,6 +35,12 @@ LOCAL_SRC_FILES += \
  	src/asm/pvmp3_mdct_18_gcc.s \
  	src/asm/pvmp3_dct_9_gcc.s \
 	src/asm/pvmp3_dct_16_gcc.s
+else
+LOCAL_SRC_FILES += \
+	src/pvmp3_polyphase_filter_window.cpp \
+	src/pvmp3_mdct_18.cpp \
+	src/pvmp3_dct_9.cpp \
+	src/pvmp3_dct_16.cpp
 endif
 
 
diff --git a/codecs_v2/utilities/colorconvert/src/cczoomrotation12.cpp b/codecs_v2/utilities/colorconvert/src/cczoomrotation12.cpp
index 3689c3e..8ddc472 100644
--- a/codecs_v2/utilities/colorconvert/src/cczoomrotation12.cpp
+++ b/codecs_v2/utilities/colorconvert/src/cczoomrotation12.cpp
@@ -544,7 +544,12 @@ int32 ColorConvert12::get_frame12(uint8 **src, uint8 *dst,
 
         asm("mov		r0, #1");
         asm("add		sp, sp, #32");
+#ifndef __ARM_ARCH_4__
         asm("ldmfd		sp!, {r0, r4-r11, pc}");
+#else
+        asm("ldmfd		sp!, {r0, r4-r11, lr}");
+        asm("bx			lr");
+#endif
 //      asm(".ltorg");
     }
     return 1;
diff --git a/oscl/oscl/config/android/osclconfig.h b/oscl/oscl/config/android/osclconfig.h
index 97e426e..67c3185 100644
--- a/oscl/oscl/config/android/osclconfig.h
+++ b/oscl/oscl/config/android/osclconfig.h
@@ -38,8 +38,11 @@
 #define OSCL_HAS_ANDROID_SUPPORT 1
 #define OSCL_HAS_ANDROID_FILE_IO_SUPPORT 1
 
-#define OSCL_EXPORT_REF __attribute__ ((visibility("default")))
-#define OSCL_IMPORT_REF __attribute__ ((visibility("default")))
+//#define OSCL_EXPORT_REF __attribute__ ((visibility("default")))
+//#define OSCL_IMPORT_REF __attribute__ ((visibility("default")))
+
+#define OSCL_EXPORT_REF
+#define OSCL_IMPORT_REF
 
 // include common include for determining sizes from limits.h
 #include "osclconfig_limits_typedefs.h"
diff --git a/oscl/oscl/osclbase/src/oscl_base.cpp b/oscl/oscl/osclbase/src/oscl_base.cpp
index b338a26..85d97e3 100644
--- a/oscl/oscl/osclbase/src/oscl_base.cpp
+++ b/oscl/oscl/osclbase/src/oscl_base.cpp
@@ -27,14 +27,6 @@
 
 OSCL_EXPORT_REF int32 OsclBase::Init()
 {
-    {
-        _OsclBasicAllocator alloc;
-        int32 error;
-        OsclTLSRegistry::initialize(alloc, error);
-        //exit on error
-        if (error)
-            return error;
-    }
 #if (OSCL_HAS_SINGLETON_SUPPORT)
     {
         _OsclBasicAllocator alloc;
@@ -61,14 +53,6 @@ OSCL_EXPORT_REF int32 OsclBase::Cleanup()
             result = error;
     }
 #endif
-    {
-        _OsclBasicAllocator alloc;
-        int32 error;
-        OsclTLSRegistry::cleanup(alloc, error);
-        //continue if error
-        if (error)
-            result = error;
-    }
     //return the last error encountered.
     return result;
 }
@@ -134,5 +118,3 @@ OSCL_EXPORT_REF void _OsclBasicLock::Unlock()
 }
 #endif //OSCL_HAS_BASIC_LOCK
 
-
-
diff --git a/tools_v2/build/make/android_make_extras.mk b/tools_v2/build/make/android_make_extras.mk
index fd425e6..8a4372c 100644
--- a/tools_v2/build/make/android_make_extras.mk
+++ b/tools_v2/build/make/android_make_extras.mk
@@ -133,7 +133,9 @@ $1: FORCE
 	$$(quiet) echo " PV_CFLAGS += -DPVLOGGER_INST_LEVEL=5" >> $$@
 	$$(quiet) echo "endif"  >> $$@
 	$$(quiet) echo "" >> $$@
-	$$(quiet) echo "ifeq ($$(esc_dollar)(TARGET_ARCH),arm)" >> $$@
+	$$(quiet) echo "ifeq ($$(esc_dollar)(TARGET_ARCH_VARIANT),armv4t)" >> $$@
+	$$(quiet) echo "  PV_CFLAGS += " >> $$@
+	$$(quiet) echo "else"  >> $$@
 	$$(quiet) echo "  PV_CFLAGS += -DPV_ARM_GCC_V5" >> $$@
 	$$(quiet) echo "endif"  >> $$@
 	$$(quiet) echo "" >> $$@
diff --git a/tools_v2/build/make/platforms/android.mk b/tools_v2/build/make/platforms/android.mk
index 3a7b908..cfe816a 100644
--- a/tools_v2/build/make/platforms/android.mk
+++ b/tools_v2/build/make/platforms/android.mk
@@ -12,8 +12,14 @@ AR := arm-eabi-ar
 # overwrite RANLIB set in linux.mk
 export RANLIB := arm-eabi-ranlib
 
+ifeq ($(TARGET_ARCH_VARIANT),armv4t)
+DEFAULT_CPP_ASM_FLAGS :=
+CPPFLAGS += $(arch_variant_cflags)
+else
 # This toolchain supports linux-arm v5
 DEFAULT_CPP_ASM_FLAGS := -DPV_ARM_GCC_V5
+CPPFLAGS += -msoft-float -O2 -march=armv5te -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__
+endif
 PROCESSOR := arm
 
 # include the common engine header files in the search path
@@ -30,7 +36,7 @@ INCDIRS += \
 	-I $(ANDROID_BASE)/headers/skia/include
 
 # Compiler options
-CPPFLAGS += -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -msoft-float -O2 -march=armv5te -fno-rtti -fno-exceptions -mtune=xscale -fpic -mthumb-interwork -ffunction-sections -funwind-tables -finline-functions -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -Wstrict-aliasing=2 -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -MD -include $(ANDROID_BASE)/headers/system/core/include/arch/linux-arm/AndroidConfig.h -DANDROID -fmessage-length=0 -DSK_RELEASE -DNDEBUG -DUDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -Os -DENABLE_MEMORY_PLAYBACK -fno-short-enums
+CPPFLAGS += -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -fno-rtti -fno-exceptions -mtune=xscale -fpic -mthumb-interwork -ffunction-sections -funwind-tables -finline-functions -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -Wstrict-aliasing=2 -fstack-protector -MD -include $(ANDROID_BASE)/headers/system/core/include/arch/linux-arm/AndroidConfig.h -DANDROID -fmessage-length=0 -DSK_RELEASE -DNDEBUG -DUDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -Os -DENABLE_MEMORY_PLAYBACK -fno-short-enums
 
 # Idea is to build only libraries in arm mode and the rest in thumb mode
 OPTIMIZE_FOR_SIZE := -mthumb
diff --git a/tools_v2/build/make/platforms/linux_arm.mk b/tools_v2/build/make/platforms/linux_arm.mk
index 38767e2..523d8d0 100644
--- a/tools_v2/build/make/platforms/linux_arm.mk
+++ b/tools_v2/build/make/platforms/linux_arm.mk
@@ -9,8 +9,12 @@ STRIP := arm-linux-strip
 # overwrite RANLIB set in linux.mk
 export RANLIB = arm-linux-ranlib
 
+ifeq ($(TARGET_ARCH_VARIANT),armv4t)
+DEFAULT_CPP_ASM_FLAGS :=
+else
 # This toolchain supports linux-arm v5
 DEFAULT_CPP_ASM_FLAGS := -DPV_ARM_GCC_V5
+endif
 PROCESSOR := arm
 
 # include the common engine header files in the search path

project external/skia/
diff --git a/include/core/SkMath.h b/include/core/SkMath.h
index cf79e53..3f3c660 100644
--- a/include/core/SkMath.h
+++ b/include/core/SkMath.h
@@ -164,7 +164,7 @@ static inline int SkNextLog2(uint32_t value) {
 */
 #if defined(__arm__) \
   && !defined(__thumb__) \
-  && !defined(__ARM_ARCH_4__) \
+  && !defined(__ARM_ARCH_4T__) \
   && !defined(__ARM_ARCH_5T__)
     static inline int32_t SkMulS16(S16CPU x, S16CPU y) {
         SkASSERT((int16_t)x == x);

project external/sonivox/
diff --git a/arm-wt-22k/Android.mk b/arm-wt-22k/Android.mk
index 71fbcf8..d91a297 100644
--- a/arm-wt-22k/Android.mk
+++ b/arm-wt-22k/Android.mk
@@ -75,6 +75,7 @@ LOCAL_COPY_HEADERS := \
 	host_src/jet.h
 
 ifeq ($(TARGET_ARCH),arm)
+ifneq ($(TARGET_ARCH_VARIANT),armv4t)
 LOCAL_SRC_FILES+= \
 	lib_src/ARM-E_filter_gnu.s \
 	lib_src/ARM-E_interpolate_loop_gnu.s \
@@ -94,6 +95,7 @@ LOCAL_CFLAGS+= -D NATIVE_EAS_KERNEL \
 
 LOCAL_COPY_HEADERS += lib_src/ARM_synth_constants_gnu.inc
 endif
+endif
 
 LOCAL_SHARED_LIBRARIES := \
 	libutils libcutils

project external/srec/
diff --git a/audio/AudioIn/UNIX/src/audioin.c b/audio/AudioIn/UNIX/src/audioin.c
index 9d8a5a9..e2d57df 100644
--- a/audio/AudioIn/UNIX/src/audioin.c
+++ b/audio/AudioIn/UNIX/src/audioin.c
@@ -38,7 +38,7 @@
 /*                  frame size which is now automatically selected          */
 /*--------------------------------------------------------------------------*/
 
-#if !defined(ANDROID) || defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4__)
+#if !defined(ANDROID) || defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4T__)
 
 
 
diff --git a/audio/AudioIn/UNIX/src/audioinwrapper.cpp b/audio/AudioIn/UNIX/src/audioinwrapper.cpp
index 9fb46f5..021ef29 100644
--- a/audio/AudioIn/UNIX/src/audioinwrapper.cpp
+++ b/audio/AudioIn/UNIX/src/audioinwrapper.cpp
@@ -18,7 +18,7 @@
  *---------------------------------------------------------------------------*/
 
 
-#if defined(ANDROID) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4__))
+#if defined(ANDROID) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4T__))
 
 //#define USE_DEV_EAC_FILE 1
 
@@ -31,7 +31,7 @@
 using namespace android;
 #endif
 
-#endif // defined(ANDROID) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4__))
+#endif // defined(ANDROID) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4T__))
 
 #include "plog.h"
 
@@ -50,7 +50,7 @@ static struct timeval buffer_save_audio;
 extern "C" 
 {
 
-#if defined(ANDROID) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4__))
+#if defined(ANDROID) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_4T__))
     
 #if defined(USE_DEV_EAC_FILE)
 static int audiofd = -1;

project frameworks/base/
diff --git a/libs/audioflinger/AudioMixer.cpp b/libs/audioflinger/AudioMixer.cpp
index 19a442a..6443ecf 100644
--- a/libs/audioflinger/AudioMixer.cpp
+++ b/libs/audioflinger/AudioMixer.cpp
@@ -401,7 +401,7 @@ void AudioMixer::process__validate(state_t* state, void* output)
 static inline
 int32_t mulAdd(int16_t in, int16_t v, int32_t a)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     asm( "smlabb %[out], %[in], %[v], %[a] \n"
          : [out]"=r"(out)
@@ -416,7 +416,7 @@ int32_t mulAdd(int16_t in, int16_t v, int32_t a)
 static inline
 int32_t mul(int16_t in, int16_t v)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     asm( "smulbb %[out], %[in], %[v] \n"
          : [out]"=r"(out)
@@ -431,7 +431,7 @@ int32_t mul(int16_t in, int16_t v)
 static inline
 int32_t mulAddRL(int left, uint32_t inRL, uint32_t vRL, int32_t a)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     if (left) {
         asm( "smlabb %[out], %[inRL], %[vRL], %[a] \n"
@@ -457,7 +457,7 @@ int32_t mulAddRL(int left, uint32_t inRL, uint32_t vRL, int32_t a)
 static inline
 int32_t mulRL(int left, uint32_t inRL, uint32_t vRL)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     if (left) {
         asm( "smulbb %[out], %[inRL], %[vRL] \n"
diff --git a/libs/audioflinger/AudioResamplerSinc.cpp b/libs/audioflinger/AudioResamplerSinc.cpp
index 9e5e254..f2c9858 100644
--- a/libs/audioflinger/AudioResamplerSinc.cpp
+++ b/libs/audioflinger/AudioResamplerSinc.cpp
@@ -62,7 +62,7 @@ const int32_t AudioResamplerSinc::mFirCoefsDown[] = {
 static inline
 int32_t mulRL(int left, int32_t in, uint32_t vRL)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     if (left) {
         asm( "smultb %[out], %[in], %[vRL] \n"
@@ -88,7 +88,7 @@ int32_t mulRL(int left, int32_t in, uint32_t vRL)
 static inline
 int32_t mulAdd(int16_t in, int32_t v, int32_t a)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     asm( "smlawb %[out], %[v], %[in], %[a] \n"
          : [out]"=r"(out)
@@ -105,7 +105,7 @@ int32_t mulAdd(int16_t in, int32_t v, int32_t a)
 static inline
 int32_t mulAddRL(int left, uint32_t inRL, int32_t v, int32_t a)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     int32_t out;
     if (left) {
         asm( "smlawb %[out], %[v], %[inRL], %[a] \n"
diff --git a/libs/surfaceflinger/clz.cpp b/libs/surfaceflinger/clz.cpp
index 2456b86..053a45d 100644
--- a/libs/surfaceflinger/clz.cpp
+++ b/libs/surfaceflinger/clz.cpp
@@ -20,7 +20,7 @@ namespace android {
 
 int clz_impl(int32_t x)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     return __builtin_clz(x);
 #else
     if (!x) return 32;
diff --git a/libs/surfaceflinger/clz.h b/libs/surfaceflinger/clz.h
index 0ddf986..fa1e8b2 100644
--- a/libs/surfaceflinger/clz.h
+++ b/libs/surfaceflinger/clz.h
@@ -24,7 +24,7 @@ int clz_impl(int32_t x);
 
 int inline clz(int32_t x)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
     return __builtin_clz(x);
 #else
     return clz_impl(x);
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 673c174..c6f2aa0 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -551,7 +551,7 @@ EGLBoolean egl_window_surface_v2_t::swapBuffers()
     if (!dirtyRegion.isEmpty()) {
         dirtyRegion.andSelf(Rect(buffer->width, buffer->height));
         if (previousBuffer) {
-            const Region copyBack(Region::subtract(oldDirtyRegion, dirtyRegion));
+            Region copyBack(Region::subtract(oldDirtyRegion, dirtyRegion));
             if (!copyBack.isEmpty()) {
                 void* prevBits;
                 if (lock(previousBuffer, 
diff --git a/opengl/libagl/matrix.h b/opengl/libagl/matrix.h
index c9a38a9..84983b7 100644
--- a/opengl/libagl/matrix.h
+++ b/opengl/libagl/matrix.h
@@ -87,7 +87,7 @@ static inline GLfixed mla2a( GLfixed a0, GLfixed b0,
                             GLfixed a1, GLfixed b1,
                             GLfixed c)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     int32_t t;
@@ -117,7 +117,7 @@ static inline GLfixed mla3a( GLfixed a0, GLfixed b0,
                              GLfixed a2, GLfixed b2,
                              GLfixed c)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     int32_t t;
@@ -154,7 +154,7 @@ static inline GLfixed mla3a16( GLfixed a0, int32_t b1b0,
                                GLint shift,
                                GLfixed c)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     asm(
@@ -194,7 +194,7 @@ static inline GLfixed mla3a16_btb( GLfixed a0,
                                    GLint shift,
                                    GLfixed c)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     asm(
@@ -235,7 +235,7 @@ static inline GLfixed mla3a16_btt( GLfixed a0,
                                    GLint shift,
                                    GLfixed c)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     asm(
@@ -273,7 +273,7 @@ static inline GLfixed mla3( GLfixed a0, GLfixed b0,
                             GLfixed a1, GLfixed b1,
                             GLfixed a2, GLfixed b2)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     int32_t t;
@@ -305,7 +305,7 @@ static inline GLfixed mla4( GLfixed a0, GLfixed b0,
                             GLfixed a2, GLfixed b2,
                             GLfixed a3, GLfixed b3)
 {
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
                             
     GLfixed r;
     int32_t t;
diff --git a/opengl/libagl/primitives.cpp b/opengl/libagl/primitives.cpp
index 769ec40..936468b 100644
--- a/opengl/libagl/primitives.cpp
+++ b/opengl/libagl/primitives.cpp
@@ -358,7 +358,7 @@ void compute_iterators_t::iterators0032(int64_t* it,
     it[ 2] = dcdy;
 }
 
-#if defined(__arm__) && !defined(__thumb__)
+#if defined(__arm__) && !defined(__thumb__) && !defined(__ARM_ARCH_4T__)
 inline void compute_iterators_t::iterators0032(int32_t* it,
         int32_t c0, int32_t c1, int32_t c2) const
 {
diff --git a/opengl/tests/gl_jni/jni/gl_code.cpp b/opengl/tests/gl_jni/jni/gl_code.cpp
index 33b25ab..f031c79 100644
--- a/opengl/tests/gl_jni/jni/gl_code.cpp
+++ b/opengl/tests/gl_jni/jni/gl_code.cpp
@@ -180,4 +180,5 @@ JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_step(JNIEnv * env, jobjec
 JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_changeBackground(JNIEnv * env, jobject obj)
 {
     background = 1.0f - background;
-}
\ No newline at end of file
+}
+
diff --git a/services/java/com/android/server/InputDevice.java b/services/java/com/android/server/InputDevice.java
index 6eb6242..b6e37fe 100644
--- a/services/java/com/android/server/InputDevice.java
+++ b/services/java/com/android/server/InputDevice.java
@@ -22,6 +22,9 @@ import android.view.MotionEvent;
 import android.view.Surface;
 import android.view.WindowManagerPolicy;
 
+import java.io.FileInputStream;
+import java.util.StringTokenizer;
+
 public class InputDevice {
     static final boolean DEBUG_POINTERS = false;
     static final boolean DEBUG_HACKS = false;
@@ -29,6 +32,8 @@ public class InputDevice {
     /** Amount that trackball needs to move in order to generate a key event. */
     static final int TRACKBALL_MOVEMENT_THRESHOLD = 6;
 
+    static final String CALIBRATION_FILE = "/system/etc/pointercal";
+
     /** Maximum number of pointers we will track and report. */
     static final int MAX_POINTERS = 10;
     
@@ -39,6 +44,7 @@ public class InputDevice {
     final AbsoluteInfo absY;
     final AbsoluteInfo absPressure;
     final AbsoluteInfo absSize;
+    final TransformInfo tInfo;
     
     long mKeyDownTime = 0;
     int mMetaKeysState = 0;
@@ -595,15 +601,29 @@ public class InputDevice {
             final AbsoluteInfo absSize = device.absSize;
             for (int i=0; i<numPointers; i++) {
                 final int j = i * MotionEvent.NUM_SAMPLE_DATA;
+                float x = reportData[j + MotionEvent.SAMPLE_X];
+                float y = reportData[j + MotionEvent.SAMPLE_Y];
             
                 if (absX != null) {
-                    reportData[j + MotionEvent.SAMPLE_X] =
-                            ((reportData[j + MotionEvent.SAMPLE_X]-absX.minValue)
-                                / absX.range) * w;
+                    if (device.tInfo != null)
+                        reportData[j + MotionEvent.SAMPLE_X] =
+                            (device.tInfo.x1 * x +
+                             device.tInfo.y1 * y +
+                             device.tInfo.z1) / device.tInfo.s;
+                    else
+                        reportData[j + MotionEvent.SAMPLE_X] =
+                                ((reportData[j + MotionEvent.SAMPLE_X]-absX.minValue)
+                                    / absX.range) * w;
                 }
                 if (absY != null) {
-                    reportData[j + MotionEvent.SAMPLE_Y] =
-                            ((reportData[j + MotionEvent.SAMPLE_Y]-absY.minValue)
+                    if (device.tInfo != null)
+                        reportData[j + MotionEvent.SAMPLE_Y] =
+                            (device.tInfo.x2 * x +
+                             device.tInfo.y2 * y +
+                             device.tInfo.z2) / device.tInfo.s;
+                        else
+                            reportData[j + MotionEvent.SAMPLE_Y] =
+                                ((reportData[j + MotionEvent.SAMPLE_Y]-absY.minValue)
                                 / absY.range) * h;
                 }
                 if (absPressure != null) {
@@ -769,7 +789,17 @@ public class InputDevice {
         int flat;
         int fuzz;
     };
-    
+
+    static class TransformInfo {
+        float x1;
+        float y1;
+        float z1;
+        float x2;
+        float y2;
+        float z2;
+        float s;
+    };
+
     InputDevice(int _id, int _classes, String _name,
             AbsoluteInfo _absX, AbsoluteInfo _absY,
             AbsoluteInfo _absPressure, AbsoluteInfo _absSize) {
@@ -780,5 +810,34 @@ public class InputDevice {
         absY = _absY;
         absPressure = _absPressure;
         absSize = _absSize;
+        TransformInfo t = null;
+        try {
+            FileInputStream is = new FileInputStream(CALIBRATION_FILE);
+            byte[] mBuffer = new byte[64];
+            int len = is.read(mBuffer);
+            is.close();
+            if (len > 0) {
+                int i;
+                for (i = 0 ; i < len ; i++) {
+                    if (mBuffer[i] == '\n' || mBuffer[i] == 0) {
+                        break;
+                    }
+                }
+                len = i;
+            }
+            StringTokenizer st = new StringTokenizer( new String(mBuffer, 0, 0, len) );
+
+            t = new TransformInfo ();
+            t.x1 = Integer.parseInt( st.nextToken() );
+            t.y1 = Integer.parseInt( st.nextToken() );
+            t.z1 = Integer.parseInt( st.nextToken() );
+            t.x2 = Integer.parseInt( st.nextToken() );
+            t.y2 = Integer.parseInt( st.nextToken() );
+            t.z2 = Integer.parseInt( st.nextToken() );
+            t.s  = Integer.parseInt( st.nextToken() );
+        } catch (java.io.FileNotFoundException e) {
+        } catch (java.io.IOException e) {
+        }
+        tInfo = t;
     }
 };

project hardware/hw/
diff --git a/gps/gps_freerunner.c b/gps/gps_freerunner.c
index 50dcc45..dcc5d99 100644
--- a/gps/gps_freerunner.c
+++ b/gps/gps_freerunner.c
@@ -32,7 +32,7 @@
 #include <cutils/log.h>
 #include <cutils/sockets.h>
 #include <cutils/properties.h>
-#include <hardware/gps.h>
+#include <hardware_legacy/gps.h>
 
 #define  GPS_DEBUG  0
 

project hardware/libhardware/
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index 7d2b582..2844251 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -107,8 +107,8 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
         const size_t offset = hnd->base - m->framebuffer->base;
         m->info.activate = FB_ACTIVATE_VBL;
         m->info.yoffset = offset / m->finfo.line_length;
-        if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) {
-            LOGE("FBIOPUT_VSCREENINFO failed");
+        if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info) == -1) {
+            LOGE("FBIOPAN_DISPLAY failed");
             m->base.unlock(&m->base, buffer); 
             return -errno;
         }
@@ -201,10 +201,10 @@ int mapFrameBufferLocked(struct private_module_t* module)
 
 
     uint32_t flags = PAGE_FLIP;
-    if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1) {
+    if (ioctl(fd, FBIOPAN_DISPLAY, &info) == -1) {
         info.yres_virtual = info.yres;
         flags &= ~PAGE_FLIP;
-        LOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported");
+        LOGW("FBIOPAN_DISPLAY failed, page flipping not supported");
     }
 
     if (info.yres_virtual < info.yres * 2) {

project kernel/
diff --git a/Android.mk b/Android.mk
index bd9db90..c65d0d5 100644
--- a/Android.mk
+++ b/Android.mk
@@ -38,7 +38,7 @@ $(INSTALLED_TARGET_KERNEL_IMAGE): $(TARGET_KERNEL_IMAGE)
 	$(hide) echo Install kernel image: $@
 	$(hide) $(copy-file-to-target)
 
-ALL_BUILT_MODULES += $(INSTALLED_TARGET_KERNEL_IMAGE)
+CUSTOM_MODULES += $(INSTALLED_TARGET_KERNEL_IMAGE)
 
 kernel-clean:
 	$(hide) $(RM) -rf $(KERNEL_OUTDIR)
diff --git a/arch/arm/configs/gta02_android_defconfig b/arch/arm/configs/gta02_android_defconfig
index c08f0bd..a082378 100644
--- a/arch/arm/configs/gta02_android_defconfig
+++ b/arch/arm/configs/gta02_android_defconfig
@@ -27,6 +27,7 @@ CONFIG_FIQ=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_USER_DEBUG=y
 
 #
 # General setup
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 79abc4d..b2b10a7 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -34,7 +34,7 @@
 static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
 
 #ifdef CONFIG_DEBUG_USER
-unsigned int user_debug;
+unsigned int user_debug = 255;
 
 static int __init user_debug_setup(char *str)
 {
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 611f420..79210f2 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -24,6 +24,7 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
+#include <linux/wakelock.h>
 
 #include "samsung.h"
 
diff --git a/drivers/serial/s3c2440.c b/drivers/serial/s3c2440.c
index 29cbb0a..23a8b9f 100644
--- a/drivers/serial/s3c2440.c
+++ b/drivers/serial/s3c2440.c
@@ -23,6 +23,7 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
+#include <linux/wakelock.h>
 
 #include "samsung.h"
 
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 7b73c69..e047647 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -48,6 +48,8 @@
 
 #include <mach/hardware.h>
 #include <mach/map.h>
+#include <linux/ctype.h>
+#include <linux/wakelock.h>
 
 #include <plat/regs-serial.h>
 #if defined(CONFIG_MACH_NEO1973) && !defined(CONFIG_CPU_S3C6410)
@@ -278,6 +280,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id)
 	tty_flip_buffer_push(tty);
 
  out:
+	wake_lock_timeout(&ourport->wakelock, HZ / 2);
 	return IRQ_HANDLED;
 }
 
@@ -1188,6 +1191,8 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
 	    port->mapbase, port->membase, port->irq,
 	    ourport->rx_irq, ourport->tx_irq, port->uartclk);
 
+	wake_lock_init(&ourport->wakelock, WAKE_LOCK_SUSPEND, "samsung_serial_rx");
+
 	/* reset the fifos (and setup the uart) */
 	s3c24xx_serial_resetport(port, cfg);
 	return 0;
@@ -1250,6 +1255,9 @@ EXPORT_SYMBOL_GPL(s3c24xx_serial_probe);
 int s3c24xx_serial_remove(struct platform_device *dev)
 {
 	struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
+	struct s3c24xx_uart_port *ourport = to_ourport(port);
+
+	wake_lock_destroy(&ourport->wakelock);
 
 	if (port) {
 		s3c24xx_serial_cpufreq_deregister(to_ourport(port));
diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
index f259211..16fe8a7 100644
--- a/drivers/serial/samsung.h
+++ b/drivers/serial/samsung.h
@@ -56,6 +56,7 @@ struct s3c24xx_uart_port {
 #endif
 
 	struct resume_dependency	resume_dependency;
+	struct wake_lock		wakelock;
 };
 
 /* conversion functions */

project system/core/
diff --git a/init/Android.mk b/init/Android.mk
index d3766d4..bb7cbdc 100644
--- a/init/Android.mk
+++ b/init/Android.mk
@@ -20,8 +20,8 @@ endif
 LOCAL_MODULE:= init
 
 LOCAL_FORCE_STATIC_EXECUTABLE := true
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
+LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
+LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
 
 LOCAL_STATIC_LIBRARIES := libcutils libc
 
diff --git a/libpixelflinger/codeflinger/ARMAssembler.cpp b/libpixelflinger/codeflinger/ARMAssembler.cpp
index ff7b0b3..13e3954 100644
--- a/libpixelflinger/codeflinger/ARMAssembler.cpp
+++ b/libpixelflinger/codeflinger/ARMAssembler.cpp
@@ -364,64 +364,211 @@ void ARMAssembler::SWI(int cc, uint32_t comment) {
 
 // DSP instructions...
 void ARMAssembler::PLD(int Rn, uint32_t offset) {
+#ifndef __ARM_ARCH_4T__
     LOG_ALWAYS_FATAL_IF(!((offset&(1<<24)) && !(offset&(1<<21))),
                         "PLD only P=1, W=0");
     *mPC++ = 0xF550F000 | (Rn<<16) | offset;
+#else
+    // This is a helper instruction that doesn't need to be issued.
+#endif
 }
 
 void ARMAssembler::CLZ(int cc, int Rd, int Rm)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x16F0F10| (Rd<<12) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 void ARMAssembler::QADD(int cc,  int Rd, int Rm, int Rn)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1000050 | (Rn<<16) | (Rd<<12) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 void ARMAssembler::QDADD(int cc,  int Rd, int Rm, int Rn)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1400050 | (Rn<<16) | (Rd<<12) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 void ARMAssembler::QSUB(int cc,  int Rd, int Rm, int Rn)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1200050 | (Rn<<16) | (Rd<<12) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 void ARMAssembler::QDSUB(int cc,  int Rd, int Rm, int Rn)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1600050 | (Rn<<16) | (Rd<<12) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 void ARMAssembler::SMUL(int cc, int xy,
                 int Rd, int Rm, int Rs)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1600080 | (Rd<<16) | (Rs<<8) | (xy<<4) | Rm;
+#else
+    int touched = (((1<<Rm) | (1<<Rs)) & ~(1<<Rd));
+    uint32_t* ccPC = mPC;
+    if (cc != AL) MOV(AL, 0, R0, R0); // NOP
+    STM(AL, DB, SP, 1, touched);
+    switch (xy) {
+    case 0:		// xyBB
+	MOV(AL, 0, Rm, reg_imm(Rm, LSL, 16));
+	MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+	MOV(AL, 0, Rs, reg_imm(Rs, LSL, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 2:		// xyTB
+        MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+	MOV(AL, 0, Rs, reg_imm(Rs, LSL, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 4:		// xyBT
+	MOV(AL, 0, Rm, reg_imm(Rm, LSL, 16));
+	MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 6:		// xyTT
+        MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    };
+    MUL(AL, 0, Rd, Rm, Rs);
+    LDM(AL, IA, SP, 1, touched);
+    if (cc != AL) {
+	uint32_t* pc = mPC;
+	pc = mPC;
+	mPC = ccPC;
+	B(cc^1, pc);
+	mPC = pc;
+    }
+#endif
 }
 
 void ARMAssembler::SMULW(int cc, int y,
                 int Rd, int Rm, int Rs)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x12000A0 | (Rd<<16) | (Rs<<8) | (y<<4) | Rm;
+#else
+    int Rt1 = (Rd == Rm) ? Rs : Rm;
+    int Rt2 = (Rt1 == Rs) ? LR : Rs;
+    int touched = (((1<<Rm) | (1<<Rs) | (1<<Rt2)) & ~(1<<Rd));
+    uint32_t* ccPC = mPC;
+    if (cc != AL) MOV(AL, 0, R0, R0); // NOP
+    STM(AL, DB, SP, 1, touched);
+    switch (y) {
+    case 0:		// yB
+	MOV(AL, 0, Rs, reg_imm(Rs, LSL, 16));
+	MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 4:		// yT
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    };
+    UMULL(AL, 0, Rt1, Rt2, Rm, Rs);
+    MOV(AL, 0, Rd, reg_imm(Rt1, LSR, 16));
+    MOV(AL, 0, Rt1, reg_imm(Rt2, LSL, 16));
+    ORR(AL, 0, Rd, Rd, Rt1);
+    LDM(AL, IA, SP, 1, touched);
+    if (cc != AL) {
+	uint32_t* pc = mPC;
+	pc = mPC;
+	mPC = ccPC;
+	B(cc^1, pc);
+	mPC = pc;
+    }
+#endif
 }
 
 void ARMAssembler::SMLA(int cc, int xy,
                 int Rd, int Rm, int Rs, int Rn)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1000080 | (Rd<<16) | (Rn<<12) | (Rs<<8) | (xy<<4) | Rm;
+#else
+    int touched = (((1<<Rm) | (1<<Rs)) & ~(1<<Rd));
+    int Rt = (Rd == Rm) ? Rs : Rm;
+    uint32_t* ccPC = mPC;
+    if (cc != AL) MOV(AL, 0, R0, R0); // NOP
+    STM(AL, DB, SP, 1, touched);
+    switch (xy) {
+    case 0:		// xyBB
+	MOV(AL, 0, Rm, reg_imm(Rm, LSL, 16));
+	MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+	MOV(AL, 0, Rs, reg_imm(Rs, LSL, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 2:		// xyTB
+        MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+	MOV(AL, 0, Rs, reg_imm(Rs, LSL, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 4:		// xyBT
+	MOV(AL, 0, Rm, reg_imm(Rm, LSL, 16));
+	MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    case 6:		// xyTT
+        MOV(AL, 0, Rm, reg_imm(Rm, ASR, 16));
+        MOV(AL, 0, Rs, reg_imm(Rs, ASR, 16));
+	break;
+    };
+    MUL(AL, 0, Rt, Rm, Rs);
+    ADD(AL, 0, Rd, Rt, Rn);
+    LDM(AL, IA, SP, 1, touched);
+    if (cc != AL) {
+	uint32_t* pc = mPC;
+	pc = mPC;
+	mPC = ccPC;
+	B(cc^1, pc);
+	mPC = pc;
+    }
+#endif
 }
 
 void ARMAssembler::SMLAL(int cc, int xy,
                 int RdHi, int RdLo, int Rs, int Rm)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1400080 | (RdHi<<16) | (RdLo<<12) | (Rs<<8) | (xy<<4) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 void ARMAssembler::SMLAW(int cc, int y,
                 int Rd, int Rm, int Rs, int Rn)
 {
+#ifndef __ARM_ARCH_4T__
     *mPC++ = (cc<<28) | 0x1200080 | (Rd<<16) | (Rn<<12) | (Rs<<8) | (y<<4) | Rm;
+#else
+    // This instruction not used?
+    LOG_ALWAYS_FATAL("Instruction not implemented!!!");
+#endif
 }
 
 }; // namespace android
diff --git a/libpixelflinger/rotate90CW_4x4_16v6.S b/libpixelflinger/rotate90CW_4x4_16v6.S
index 8e3e142..9943979 100644
--- a/libpixelflinger/rotate90CW_4x4_16v6.S
+++ b/libpixelflinger/rotate90CW_4x4_16v6.S
@@ -59,4 +59,10 @@ rotate90CW_4x4_16v6:
     pkhtb   r11, r3, r5, asr #16
     strd    r10, r11, [r0]
 
+#ifndef __ARM_ARCH_4__
     ldmfd   sp!, {r4,r5, r6,r7, r8,r9, r10,r11, pc}
+#else
+    ldmfd   sp!, {r4,r5, r6,r7, r8,r9, r10,r11, lr}
+    bx      lr
+#endif
+
diff --git a/libpixelflinger/scanline.cpp b/libpixelflinger/scanline.cpp
index f700306..3491f74 100644
--- a/libpixelflinger/scanline.cpp
+++ b/libpixelflinger/scanline.cpp
@@ -1321,7 +1321,7 @@ void scanline_t32cb16blend(context_t* c)
     const int32_t v = (c->state.texture[0].shade.it0>>16) + y;
     uint32_t *src = reinterpret_cast<uint32_t*>(tex->data)+(u+(tex->stride*v));
 
-#if ((ANDROID_CODEGEN >= ANDROID_CODEGEN_ASM) && defined(__arm__))
+#if ((ANDROID_CODEGEN >= ANDROID_CODEGEN_ASM) && defined(__arm__) && (! defined(__ARM_ARCH_4T__)))
     scanline_t32cb16blend_arm(dst, src, ct);
 #else
     while (ct--) {
diff --git a/libpixelflinger/t32cb16blend.S b/libpixelflinger/t32cb16blend.S
index caf9eb7..4a91a22 100644
--- a/libpixelflinger/t32cb16blend.S
+++ b/libpixelflinger/t32cb16blend.S
@@ -54,7 +54,15 @@
 
     // red
     mov     lr, \DREG, lsr #(16 + 11)
+#ifndef __ARM_ARCH_4T__
     smulbb  lr, r7, lr
+#else
+    lsl     lr, lr, #16
+    lsr     lr, lr, #16
+    lsl     r6, r7, #16
+    lsr     r6, r6, #16
+    mul     lr, r6, lr
+#endif
     mov     r6, \SRC, lsr #3
     and     r6, r6, #0x1F
     add     lr, r6, lr, lsr #8
@@ -64,7 +72,14 @@
 
         // green
         and     r6, \DREG, #(0x3F<<(16 + 5))
+#ifndef __ARM_ARCH_4T__
         smulbt  r6, r7, r6
+#else
+        lsr     r6, r6, #16
+        lsl     lr, r7, #16
+        lsr     lr, lr, #16
+        mul     r6, lr, r6
+#endif
         mov     lr, \SRC, lsr #(8+2)
         and     lr, lr, #0x3F
         add     r6, lr, r6, lsr #(5+8)
@@ -74,7 +89,14 @@
 
             // blue
             and     lr, \DREG, #(0x1F << 16)
+#ifndef __ARM_ARCH_4T__
             smulbt  lr, r7, lr
+#else
+            lsr     lr, lr, #16
+            lsl     r6, r7, #16
+            lsr     r6, r6, #16
+            mul     lr, r6, lr
+#endif
             mov     r6, \SRC, lsr #(8+8+3)
             and     r6, r6, #0x1F
             add     lr, r6, lr, lsr #8
@@ -87,7 +109,15 @@
     // red
     mov     lr, \DREG, lsr #11
     and     lr, lr, #0x1F
+#ifndef __ARM_ARCH_4T__
     smulbb  lr, r7, lr
+#else
+    lsl     lr, lr, #16
+    lsr     lr, lr, #16
+    lsl     r6, r7, #16
+    lsr     r6, r6, #16
+    mul     lr, r6, lr
+#endif
     mov     r6, \SRC, lsr #3
     and     r6, r6, #0x1F
     add     lr, r6, lr, lsr #8
@@ -98,7 +128,15 @@
 
         // green
         and     r6, \DREG, #(0x3F<<5)
+#ifndef __ARM_ARCH_4T__
         smulbb  r6, r7, r6
+#else
+        lsl     r6, r6, #16
+        lsr     r6, r6, #16
+        lsl     lr, r7, #16
+        lsr     lr, lr, #16
+        mul     r6, lr, r6
+#endif
         mov     lr, \SRC, lsr #(8+2)
         and     lr, lr, #0x3F
         add     r6, lr, r6, lsr #(5+8)
@@ -108,7 +146,15 @@
 
             // blue
             and     lr, \DREG, #0x1F
+#ifndef __ARM_ARCH_4T__
             smulbb  lr, r7, lr
+#else
+            lsl     lr, lr, #16
+            lsr     lr, lr, #16
+            lsl     r6, r7, #16
+            lsr     r6, r6, #16
+            mul     lr, r6, lr
+#endif
             mov     r6, \SRC, lsr #(8+8+3)
             and     r6, r6, #0x1F
             add     lr, r6, lr, lsr #8
@@ -139,8 +185,10 @@
 scanline_t32cb16blend_arm:
     stmfd	sp!, {r4-r7, lr}
 
+#ifndef __ARM_ARCH_4T__
     pld     [r0]
     pld     [r1]
+#endif
 
     // align DST to 32 bits
     tst     r0, #0x3
@@ -162,7 +210,9 @@ aligned:
     // The main loop is unrolled twice and processes 4 pixels
 8:  ldmia   r1!, {r4, r5}
     // stream the source
+#ifndef __ARM_ARCH_4T__
     pld     [r1, #32]
+#endif
     add     r0, r0, #4
     // it's all zero, skip this pixel
     orrs    r3, r4, r5
@@ -171,7 +221,9 @@ aligned:
     // load the destination
     ldr     r3, [r0, #-4]
     // stream the destination
+#ifndef __ARM_ARCH_4T__
     pld     [r0, #32]
+#endif
     pixel   r3, r4, r12, 0
     pixel   r3, r5, r12, 1
     // effectively, we're getting write-combining by virtue of the
@@ -200,3 +252,4 @@ aligned:
     ldmlofd sp!, {r4-r7, lr}        // return
     bxlo    lr
     b       last
+

project vendor/neo/fr/
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 206057f..2bbe685 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -2,12 +2,14 @@
 # 
 # Product-specific compile-time definitions.
 #
+TARGET_CPU_ABI := armeabi
+TARGET_ARCH_VARIANT := armv4t
 
 BOARD_HAVE_BLUETOOTH    := true
-BOARD_USES_ALSA_AUDIO	:= true
-BUILD_WITH_ALSA_UTILS := true
+BOARD_USES_ALSA_AUDIO	:= false
+BUILD_WITH_ALSA_UTILS := false
 BOARD_HAVE_FREERUNNER_GPS := true
-#BOARD_USES_GENERIC_AUDIO	:= true
+BOARD_USES_GENERIC_AUDIO	:= true
 HAVE_HTC_AUDIO_DRIVER	:= false
 HAVE_WEXT_WIFI_DRIVER	:= true
 USE_PRODUCT_WIFI_CONF	:= true
@@ -22,7 +24,7 @@ USE_SENSOR_TYPE			:= moko
 USE_VIBRATOR_TYPE		:= led
 #This builds Android with the PacketVideo Player and codecs that
 #require licensing. Comment the line below to include these codecs.
-BUILD_WITH_PV	:= true
+#BUILD_WITHOUT_PV=true
 # The jpeg assembly doesn't currently suport armv4t
 ANDROID_JPEG_NO_ASSEMBLER	:= true
 
diff --git a/freerunner.mk b/freerunner.mk
index b6f583b..38fc268 100644
--- a/freerunner.mk
+++ b/freerunner.mk
@@ -26,21 +26,10 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
 # Overrides
 PRODUCT_BRAND            := neo
 PRODUCT_BRANDING_PARTNER := neo
-PRODUCT_NAME             := freerunner
-PRODUCT_DEVICE           := freerunner
+PRODUCT_NAME             := fr
+PRODUCT_DEVICE           := fr
 PRODUCT_MANUFACTURER     := Openmoko
 
 SYSTEM_IMAGE_FS := jffs2
 USERDATA_IMAGE_FS := tar
 
-# This shouldn't be necessay. Why does this file get included for other products?
-#
-ifeq ($(TARGET_PRODUCT),freerunner)
-
-ARMV4 := V4_
-
-override TARGET_ARCH_CFLAGS := \
-			-march=armv4t -mtune=arm920t -msoft-float -mthumb-interwork \
-			-D__ARM_ARCH_4__ -D__ARM_ARCH_4T__
-
-endif
diff --git a/init.rc b/init.rc
index ca38eef..4652c4c 100644
--- a/init.rc
+++ b/init.rc
@@ -2,7 +2,7 @@ on init
 
 sysclktz 0
 
-loglevel 3
+loglevel 8
 
 # setup the global environment
     export PATH /sbin:/system/sbin:/system/bin:/system/xbin
@@ -14,6 +14,7 @@ loglevel 3
     export EXTERNAL_STORAGE /sdcard
     export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
 
+    mount rootfs rootfs / rw remount
 # Backward compatibility
     symlink /system/etc /etc
 
@@ -35,20 +36,20 @@ loglevel 3
 
 # mount mtd partitions
     # Mount /system rw first to give the filesystem a chance to save a checkpoint
-    mount jffs2 m...@system /system
-    mount jffs2 m...@system /system ro remount
+    # We chown/chmod /data again so because mount is run as root + defaults
+    mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev
 
     # Not sure why we need this
     setprop EXTERNAL_STORAGE_STATE mounted
     mount vfat /dev/block/mmcblk0p1 /sdcard nosuid nodev
 
     # We chown/chmod /data again so because mount is run as root + defaults
-    mount yaffs2 m...@userdata /data nosuid nodev
+    # mount yaffs2 m...@userdata /data nosuid nodev
     chown system system /data
     chmod 0771 /data
 
     # Same reason as /data above
-    mount yaffs2 m...@cache /cache nosuid nodev
+    # mount yaffs2 m...@cache /cache nosuid nodev
     chown system cache /cache
     chmod 0770 /cache
 
@@ -138,6 +139,7 @@ on boot
     setprop ro.FOREGROUND_APP_ADJ 0
     setprop ro.VISIBLE_APP_ADJ 1
     setprop ro.SECONDARY_SERVER_ADJ 2
+    setprop ro.BACKUP_APP_ADJ 2
     setprop ro.HOME_APP_ADJ 4
     setprop ro.HIDDEN_APP_MIN_ADJ 7
     setprop ro.CONTENT_PROVIDER_ADJ 14
@@ -148,6 +150,7 @@ on boot
     setprop ro.FOREGROUND_APP_MEM 1536
     setprop ro.VISIBLE_APP_MEM 2048
     setprop ro.SECONDARY_SERVER_MEM 4096
+    setprop ro.BACKUP_APP_MEM 4096
     setprop ro.HOME_APP_MEM 4096
     setprop ro.HIDDEN_APP_MEM 5120
     setprop ro.CONTENT_PROVIDER_MEM 5632

Reply via email to