From a0309ee5313b933710ff950c69d297ee0c7b8f60 Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Fri, 8 Feb 2008 08:20:06 +0000 Subject: [PATCH] We now also implement InterlockedExchange (Fixes rtl build). We now set -lgcc for all builds (to get built-in division helpers), and also -static (not to import libgcc.dll -- it seems -static isn't needed on x86, but it is on ARM). We hackfix kdcom to use the FeroUart base address -- this driver won't be used for a while, but we need to have it built. Now binaries are being created properly (previously kernel was 15MB and importing .DLL files...). FreeLDR output: FreeLoader v3.0 for ARM Bootargs: rdbase=0x2000000 rdsize=0x1400000 Detecting Hardware... Loading... Reading NTOSKRNL.EXE Reading BOOTVID.DLL Reading HAL.DLL Reading HAL.DLL Reading c_1252.nls Reading c_437.nls Reading l_intl.nls Reading scsiport.sys svn path=/trunk/; revision=32207 --- reactos/ReactOS-arm.rbuild | 3 +++ reactos/drivers/base/kdcom/kdbg.c | 2 ++ reactos/include/psdk/intrin_arm.h | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/reactos/ReactOS-arm.rbuild b/reactos/ReactOS-arm.rbuild index e0b9211759e..3108b0bebe1 100644 --- a/reactos/ReactOS-arm.rbuild +++ b/reactos/ReactOS-arm.rbuild @@ -33,4 +33,7 @@ -Wno-attributes -fno-strict-aliasing + -s + -lgcc + -static diff --git a/reactos/drivers/base/kdcom/kdbg.c b/reactos/drivers/base/kdcom/kdbg.c index c44ff9af520..20f92020b78 100644 --- a/reactos/drivers/base/kdcom/kdbg.c +++ b/reactos/drivers/base/kdcom/kdbg.c @@ -59,6 +59,8 @@ const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; const ULONG BaseArray[2] = {0, 0x800003f8}; #elif defined(_M_MIPS) const ULONG BaseArray[3] = {0, 0x80006000, 0x80007000}; +#elif defined(_M_ARM) +const ULONG BaseArray[2] = {0, 0xF1012000}; #else #error Unknown architecture #endif diff --git a/reactos/include/psdk/intrin_arm.h b/reactos/include/psdk/intrin_arm.h index 8f07f230d2a..43808d2db7e 100644 --- a/reactos/include/psdk/intrin_arm.h +++ b/reactos/include/psdk/intrin_arm.h @@ -72,6 +72,17 @@ static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(vo return a; } +static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const dest, const long exch) +{ + long a; + + __asm__ __volatile__ ( "swp %0, %2, [%1]" + : "=&r" (a) + : "r" (dest), "r" (exch)); + + return a; +} + static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) { char x; -- 2.17.1