radeon_hd: Pointer style cleanup, no functional change
This commit is contained in:
@@ -38,15 +38,15 @@
|
||||
|
||||
/* device hooks prototypes */
|
||||
|
||||
static status_t device_open(const char *name, uint32 flags, void **_cookie);
|
||||
static status_t device_close(void *data);
|
||||
static status_t device_free(void *data);
|
||||
static status_t device_ioctl(void *data, uint32 opcode,
|
||||
void *buffer, size_t length);
|
||||
static status_t device_read(void *data, off_t offset,
|
||||
void *buffer, size_t *length);
|
||||
static status_t device_write(void *data, off_t offset,
|
||||
const void *buffer, size_t *length);
|
||||
static status_t device_open(const char* name, uint32 flags, void** _cookie);
|
||||
static status_t device_close(void* data);
|
||||
static status_t device_free(void* data);
|
||||
static status_t device_ioctl(void* data, uint32 opcode,
|
||||
void* buffer, size_t length);
|
||||
static status_t device_read(void* data, off_t offset,
|
||||
void* buffer, size_t* length);
|
||||
static status_t device_write(void* data, off_t offset,
|
||||
const void* buffer, size_t* length);
|
||||
|
||||
|
||||
device_hooks gDeviceHooks = {
|
||||
@@ -65,7 +65,7 @@ device_hooks gDeviceHooks = {
|
||||
|
||||
#ifdef DEBUG_COMMANDS
|
||||
static int
|
||||
getset_register(int argc, char **argv)
|
||||
getset_register(int argc, char** argv)
|
||||
{
|
||||
if (argc < 2 || argc > 3) {
|
||||
kprintf("usage: %s <register> [set-to-value]\n", argv[0]);
|
||||
@@ -101,14 +101,14 @@ getset_register(int argc, char **argv)
|
||||
|
||||
|
||||
static status_t
|
||||
device_open(const char *name, uint32 /*flags*/, void **_cookie)
|
||||
device_open(const char* name, uint32 /*flags*/, void** _cookie)
|
||||
{
|
||||
TRACE("%s: open(name = %s)\n", __func__, name);
|
||||
int32 id;
|
||||
|
||||
// find accessed device
|
||||
{
|
||||
char *thisName;
|
||||
char* thisName;
|
||||
|
||||
// search for device name
|
||||
for (id = 0; (thisName = gDeviceNames[id]) != NULL; id++) {
|
||||
@@ -119,7 +119,7 @@ device_open(const char *name, uint32 /*flags*/, void **_cookie)
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
radeon_info *info = gDeviceInfo[id];
|
||||
radeon_info* info = gDeviceInfo[id];
|
||||
|
||||
mutex_lock(&gLock);
|
||||
|
||||
@@ -142,7 +142,7 @@ device_open(const char *name, uint32 /*flags*/, void **_cookie)
|
||||
|
||||
|
||||
static status_t
|
||||
device_close(void */*data*/)
|
||||
device_close(void* /*data*/)
|
||||
{
|
||||
TRACE("%s: close\n", __func__);
|
||||
return B_OK;
|
||||
@@ -150,9 +150,9 @@ device_close(void */*data*/)
|
||||
|
||||
|
||||
static status_t
|
||||
device_free(void *data)
|
||||
device_free(void* data)
|
||||
{
|
||||
struct radeon_info *info = (radeon_info *)data;
|
||||
struct radeon_info* info = (radeon_info*)data;
|
||||
|
||||
mutex_lock(&gLock);
|
||||
|
||||
@@ -167,20 +167,20 @@ device_free(void *data)
|
||||
|
||||
|
||||
static status_t
|
||||
device_ioctl(void *data, uint32 op, void *buffer, size_t bufferLength)
|
||||
device_ioctl(void* data, uint32 op, void* buffer, size_t bufferLength)
|
||||
{
|
||||
struct radeon_info *info = (radeon_info *)data;
|
||||
struct radeon_info* info = (radeon_info*)data;
|
||||
|
||||
switch (op) {
|
||||
case B_GET_ACCELERANT_SIGNATURE:
|
||||
strcpy((char *)buffer, RADEON_ACCELERANT_NAME);
|
||||
strcpy((char*)buffer, RADEON_ACCELERANT_NAME);
|
||||
TRACE("%s: accelerant: %s\n", __func__, RADEON_ACCELERANT_NAME);
|
||||
return B_OK;
|
||||
|
||||
// needed to share data between kernel and accelerant
|
||||
case RADEON_GET_PRIVATE_DATA:
|
||||
{
|
||||
radeon_get_private_data *data = (radeon_get_private_data *)buffer;
|
||||
radeon_get_private_data* data = (radeon_get_private_data*)buffer;
|
||||
|
||||
if (data->magic == RADEON_PRIVATE_DATA_MAGIC) {
|
||||
data->shared_info_area = info->shared_area;
|
||||
@@ -192,12 +192,12 @@ device_ioctl(void *data, uint32 op, void *buffer, size_t bufferLength)
|
||||
// needed for cloning
|
||||
case RADEON_GET_DEVICE_NAME:
|
||||
#ifdef __HAIKU__
|
||||
if (user_strlcpy((char *)buffer, gDeviceNames[info->id],
|
||||
if (user_strlcpy((char*)buffer, gDeviceNames[info->id],
|
||||
B_PATH_NAME_LENGTH) < B_OK)
|
||||
return B_BAD_ADDRESS;
|
||||
#else
|
||||
strncpy((char *)buffer, gDeviceNames[info->id], B_PATH_NAME_LENGTH);
|
||||
((char *)buffer)[B_PATH_NAME_LENGTH - 1] = '\0';
|
||||
strncpy((char*)buffer, gDeviceNames[info->id], B_PATH_NAME_LENGTH);
|
||||
((char*)buffer)[B_PATH_NAME_LENGTH - 1] = '\0';
|
||||
#endif
|
||||
return B_OK;
|
||||
|
||||
@@ -212,8 +212,8 @@ device_ioctl(void *data, uint32 op, void *buffer, size_t bufferLength)
|
||||
|
||||
|
||||
static status_t
|
||||
device_read(void */*data*/, off_t /*pos*/,
|
||||
void */*buffer*/, size_t *_length)
|
||||
device_read(void* /*data*/, off_t /*pos*/,
|
||||
void* /*buffer*/, size_t *_length)
|
||||
{
|
||||
*_length = 0;
|
||||
return B_NOT_ALLOWED;
|
||||
@@ -221,8 +221,8 @@ device_read(void */*data*/, off_t /*pos*/,
|
||||
|
||||
|
||||
static status_t
|
||||
device_write(void */*data*/, off_t /*pos*/,
|
||||
const void */*buffer*/, size_t *_length)
|
||||
device_write(void* /*data*/, off_t /*pos*/,
|
||||
const void* /*buffer*/, size_t* _length)
|
||||
{
|
||||
*_length = 0;
|
||||
return B_NOT_ALLOWED;
|
||||
|
||||
@@ -15,4 +15,5 @@
|
||||
/* The published PCI bus interface device hooks */
|
||||
extern device_hooks gDeviceHooks;
|
||||
|
||||
|
||||
#endif /* DEVICE_H */
|
||||
|
||||
@@ -273,7 +273,7 @@ mutex gLock;
|
||||
|
||||
|
||||
static status_t
|
||||
get_next_radeon_hd(int32 *_cookie, pci_info &info, uint32 &type)
|
||||
get_next_radeon_hd(int32* _cookie, pci_info &info, uint32 &type)
|
||||
{
|
||||
int32 index = *_cookie;
|
||||
|
||||
@@ -301,11 +301,11 @@ get_next_radeon_hd(int32 *_cookie, pci_info &info, uint32 &type)
|
||||
}
|
||||
|
||||
|
||||
extern "C" const char **
|
||||
extern "C" const char**
|
||||
publish_devices(void)
|
||||
{
|
||||
TRACE("%s\n", __func__);
|
||||
return (const char **)gDeviceNames;
|
||||
return (const char**)gDeviceNames;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ init_hardware(void)
|
||||
{
|
||||
TRACE("%s\n", __func__);
|
||||
|
||||
status_t status = get_module(B_PCI_MODULE_NAME, (module_info **)&gPCI);
|
||||
status_t status = get_module(B_PCI_MODULE_NAME, (module_info**)&gPCI);
|
||||
if (status != B_OK) {
|
||||
ERROR("%s: ERROR: pci module unavailable\n", __func__);
|
||||
return status;
|
||||
@@ -382,7 +382,7 @@ init_driver(void)
|
||||
gDeviceInfo[found]->init_status = B_NO_INIT;
|
||||
gDeviceInfo[found]->id = found;
|
||||
gDeviceInfo[found]->pci = info;
|
||||
gDeviceInfo[found]->registers = (uint8 *)info->u.h0.base_registers[0];
|
||||
gDeviceInfo[found]->registers = (uint8*)info->u.h0.base_registers[0];
|
||||
gDeviceInfo[found]->pciID = kSupportedDevices[type].pciID;
|
||||
gDeviceInfo[found]->deviceName = kSupportedDevices[type].deviceName;
|
||||
gDeviceInfo[found]->chipsetID = kSupportedDevices[type].chipsetID;
|
||||
|
||||
@@ -99,7 +99,7 @@ mapAtomBIOS(radeon_info &info, uint32 romBase, uint32 romSize)
|
||||
// attempt to access area specified
|
||||
area_id testArea = map_physical_memory("radeon hd rom probe",
|
||||
romBase, romSize, B_ANY_KERNEL_ADDRESS, B_READ_AREA,
|
||||
(void **)&rom);
|
||||
(void**)&rom);
|
||||
|
||||
if (testArea < 0) {
|
||||
ERROR("%s: couldn't map potential rom @ 0x%" B_PRIX32
|
||||
@@ -131,7 +131,7 @@ mapAtomBIOS(radeon_info &info, uint32 romBase, uint32 romSize)
|
||||
}
|
||||
|
||||
info.rom_area = create_area("radeon hd AtomBIOS",
|
||||
(void **)&info.atom_buffer, B_ANY_KERNEL_ADDRESS,
|
||||
(void**)&info.atom_buffer, B_ANY_KERNEL_ADDRESS,
|
||||
romSize, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
|
||||
|
||||
if (info.rom_area < 0) {
|
||||
@@ -576,7 +576,7 @@ radeon_hd_init(radeon_info &info)
|
||||
// *** Map shared info
|
||||
AreaKeeper sharedCreator;
|
||||
info.shared_area = sharedCreator.Create("radeon hd shared info",
|
||||
(void **)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
||||
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
||||
ROUND_TO_PAGE_SIZE(sizeof(radeon_shared_info)), B_FULL_LOCK, 0);
|
||||
if (info.shared_area < B_OK) {
|
||||
ERROR("%s: card (%ld): couldn't map shared area!\n",
|
||||
@@ -584,16 +584,16 @@ radeon_hd_init(radeon_info &info)
|
||||
return info.shared_area;
|
||||
}
|
||||
|
||||
memset((void *)info.shared_info, 0, sizeof(radeon_shared_info));
|
||||
memset((void*)info.shared_info, 0, sizeof(radeon_shared_info));
|
||||
sharedCreator.Detach();
|
||||
|
||||
// *** Map Memory mapped IO
|
||||
AreaKeeper mmioMapper;
|
||||
info.registers_area = mmioMapper.Map("radeon hd mmio",
|
||||
(void *)info.pci->u.h0.base_registers[PCI_BAR_MMIO],
|
||||
(void*)info.pci->u.h0.base_registers[PCI_BAR_MMIO],
|
||||
info.pci->u.h0.base_register_sizes[PCI_BAR_MMIO],
|
||||
B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
||||
(void **)&info.registers);
|
||||
(void**)&info.registers);
|
||||
if (mmioMapper.InitCheck() < B_OK) {
|
||||
ERROR("%s: card (%ld): couldn't map memory I/O!\n",
|
||||
__func__, info.id);
|
||||
@@ -663,10 +663,10 @@ radeon_hd_init(radeon_info &info)
|
||||
// *** Framebuffer mapping
|
||||
AreaKeeper frambufferMapper;
|
||||
info.framebuffer_area = frambufferMapper.Map("radeon hd frame buffer",
|
||||
(void *)info.pci->u.h0.base_registers[PCI_BAR_FB],
|
||||
(void*)info.pci->u.h0.base_registers[PCI_BAR_FB],
|
||||
info.shared_info->frame_buffer_size * 1024,
|
||||
B_ANY_KERNEL_ADDRESS, B_READ_AREA | B_WRITE_AREA,
|
||||
(void **)&info.shared_info->frame_buffer);
|
||||
(void**)&info.shared_info->frame_buffer);
|
||||
if (frambufferMapper.InitCheck() < B_OK) {
|
||||
ERROR("%s: card(%ld): couldn't map frame buffer!\n",
|
||||
__func__, info.id);
|
||||
|
||||
Reference in New Issue
Block a user