From c6a90cef0fe9338c596382b3249b2a33341b4b6e Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Tue, 11 Oct 2016 22:54:59 +0000 Subject: [PATCH] ddk: update git-svn-id: svn://kolibrios.org@6587 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ddk/Makefile | 1 + drivers/ddk/debug/dbglog.c | 27 --------------------------- drivers/ddk/linux/div64.c | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 27 deletions(-) create mode 100644 drivers/ddk/linux/div64.c diff --git a/drivers/ddk/Makefile b/drivers/ddk/Makefile index 64a1a15932..349533f044 100644 --- a/drivers/ddk/Makefile +++ b/drivers/ddk/Makefile @@ -33,6 +33,7 @@ NAME_SRCS:= \ io/write.c \ linux/bitmap.c \ linux/ctype.c \ + linux/div64.c \ linux/dmapool.c \ linux/dmi.c \ linux/fbsysfs.c \ diff --git a/drivers/ddk/debug/dbglog.c b/drivers/ddk/debug/dbglog.c index 66687792e4..113d038d03 100644 --- a/drivers/ddk/debug/dbglog.c +++ b/drivers/ddk/debug/dbglog.c @@ -150,31 +150,4 @@ int dbgprintf(const char* format, ...) return len; } -int xf86DrvMsg(int skip, int code, const char* format, ...) -{ - char txtbuf[1024]; - unsigned writes; - va_list ap; - - int len = 0; - - va_start(ap, format); - if (format) - len = vsnprintf(txtbuf, 1024, format, ap); - va_end(ap); - - if( len ) - { - SysMsgBoardStr(txtbuf); - - if(dbgfile.path) - { - write_file(dbgfile.path,txtbuf,dbgfile.offset,len,&writes); - dbgfile.offset+=writes; - }; - }; - return len; -} - - diff --git a/drivers/ddk/linux/div64.c b/drivers/ddk/linux/div64.c new file mode 100644 index 0000000000..c9d67f8e2c --- /dev/null +++ b/drivers/ddk/linux/div64.c @@ -0,0 +1,21 @@ +#include +#include +#include + +s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) +{ + u64 quotient; + + if (dividend < 0) { + quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); + *remainder = -*remainder; + if (divisor > 0) + quotient = -quotient; + } else { + quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); + if (divisor < 0) + quotient = -quotient; + } + return quotient; +} +