diff --git a/drivers/ddk/Makefile b/drivers/ddk/Makefile index 64a1a1593..349533f04 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 66687792e..113d038d0 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 000000000..c9d67f8e2 --- /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; +} +