From 137b1fee0839f892d24dd5e35cfa7079d0138627 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Wed, 10 Nov 2010 05:17:31 +0000 Subject: [PATCH] geode: DEV_GET_POS call done right git-svn-id: svn://kolibrios.org@1695 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/audio/a5536/geode.c | 9 ++++++++- drivers/audio/a5536/geode.lk | 23 ----------------------- drivers/audio/a5536/makefile | 2 +- 3 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 drivers/audio/a5536/geode.lk diff --git a/drivers/audio/a5536/geode.c b/drivers/audio/a5536/geode.c index ff145cc77b..e881eb1960 100644 --- a/drivers/audio/a5536/geode.c +++ b/drivers/audio/a5536/geode.c @@ -48,6 +48,7 @@ typedef struct int CurrentPowerState; addr_t buffer; + addr_t buffer_dma; addr_t prd_dma; addr_t irq_line; @@ -245,6 +246,7 @@ Bool init_device() addr_t buffer = geode.buffer; addr_t dma = GetPgAddr(geode.buffer); + geode.buffer_dma = dma; geode.prd_dma = (((addr_t)prd_tab) & 4095) + GetPgAddr((void*)prd_tab); @@ -478,6 +480,8 @@ u32_t drvEntry(int action, char *cmdline) return 0; } + printf("AMD Geode CS5536 audio driver\n"); + if( FindPciDevice() == FALSE) { dbgprintf("Device not found\n"); @@ -545,7 +549,10 @@ int __stdcall srv_sound(ioctl_t *io) case DEV_GET_POS: if(io->out_size==4) { - *outp = ctrl_read_32(0x60)>>2; + u32_t dma; + dma = ctrl_read_32(0x60); + dma-= geode.buffer_dma; + *outp = (dma & 16383)>>2; return 0; } break; diff --git a/drivers/audio/a5536/geode.lk b/drivers/audio/a5536/geode.lk deleted file mode 100644 index 022016e891..0000000000 --- a/drivers/audio/a5536/geode.lk +++ /dev/null @@ -1,23 +0,0 @@ -IMP - _KernelAlloc core.KernelAlloc, - _KernelFree core.KernelFree, - _CommitPages core.CommitPages, - _MapIoMem core.MapIoMem, - _GetPgAddr core.GetPgAddr, - _CreateRingBuffer core.CreateRingBuffer, - _PciApi core.PciApi, - _PciRead8 core.PciRead8, - _PciRead16 core.PciRead16, - _PciRead32 core.PciRead32, - _PciWrite8 core.PciWrite8, - _PciWrite16 core.PciWrite16, - _PciWrite32 core.PciWrite32, - _RegService core.RegService, - _AttachIntHandler core.AttachIntHandler, - _SysMsgBoardStr core.SysMsgBoardStr, - _Delay core.Delay - - -FIL geode.obj, - vsprintf.obj, - icompute.obj diff --git a/drivers/audio/a5536/makefile b/drivers/audio/a5536/makefile index 668f381264..41a2fcaa60 100644 --- a/drivers/audio/a5536/makefile +++ b/drivers/audio/a5536/makefile @@ -2,7 +2,7 @@ CC = gcc FASM = e:/fasm/fasm.exe CFLAGS = -c -O2 -fomit-frame-pointer -fno-builtin-printf -LDFLAGS = -nostdlib -shared -s -Map usb.map --image-base 0\ +LDFLAGS = -nostdlib -shared -s -Map geode.map --image-base 0\ --file-alignment 512 --section-alignment 4096 DEFINES = -D__KERNEL__ -DCONFIG_X86_32