} tRequestValue;
typedef struct sRequestHeader {
- uint16_t ClientID;
- uint16_t CallID; //!< \see eSyscalls
+ uint32_t ClientID;
uint32_t MessageLength;
+ uint16_t CallID; //!< \see eSyscalls
uint16_t NParams;
tRequestValue Params[];
-} tRequestHeader;
+} __attribute__((packed)) tRequestHeader;
enum eSyscalls {
ASFLAGS = -felf
CPPFLAGS = -Wall
CFLAGS = $(CPPFLAGS)
-LDFLAGS = -L $(OUTPUTDIR)Libs -lacess-native
+LDFLAGS = -L $(OUTPUTDIR)Libs -lacess-native -lc_acess
#LIBGCC_PATH = $(ACESSDIR)/AcessNative/symbol_renames.ld
else
ASFLAGS = -felf
ifeq ($(ARCHDIR),native)
ASFLAGS += -D ARCHDIR=$(ARCHDIR) -D __ASSEMBLER__=1
LDFLAGS := -lacess-native
+#CPPFLAGS := -D SoMain="__attribute__ ((constructor(101))) libacessnative_init"
ifeq ($(PLATFORM),windows)
else
LDFLAGS += -Wl,-init,SoMain
comma=,
+LDFLAGS += -soname $(BIN)
+
+ifeq ($(ARCH),native)
+ LDFLAGS := $(LDFLAGS:-lc=-lc_acess)
+endif
+
ifneq ($(lastword $(subst -, ,$(basename $(LD)))),ld)
LDFLAGS := $(subst -soname ,-Wl$(comma)-soname$(comma),$(LDFLAGS))
LDFLAGS := $(subst -Map ,-Wl$(comma)-Map$(comma),$(LDFLAGS))
CPPFLAGS += \r
CFLAGS += -Werror -Wextra\r
ASFLAGS +=\r
-LDFLAGS += -soname libc.so -Map map.txt\r
+LDFLAGS += -Map map.txt\r
\r
INCFILES := stdio.h stdlib.h\r
\r
#define SEEK_END (-1)
#endif
+#ifdef ARCHDIR_is_native
+#define printf acess_printf
+#define vsprintf acess_vsprintf
+#define vsnprintf acess_vsnprintf
+#define sprintf acess_sprintf
+#define snprintf acess_snprintf
+#define vprintf acess_vprintf
+#define vfprintf acess_vfprintf
+#define fopen acess_fopen
+#define fdopen acess_fdopen
+#define freopen acess_freopen
+#define fclose acess_fclose
+
+#define putchar acess_putchar
+#define getchar acess_getchar
+
+#define stdin acess_stdin
+#define stdout acess_stdout
+#endif
+
/* --- Standard IO --- */
extern int printf(const char *format, ...);
extern int vsnprintf(char *buf, size_t __maxlen, const char *format, va_list args);