* 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@37013 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e43d37db09
commit
ac0b32534b
@ -198,9 +198,9 @@ echo_stream_set_audioparms(echo_stream *stream, uint8 channels,
|
||||
if (bitsPerSample == 24)
|
||||
bitsPerSample = 32;
|
||||
|
||||
if ((stream->channels == channels) &&
|
||||
(stream->bitsPerSample == bitsPerSample) &&
|
||||
(stream->sample_rate == sample_rate))
|
||||
if ((stream->channels == channels)
|
||||
&& (stream->bitsPerSample == bitsPerSample)
|
||||
&& (stream->sample_rate == sample_rate))
|
||||
return B_OK;
|
||||
|
||||
format_params.wBitsPerSample = bitsPerSample;
|
||||
@ -479,11 +479,11 @@ init_hardware(void)
|
||||
|
||||
ushort card_type = info.u.h0.subsystem_id & 0xfff0;
|
||||
|
||||
if (info.vendor_id == VENDOR_ID &&
|
||||
((info.device_id == DEVICE_ID_56301)
|
||||
|| (info.device_id == DEVICE_ID_56361)) &&
|
||||
(info.u.h0.subsystem_vendor_id == SUBVENDOR_ID) &&
|
||||
(
|
||||
if (info.vendor_id == VENDOR_ID
|
||||
&& ((info.device_id == DEVICE_ID_56301)
|
||||
|| (info.device_id == DEVICE_ID_56361))
|
||||
&& (info.u.h0.subsystem_vendor_id == SUBVENDOR_ID)
|
||||
&& (
|
||||
#ifdef ECHOGALS_FAMILY
|
||||
(card_type == DARLA)
|
||||
|| (card_type == GINA)
|
||||
@ -557,11 +557,11 @@ init_driver(void)
|
||||
while ((*pci->get_nth_pci_info)(ix++, &info) == B_OK) {
|
||||
ushort card_type = info.u.h0.subsystem_id & 0xfff0;
|
||||
|
||||
if (info.vendor_id == VENDOR_ID &&
|
||||
((info.device_id == DEVICE_ID_56301)
|
||||
|| (info.device_id == DEVICE_ID_56361)) &&
|
||||
(info.u.h0.subsystem_vendor_id == SUBVENDOR_ID) &&
|
||||
(
|
||||
if (info.vendor_id == VENDOR_ID
|
||||
&& ((info.device_id == DEVICE_ID_56301)
|
||||
|| (info.device_id == DEVICE_ID_56361))
|
||||
&& (info.u.h0.subsystem_vendor_id == SUBVENDOR_ID)
|
||||
&& (
|
||||
#ifdef ECHOGALS_FAMILY
|
||||
(card_type == DARLA)
|
||||
|| (card_type == GINA)
|
||||
@ -730,7 +730,7 @@ echo_setup(echo_dev * card)
|
||||
card->bmbar = card->info.u.h0.base_registers[0];
|
||||
card->irq = card->info.u.h0.interrupt_line;
|
||||
|
||||
card->area_bmbar = map_mem(&card->log_bmbar, (void *)card->bmbar,
|
||||
card->area_bmbar = map_mem(&card->log_bmbar, card->bmbar,
|
||||
card->info.u.h0.base_register_sizes[0], DRIVER_NAME" bmbar io");
|
||||
if (card->area_bmbar <= B_OK) {
|
||||
LOG(("mapping of bmbar io failed, error = %#x\n",card->area_bmbar));
|
||||
|
@ -106,7 +106,7 @@ typedef struct _echo_dev {
|
||||
PCOsSupport pOSS;
|
||||
|
||||
void *ptb_log_base;
|
||||
void *ptb_phy_base;
|
||||
phys_addr_t ptb_phy_base;
|
||||
area_id ptb_area;
|
||||
|
||||
sem_id buffer_ready_sem;
|
||||
|
@ -117,7 +117,7 @@ typedef unsigned long ECHOSTATUS;
|
||||
typedef struct _echo_mem {
|
||||
LIST_ENTRY(_echo_mem) next;
|
||||
void *log_base;
|
||||
void *phy_base;
|
||||
phys_addr_t phy_base;
|
||||
area_id area;
|
||||
size_t size;
|
||||
} echo_mem;
|
||||
@ -130,8 +130,8 @@ typedef struct _echo_mem {
|
||||
//
|
||||
// Define what a physical address is on this OS
|
||||
//
|
||||
typedef unsigned long PHYS_ADDR; // Define physical addr type
|
||||
typedef unsigned long* PPHYS_ADDR; // Define physical addr pointer type
|
||||
typedef phys_addr_t PHYS_ADDR; // Define physical addr type
|
||||
typedef phys_addr_t* PPHYS_ADDR; // Define physical addr pointer type
|
||||
|
||||
typedef echo_mem* PPAGE_BLOCK;
|
||||
|
||||
|
@ -64,9 +64,8 @@ round_to_pagesize(uint32 size)
|
||||
|
||||
|
||||
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;
|
||||
void * logadr;
|
||||
area_id area;
|
||||
@ -91,7 +90,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
||||
if (log)
|
||||
*log = logadr;
|
||||
if (phy)
|
||||
*phy = (void*)(addr_t)pe.address;
|
||||
*phy = pe.address;
|
||||
LOG(("area = %d, size = %d, log = %#08X, phy = %#08X\n", area, size, logadr,
|
||||
pe.address));
|
||||
return area;
|
||||
@ -99,19 +98,19 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
||||
|
||||
|
||||
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;
|
||||
void *phyadr;
|
||||
phys_addr_t phyadr;
|
||||
void *mapadr;
|
||||
area_id area;
|
||||
|
||||
LOG(("mapping physical address %p with %#x bytes for %s\n",phy,size,name));
|
||||
|
||||
offset = (uint32)phy & (B_PAGE_SIZE - 1);
|
||||
phyadr = (void*)((uint32)phy - offset);
|
||||
offset = phy & (B_PAGE_SIZE - 1);
|
||||
phyadr = phy - 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);
|
||||
*log = (void*) ((uint32)mapadr + offset);
|
||||
|
||||
|
@ -34,14 +34,14 @@ extern "C" {
|
||||
|
||||
#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);
|
||||
|
||||
cpu_status lock(void);
|
||||
void unlock(cpu_status status);
|
||||
|
||||
extern spinlock slock;
|
||||
|
||||
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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user