From d06c2ff01e736b69eba042764e2437fbac91e072 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Thu, 17 Feb 2011 11:21:25 +0000 Subject: [PATCH] ddk: alloca & chkstk git-svn-id: svn://kolibrios.org@1872 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ddk/Makefile | 2 +- drivers/ddk/core.S | 12 ++++++++++++ drivers/include/syscall.h | 7 +++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/ddk/Makefile b/drivers/ddk/Makefile index 5416a061ec..580235ca83 100644 --- a/drivers/ddk/Makefile +++ b/drivers/ddk/Makefile @@ -1,5 +1,4 @@ - CC = gcc AS = as @@ -17,6 +16,7 @@ CORE_SRC= core.S NAME_SRCS:= \ debug/dbglog.c \ + debug/chkstk.S \ io/create.c \ io/finfo.c \ io/ssize.c \ diff --git a/drivers/ddk/core.S b/drivers/ddk/core.S index f16a797cde..8f4a11bbe9 100644 --- a/drivers/ddk/core.S +++ b/drivers/ddk/core.S @@ -22,6 +22,7 @@ .global _GetPgAddr .global _GetService .global _GetTimerTicks + .global _GetStackBase .global _KernelAlloc .global _KernelFree @@ -45,6 +46,8 @@ .global _RegService .global _SetMouseData + .global _SetKeyboardData + .global _SetScreen .global _SysMsgBoardStr @@ -70,6 +73,7 @@ .def _GetPgAddr; .scl 2; .type 32; .endef .def _GetService; .scl 2; .type 32; .endef .def _GetTimerTicks; .scl 2; .type 32; .endef + .def _GetStackBase; .scl 2; .type 32; .endef .def _KernelAlloc; .scl 2; .type 32; .endef .def _KernelFree; .scl 2; .type 32; .endef @@ -94,6 +98,7 @@ .def _SetScreen; .scl 2; .type 32; .endef .def _SetMouseData; .scl 2; .type 32; .endef + .def _SetKeyboardData; .scl 2; .type 32; .endef .def _SysMsgBoardStr; .scl 2; .type 32; .endef .def _WaitEvent; .scl 2; .type 32; .endef @@ -120,6 +125,7 @@ _GetEvent: _GetPgAddr: _GetService: _GetTimerTicks: +_GetStackBase: _KernelAlloc: _KernelFree: @@ -142,6 +148,8 @@ _RaiseEvent: _RegService: _SetMouseData: +_SetKeyboardData: + _SetScreen: _SysMsgBoardStr: @@ -171,6 +179,8 @@ _WaitEvent: .ascii " -export:GetPgAddr" # stdcall .ascii " -export:GetService" # stdcall .ascii " -export:GetTimerTicks" # + .ascii " -export:GetStackBase" # + .ascii " -export:KernelAlloc" # stdcall .ascii " -export:KernelFree" # stdcall @@ -194,6 +204,8 @@ _WaitEvent: .ascii " -export:RegService" # stdcall .ascii " -export:SetMouseData" # stdcall + .ascii " -export:SetKeyboardData" # stdcall + .ascii " -export:SetScreen" # stdcall .ascii " -export:SysMsgBoardStr" # stdcall diff --git a/drivers/include/syscall.h b/drivers/include/syscall.h index 7e34846f44..45b7c781db 100644 --- a/drivers/include/syscall.h +++ b/drivers/include/syscall.h @@ -18,6 +18,8 @@ #define CreateObject __CreateObject #define DestroyObject __DestroyObject +#define _alloca(x) __builtin_alloca((x)) + /////////////////////////////////////////////////////////////////////////////// @@ -46,11 +48,16 @@ void FASTCALL MutexInit(struct mutex*)__asm__("MutexInit"); void FASTCALL MutexLock(struct mutex*)__asm__("MutexLock"); void FASTCALL MutexUnlock(struct mutex*)__asm__("MutexUnlock"); +addr_t IMPORT GetStackBase(void)__asm__("GetStackBase"); + /////////////////////////////////////////////////////////////////////////////// void STDCALL SetMouseData(int btn, int x, int y, int z, int h)__asm__("SetMouseData"); +void FASTCALL SetKeyboardData(u32_t data)__asm__("SetKeyboardData"); + + u8_t STDCALL PciRead8 (u32_t bus, u32_t devfn, u32_t reg)__asm__("PciRead8"); u16_t STDCALL PciRead16(u32_t bus, u32_t devfn, u32_t reg)__asm__("PciRead16"); u32_t STDCALL PciRead32(u32_t bus, u32_t devfn, u32_t reg)__asm__("PciRead32");