mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[SPEC2DEF] Add support for ARM asm stub generation
[HALARM] Add a dummy CMakeLists.txt [BOOTVID] Fix ARM compilation svn path=/trunk/; revision=64039
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -3,7 +3,7 @@ project(HAL)
|
||||
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()
|
||||
|
||||
@@ -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})
|
||||
@@ -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
|
||||
|
||||
@@ -259,57 +259,83 @@ OutputHeader_asmstub(FILE *file, char *libname)
|
||||
|
||||
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,
|
||||
" AREA |.text|,ALIGN=2,CODE,READONLY\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(file, ".code\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 @@ int main(int argc, char *argv[])
|
||||
|
||||
OutputHeader_asmstub(file, pszDllName);
|
||||
result = ParseFile(pszSource, file, OutputLine_asmstub);
|
||||
fprintf(file, "\nEND\n");
|
||||
fprintf(file, "\n END\n");
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user