cmedia: update to newer spinlock API.

This commit is contained in:
Augustin Cavalier
2015-06-28 14:32:57 -04:00
parent 37248a2fff
commit 8306064d44
3 changed files with 72 additions and 80 deletions
@@ -9,9 +9,7 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#if !defined(_KERNEL_EXPORT_H)
#include <KernelExport.h> #include <KernelExport.h>
#endif
#if DEBUG #if DEBUG
@@ -6,13 +6,10 @@
#if !defined(_CM_PRIVATE_H) #if !defined(_CM_PRIVATE_H)
#define _CM_PRIVATE_H #define _CM_PRIVATE_H
#if !defined(_CMEDIA_PCI_H)
#include "cmedia_pci.h" #include "cmedia_pci.h"
#endif
#if !defined(_PCI_H) #include <KernelExport.h>
#include <PCI.h> #include <PCI.h>
#endif
#if !defined(DEBUG) #if !defined(DEBUG)
#define DEBUG 0 #define DEBUG 0
@@ -89,7 +86,7 @@ typedef struct
/* playback from a cyclic, small-ish buffer */ /* playback from a cyclic, small-ish buffer */
int32 wr_lock; spinlock wr_lock;
int dma_a; int dma_a;
vuchar * wr_1; vuchar * wr_1;
vuchar * wr_2; vuchar * wr_2;
@@ -108,7 +105,7 @@ typedef struct
/* recording into a cyclic, somewhat larger buffer */ /* recording into a cyclic, somewhat larger buffer */
int32 rd_lock; spinlock rd_lock;
int dma_c; int dma_c;
vuchar * rd_1; vuchar * rd_1;
vuchar * rd_2; vuchar * rd_2;
@@ -150,7 +147,7 @@ typedef struct
typedef struct _cmedia_pci_dev typedef struct _cmedia_pci_dev
{ {
char name[DEVNAME]; /* used for resources */ char name[DEVNAME]; /* used for resources */
int32 hardware; /* spinlock */ spinlock hardware;
int enhanced; /* offset to port */ int enhanced; /* offset to port */
int32 inth_count; int32 inth_count;
int dma_base; int dma_base;
@@ -10,9 +10,7 @@
#include "cm_private.h" #include "cm_private.h"
#include "sound.h" #include "sound.h"
#if !defined(_KERNEL_EXPORT_H)
#include <KernelExport.h> #include <KernelExport.h>
#endif /* _KERNEL_EXPORT_H */
extern int sprintf(char *, const char *, ...); extern int sprintf(char *, const char *, ...);
@@ -499,8 +497,7 @@ gotit:
port->config.rec_buf_size *= 2; port->config.rec_buf_size *= 2;
/* playback */ /* playback */
B_INITIALIZE_SPINLOCK(&port->wr_lock);
port->wr_lock = 0;
port->dma_a = cards[ix].dma_base; port->dma_a = cards[ix].dma_base;
port->wr_1 = cards[ix].low_mem; port->wr_1 = cards[ix].low_mem;
port->wr_2 = cards[ix].low_mem+port->config.play_buf_size/2; port->wr_2 = cards[ix].low_mem+port->config.play_buf_size/2;
@@ -535,7 +532,7 @@ gotit:
/* recording */ /* recording */
port->rd_lock = 0; B_INITIALIZE_SPINLOCK(&port->rd_lock);
port->dma_c = cards[ix].dma_base+0x08; port->dma_c = cards[ix].dma_base+0x08;
port->rd_1 = cards[ix].low_mem+port->config.play_buf_size; port->rd_1 = cards[ix].low_mem+port->config.play_buf_size;
port->rd_2 = cards[ix].low_mem+port->config.play_buf_size+port->config.rec_buf_size/2; port->rd_2 = cards[ix].low_mem+port->config.play_buf_size+port->config.rec_buf_size/2;