* whitespace cleanup and some style fixes

* fixes TODO about using phys_addr_t instead of void*


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37015 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2010-06-04 23:04:09 +00:00
parent 521aff921f
commit 77ba3b5259
4 changed files with 152 additions and 153 deletions
@@ -160,9 +160,9 @@ auich_stream_set_audioparms(auich_stream *stream, uint8 channels,
uint8 sample_size, frame_size; uint8 sample_size, frame_size;
LOG(("auich_stream_set_audioparms\n")); LOG(("auich_stream_set_audioparms\n"));
if ((stream->channels == channels) && if ((stream->channels == channels)
(stream->b16 == b16) && && (stream->b16 == b16)
(stream->sample_rate == sample_rate)) && (stream->sample_rate == sample_rate))
return B_OK; return B_OK;
if (stream->buffer) if (stream->buffer)
@@ -211,8 +211,8 @@ auich_stream_commit_parms(auich_stream *stream)
page = stream->dmaops_log_base; page = stream->dmaops_log_base;
for (i = 0; i < AUICH_DMALIST_MAX; i++) { for (i = 0; i < AUICH_DMALIST_MAX; i++) {
page[2*i] = ((uint32)stream->buffer->phy_base) + page[2*i] = ((uint32)stream->buffer->phy_base)
(i % stream->bufcount) * stream->blksize; + (i % stream->bufcount) * stream->blksize;
page[2*i + 1] = AUICH_DMAF_IOC | (stream->blksize page[2*i + 1] = AUICH_DMAF_IOC | (stream->blksize
/ (IS_SIS7012(&stream->card->config) ? 1 : 2)); / (IS_SIS7012(&stream->card->config) ? 1 : 2));
} }
@@ -495,14 +495,14 @@ map_io_memory(device_config *config)
if ((config->type & TYPE_ICH4) == 0) if ((config->type & TYPE_ICH4) == 0)
return B_OK; return B_OK;
config->area_mmbar = map_mem(&config->log_mmbar, (void *)config->mmbar, ICH4_MMBAR_SIZE, "auich mmbar io"); config->area_mmbar = map_mem(&config->log_mmbar, config->mmbar, ICH4_MMBAR_SIZE, "auich mmbar io");
if (config->area_mmbar <= B_OK) { if (config->area_mmbar <= B_OK) {
LOG(("mapping of mmbar io failed, error = %#x\n",config->area_mmbar)); LOG(("mapping of mmbar io failed, error = %#x\n",config->area_mmbar));
return B_ERROR; return B_ERROR;
} }
LOG(("mapping of mmbar: area %#x, phys %#x, log %#x\n", config->area_mmbar, config->mmbar, config->log_mmbar)); LOG(("mapping of mmbar: area %#x, phys %#x, log %#x\n", config->area_mmbar, config->mmbar, config->log_mmbar));
config->area_mbbar = map_mem(&config->log_mbbar, (void *)config->mbbar, ICH4_MBBAR_SIZE, "auich mbbar io"); config->area_mbbar = map_mem(&config->log_mbbar, config->mbbar, ICH4_MBBAR_SIZE, "auich mbbar io");
if (config->area_mbbar <= B_OK) { if (config->area_mbbar <= B_OK) {
LOG(("mapping of mbbar io failed, error = %#x\n",config->area_mbbar)); LOG(("mapping of mbbar io failed, error = %#x\n",config->area_mbbar));
delete_area(config->area_mmbar); delete_area(config->area_mmbar);
@@ -753,8 +753,8 @@ init_driver(void)
return ENOSYS; return ENOSYS;
while ((*pci->get_nth_pci_info)(ix++, &info) == B_OK) { while ((*pci->get_nth_pci_info)(ix++, &info) == B_OK) {
if ((info.vendor_id == INTEL_VENDOR_ID && if ((info.vendor_id == INTEL_VENDOR_ID
(info.device_id == INTEL_82443MX_AC97_DEVICE_ID && (info.device_id == INTEL_82443MX_AC97_DEVICE_ID
|| info.device_id == INTEL_82801AA_AC97_DEVICE_ID || info.device_id == INTEL_82801AA_AC97_DEVICE_ID
|| info.device_id == INTEL_82801AB_AC97_DEVICE_ID || info.device_id == INTEL_82801AB_AC97_DEVICE_ID
|| info.device_id == INTEL_82801BA_AC97_DEVICE_ID || info.device_id == INTEL_82801BA_AC97_DEVICE_ID
@@ -765,11 +765,11 @@ init_driver(void)
|| info.device_id == INTEL_82801GB_AC97_DEVICE_ID || info.device_id == INTEL_82801GB_AC97_DEVICE_ID
|| info.device_id == INTEL_6300ESB_AC97_DEVICE_ID || info.device_id == INTEL_6300ESB_AC97_DEVICE_ID
)) ))
|| (info.vendor_id == SIS_VENDOR_ID && || (info.vendor_id == SIS_VENDOR_ID
(info.device_id == SIS_SI7012_AC97_DEVICE_ID && (info.device_id == SIS_SI7012_AC97_DEVICE_ID
)) ))
|| (info.vendor_id == NVIDIA_VENDOR_ID && || (info.vendor_id == NVIDIA_VENDOR_ID
(info.device_id == NVIDIA_nForce_AC97_DEVICE_ID && (info.device_id == NVIDIA_nForce_AC97_DEVICE_ID
|| info.device_id == NVIDIA_nForce2_AC97_DEVICE_ID || info.device_id == NVIDIA_nForce2_AC97_DEVICE_ID
|| info.device_id == NVIDIA_nForce2_400_AC97_DEVICE_ID || info.device_id == NVIDIA_nForce2_400_AC97_DEVICE_ID
|| info.device_id == NVIDIA_nForce3_AC97_DEVICE_ID || info.device_id == NVIDIA_nForce3_AC97_DEVICE_ID
@@ -778,8 +778,8 @@ init_driver(void)
|| info.device_id == NVIDIA_MCP51_AC97_DEVICE_ID || info.device_id == NVIDIA_MCP51_AC97_DEVICE_ID
|| info.device_id == NVIDIA_MCP04_AC97_DEVICE_ID || info.device_id == NVIDIA_MCP04_AC97_DEVICE_ID
)) ))
|| (info.vendor_id == AMD_VENDOR_ID && || (info.vendor_id == AMD_VENDOR_ID
(info.device_id == AMD_AMD8111_AC97_DEVICE_ID && (info.device_id == AMD_AMD8111_AC97_DEVICE_ID
|| info.device_id == AMD_AMD768_AC97_DEVICE_ID || info.device_id == AMD_AMD768_AC97_DEVICE_ID
)) ))
) { ) {
@@ -93,7 +93,7 @@ typedef struct _auich_dmalist {
typedef struct _auich_mem { typedef struct _auich_mem {
LIST_ENTRY(_auich_mem) next; LIST_ENTRY(_auich_mem) next;
void *log_base; void *log_base;
void *phy_base; phys_addr_t phy_base;
area_id area; area_id area;
size_t size; size_t size;
} auich_mem; } auich_mem;
@@ -120,7 +120,7 @@ typedef struct _auich_stream {
void *inthparam; void *inthparam;
void *dmaops_log_base; void *dmaops_log_base;
void *dmaops_phy_base; phys_addr_t dmaops_phy_base;
area_id dmaops_area; area_id dmaops_area;
auich_mem *buffer; auich_mem *buffer;
@@ -64,9 +64,8 @@ round_to_pagesize(uint32 size)
area_id area_id
alloc_mem(void **phy, void **log, size_t size, const char *name) alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
{ {
// TODO: phy should be phys_addr_t*!
physical_entry pe; physical_entry pe;
void * logadr; void * logadr;
area_id area; area_id area;
@@ -91,7 +90,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
if (log) if (log)
*log = logadr; *log = logadr;
if (phy) if (phy)
*phy = (void*)(addr_t)pe.address; *phy = pe.address;
LOG(("area = %d, size = %d, log = %#08X, phy = %#08X\n", area, size, logadr, LOG(("area = %d, size = %d, log = %#08X, phy = %#08X\n", area, size, logadr,
pe.address)); pe.address));
return area; return area;
@@ -99,10 +98,10 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
area_id area_id
map_mem(void **log, void *phy, size_t size, const char *name) map_mem(void **log, phys_addr_t phy, size_t size, const char *name)
{ {
uint32 offset; uint32 offset;
void *phyadr; phys_addr_t phyadr;
void *mapadr; void *mapadr;
area_id area; area_id area;
@@ -111,7 +110,7 @@ map_mem(void **log, void *phy, size_t size, const char *name)
offset = (uint32)phy & (B_PAGE_SIZE - 1); offset = (uint32)phy & (B_PAGE_SIZE - 1);
phyadr = phy - offset; phyadr = phy - offset;
size = round_to_pagesize(size + offset); size = round_to_pagesize(size + offset);
area = map_physical_memory(name, (addr_t)phyadr, size, B_ANY_KERNEL_ADDRESS, area = map_physical_memory(name, phyadr, size, B_ANY_KERNEL_ADDRESS,
0, &mapadr); 0, &mapadr);
*log = mapadr + offset; *log = mapadr + offset;
@@ -30,8 +30,8 @@
#include <KernelExport.h> #include <KernelExport.h>
area_id alloc_mem(void **phy, void **log, size_t size, const char *name); area_id alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name);
area_id map_mem(void **log, void *phy, size_t size, const char *name); area_id map_mem(void **log, phys_addr_t phy, size_t size, const char *name);
cpu_status lock(void); cpu_status lock(void);
void unlock(cpu_status status); void unlock(cpu_status status);