From 875283e594dedcad5fde1f8bd119e9ec0fccf578 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Sun, 5 Sep 2010 14:31:18 +0000 Subject: [PATCH] 1) import AttachIntHandler 2) skip log if interrupts masked git-svn-id: svn://kolibrios.org@1604 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ddk/core.S | 8 ++++++++ drivers/ddk/debug/dbglog.c | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/ddk/core.S b/drivers/ddk/core.S index 3c5bb03dad..3f97feadcb 100644 --- a/drivers/ddk/core.S +++ b/drivers/ddk/core.S @@ -7,6 +7,8 @@ .global _AllocPage .global _AllocPages + .global _AttachIntHandler + .global _CreateRingBuffer .global _Delay .global _DestroyObject @@ -44,6 +46,8 @@ .def _AllocPage; .scl 2; .type 32; .endef .def _AllocPages; .scl 2; .type 32; .endef + .def _AttachIntHandler; .scl 2; .type 32; .endef + .def _CreateRingBuffer; .scl 2; .type 32; .endef .def _Delay; .scl 2; .type 32; .endef @@ -82,6 +86,8 @@ _AllocPage: _AllocPages: +_AttachIntHandler: + _CreateRingBuffer: _Delay: @@ -123,6 +129,8 @@ _SysMsgBoardStr: .ascii " -export:AllocPage" # gcc ABI .ascii " -export:AllocPages" # gcc ABI + .ascii " -export:AttachIntHandler" # stdcall + .ascii " -export:CreateRingBuffer" # stdcall .ascii " -export:Delay" # stdcall diff --git a/drivers/ddk/debug/dbglog.c b/drivers/ddk/debug/dbglog.c index 8ff334272e..5785940799 100644 --- a/drivers/ddk/debug/dbglog.c +++ b/drivers/ddk/debug/dbglog.c @@ -99,6 +99,7 @@ int dbg_open(char *path) int vsnprintf(char *s, size_t n, const char *format, va_list arg); + int printf(const char* format, ...) { char txtbuf[256]; @@ -135,7 +136,9 @@ int dbgprintf(const char* format, ...) { SysMsgBoardStr(txtbuf); - if(dbgfile.path) +/* do not write into log file if interrupts disabled */ + + if ( (get_eflags() & (1 << 9)) && dbgfile.path) { write_file(dbgfile.path,txtbuf,dbgfile.offset,len,&writes); dbgfile.offset+=writes;