Author: tkreuzer
Date: Fri Sep 5 20:07:53 2014
New Revision: 64039
URL:
http://svn.reactos.org/svn/reactos?rev=64039&view=rev
Log:
[SPEC2DEF] Add support for ARM asm stub generation
[HALARM] Add a dummy CMakeLists.txt
[BOOTVID] Fix ARM compilation
Added:
trunk/reactos/hal/halarm/CMakeLists.txt (with props)
Modified:
trunk/reactos/drivers/base/bootvid/precomp.h
trunk/reactos/hal/CMakeLists.txt
trunk/reactos/include/crt/crtdefs.h
trunk/reactos/tools/spec2def/spec2def.c
Modified: trunk/reactos/drivers/base/bootvid/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/preco…
==============================================================================
--- trunk/reactos/drivers/base/bootvid/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/base/bootvid/precomp.h [iso-8859-1] Fri Sep 5 20:07:53 2014
@@ -1,7 +1,7 @@
#ifndef _BOOTVID_PCH_
#define _BOOTVID_PCH_
-#include <wdm.h>
+#include <ntddk.h>
#include <drivers/bootvid/bootvid.h>
/* Define if FontData has upside down characters */
Modified: trunk/reactos/hal/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/CMakeLists.txt?rev=640…
==============================================================================
--- trunk/reactos/hal/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/hal/CMakeLists.txt [iso-8859-1] Fri Sep 5 20:07:53 2014
@@ -3,7 +3,7 @@
if((ARCH STREQUAL "i386") OR (ARCH STREQUAL "amd64"))
add_subdirectory(halx86)
elseif(ARCH STREQUAL "arm")
-# add_subdirectory(halarm)
+ add_subdirectory(halarm)
elseif(ARCH STREQUAL "powerpc")
# add_subdirectory(halppc)
endif()
Added: trunk/reactos/hal/halarm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/CMakeLists.txt?…
==============================================================================
--- trunk/reactos/hal/halarm/CMakeLists.txt (added)
+++ trunk/reactos/hal/halarm/CMakeLists.txt [iso-8859-1] Fri Sep 5 20:07:53 2014
@@ -0,0 +1,17 @@
+
+spec2def(hal.dll ../hal.spec ADD_IMPORTLIB)
+
+add_definitions(
+ -D_NTHALDLL_
+ -D_NTHAL_)
+
+include_directories(
+ include
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/include)
+
+list(APPEND SOURCES
+ omap3/halinit_up.c
+ omap3/halup.rc)
+
+add_library(hal SHARED
+ ${SOURCES})
Propchange: trunk/reactos/hal/halarm/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/include/crt/crtdefs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
==============================================================================
--- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Fri Sep 5 20:07:53 2014
@@ -126,7 +126,7 @@
#endif
#ifndef UNALIGNED
-#if defined(__ia64__) || defined(__x86_64)
+#if defined(__ia64__) || defined(__x86_64) || defined(__arm__)
#define UNALIGNED __unaligned
#else
#define UNALIGNED
Modified: trunk/reactos/tools/spec2def/spec2def.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
==============================================================================
--- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Fri Sep 5 20:07:53 2014
@@ -259,56 +259,82 @@
if (giArch == ARCH_X86)
{
- fprintf(file, ".586\n.model flat\n");
+ fprintf(file, ".586\n.model flat\n.code\n");
+ }
+ else if (giArch == ARCH_AMD64)
+ {
+ fprintf(file, ".code\n");
}
else if (giArch == ARCH_ARM)
{
- fprintf(file, "#include <kxarm.h>\n TEXTAREA\n");
- }
-
- fprintf(file, ".code\n");
+ fprintf(file,
+ " AREA |.text|,ALIGN=2,CODE,READONLY\n\n");
+ }
+}
+
+void
+Output_symbol(FILE *fileDest, char* pszSymbolName)
+{
+ if (giArch == ARCH_ARM)
+ {
+ fprintf(fileDest,
+ " EXPORT %s [FUNC]\n%s\n",
+ pszSymbolName,
+ pszSymbolName);
+ }
+ else
+ {
+ fprintf(fileDest,
+ "PUBLIC %s\n%s: nop\n",
+ pszSymbolName,
+ pszSymbolName);
+ }
}
int
OutputLine_asmstub(FILE *fileDest, EXPORT *pexp)
{
+ char szNameBuffer[128];
+
/* Handle autoname */
if (pexp->strName.len == 1 && pexp->strName.buf[0] == '@')
{
- fprintf(fileDest, "PUBLIC %sordinal%d\n%sordinal%d: nop\n",
+ sprintf(szNameBuffer, "%sordinal%d\n%sordinal%d: nop\n",
gpszUnderscore, pexp->nOrdinal, gpszUnderscore, pexp->nOrdinal);
}
else if (giArch != ARCH_X86)
{
- fprintf(fileDest, "PUBLIC _stub_%.*s\n_stub_%.*s: nop\n",
+ sprintf(szNameBuffer, "_stub_%.*s",
pexp->strName.len, pexp->strName.buf,
pexp->strName.len, pexp->strName.buf);
}
else if (pexp->nCallingConvention == CC_STDCALL)
{
- fprintf(fileDest, "PUBLIC __stub_%.*s@%d\n__stub_%.*s@%d: nop\n",
+ sprintf(szNameBuffer, "__stub_%.*s@%d",
pexp->strName.len, pexp->strName.buf, pexp->nStackBytes,
pexp->strName.len, pexp->strName.buf, pexp->nStackBytes);
}
else if (pexp->nCallingConvention == CC_FASTCALL)
{
- fprintf(fileDest, "PUBLIC @_stub_%.*s@%d\n@_stub_%.*s@%d: nop\n",
+ sprintf(szNameBuffer, "@_stub_%.*s@%d",
pexp->strName.len, pexp->strName.buf, pexp->nStackBytes,
pexp->strName.len, pexp->strName.buf, pexp->nStackBytes);
}
else if (pexp->nCallingConvention == CC_CDECL ||
pexp->nCallingConvention == CC_STUB)
{
- fprintf(fileDest, "PUBLIC __stub_%.*s\n__stub_%.*s: nop\n",
+ sprintf(szNameBuffer, "__stub_%.*s",
pexp->strName.len, pexp->strName.buf,
pexp->strName.len, pexp->strName.buf);
}
else if (pexp->nCallingConvention == CC_EXTERN)
{
- fprintf(fileDest, "PUBLIC __stub_%.*s\n__stub_%.*s:\n",
+ sprintf(szNameBuffer, "__stub_%.*s",
pexp->strName.len, pexp->strName.buf,
pexp->strName.len, pexp->strName.buf);
}
+
+ Output_symbol(fileDest, szNameBuffer);
return 1;
}
@@ -1038,7 +1064,7 @@
OutputHeader_asmstub(file, pszDllName);
result = ParseFile(pszSource, file, OutputLine_asmstub);
- fprintf(file, "\nEND\n");
+ fprintf(file, "\n END\n");
fclose(file);
}