From 21a85d799e5a1b5b87f3504ed63faf7388178ede Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Sun, 24 Feb 2002 22:14:05 +0000 Subject: [PATCH] Minor changes for making apps/baresh compile (tough it doesn't work yet). svn path=/trunk/; revision=2647 --- posix/lib/psxdll/Makefile | 20 ++++++++++++++++---- posix/lib/psxdll/misc/heap.c | 17 +++++++++++++++++ posix/lib/psxdll/misc/init.c | 27 +++++++++++++++++++++++++++ posix/lib/psxdll/psxdll.def | 8 +++++++- posix/lib/psxdll/psxdll.edf | 7 ++++++- 5 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 posix/lib/psxdll/misc/heap.c create mode 100644 posix/lib/psxdll/misc/init.c diff --git a/posix/lib/psxdll/Makefile b/posix/lib/psxdll/Makefile index fc51e08258f..9119083ced5 100644 --- a/posix/lib/psxdll/Makefile +++ b/posix/lib/psxdll/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2002/02/20 09:17:56 hyperion Exp $ +# $Id: Makefile,v 1.3 2002/02/24 22:14:05 ea Exp $ PATH_TO_TOP = ../../../.. @@ -6,6 +6,8 @@ TARGET_TYPE = dynlink TARGET_NAME = psxdll +TARGET_LIBPATH = $(PATH_TO_TOP)/dk/psx/lib + TARGET_LFLAGS = -nostartfiles TARGET_SDKLIBS = ntdll.a @@ -14,7 +16,15 @@ TARGET_BASE = 0x68EB0000 TARGET_ENTRY = _DllMain@12 -TARGET_CFLAGS = -W -nostdinc -nostdlib -fno-builtin -I$(PATH_TO_TOP)/subsys/psx/include -D__PSXDLL__ -D__PSX_DEBUG_WANT_ALL__ +TARGET_CFLAGS =\ + -W \ + -nostdinc \ + -nostdlib \ + -fno-builtin \ + -I$(PATH_TO_TOP)/subsys/psx/include \ + -I$(PATH_TO_TOP)/include \ + -D__PSXDLL__ \ + -D__PSX_DEBUG_WANT_ALL__ TARGET_OBJECTS = $(TARGET_NAME).o @@ -25,10 +35,12 @@ include $(TOOLS_PATH)/helper.mk OBJECTS_MISC = \ misc/main.o \ + misc/init.o \ + misc/heap.o \ misc/interlock.o \ misc/safeobj.o \ - misc/path.o \ - misc/fdtable.o + misc/path.o \ + misc/fdtable.o OBJECTS_DIRENT = \ dirent/opendir.o \ diff --git a/posix/lib/psxdll/misc/heap.c b/posix/lib/psxdll/misc/heap.c new file mode 100644 index 00000000000..a2535d2a367 --- /dev/null +++ b/posix/lib/psxdll/misc/heap.c @@ -0,0 +1,17 @@ +/* $Id: heap.c,v 1.1 2002/02/24 22:14:05 ea Exp $ + * + * FILE: reactos/subsys/psx/lib/psxdll/misc/heap.c + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * PURPOSE: Support routines for crt0.c + * UPDATE HISTORY: + * 2001-05-06 + */ +#define NTOS_MODE_USER +#include +#include +HANDLE STDCALL GetProcessHeap (VOID) +{ + return (HANDLE)NtCurrentPeb()->ProcessHeap; +} +/* EOF */ diff --git a/posix/lib/psxdll/misc/init.c b/posix/lib/psxdll/misc/init.c new file mode 100644 index 00000000000..9ed5ba8370d --- /dev/null +++ b/posix/lib/psxdll/misc/init.c @@ -0,0 +1,27 @@ +/* $Id: init.c,v 1.1 2002/02/24 22:14:05 ea Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: reactos/subsys/psx/lib/psxdll/misc/init.c + * PURPOSE: Client initialization + * PROGRAMMER: Emanuele Aliberti + * UPDATE HISTORY: + * 2001-05-06 + */ +#define NTOS_MODE_USER +#include + +/* DLL GLOBALS */ +int * errno = NULL; +char *** _environ = NULL; +/* + * Called by startup code in crt0.o, where real + * errno and _environ are actually defined. + */ +VOID STDCALL __PdxInitializeData (int * errno_arg, char *** environ_arg) +{ + errno = errno_arg; + _environ = environ_arg; +} +/* EOF */ + diff --git a/posix/lib/psxdll/psxdll.def b/posix/lib/psxdll/psxdll.def index 65851a31d56..e35e999bf15 100644 --- a/posix/lib/psxdll/psxdll.def +++ b/posix/lib/psxdll/psxdll.def @@ -1,4 +1,4 @@ -; $Id: psxdll.def,v 1.2 2002/02/20 09:17:56 hyperion Exp $ +; $Id: psxdll.def,v 1.3 2002/02/24 22:14:05 ea Exp $ ; ; ReactOS POSIX+ Client Library ; @@ -6,6 +6,12 @@ LIBRARY PSXDLL.DLL EXPORTS +;misc/init +__PdxInitializeData@8 +;misc/heap +GetProcessHeap@0 + + ;dirent opendir readdir diff --git a/posix/lib/psxdll/psxdll.edf b/posix/lib/psxdll/psxdll.edf index 98309ef9446..941880ac402 100644 --- a/posix/lib/psxdll/psxdll.edf +++ b/posix/lib/psxdll/psxdll.edf @@ -1,4 +1,4 @@ -; $Id: psxdll.edf,v 1.2 2002/02/20 09:17:56 hyperion Exp $ +; $Id: psxdll.edf,v 1.3 2002/02/24 22:14:05 ea Exp $ ; ; ReactOS POSIX+ Client Library ; @@ -6,6 +6,11 @@ LIBRARY PSXDLL.DLL EXPORTS +;misc/init +__PdxInitializeData=__PdxInitializeData@8 +;misc/heap +GetProcessHeap=GetProcessHeap@0 + ;dirent opendir=opendir readdir=readdir -- 2.17.1