diff --git a/linux-core/xgi_drv.h b/linux-core/xgi_drv.h index 3cb6dc7f..360e7120 100644 --- a/linux-core/xgi_drv.h +++ b/linux-core/xgi_drv.h @@ -158,9 +158,9 @@ struct xgi_ioctl_post_vbios { }; enum xgi_mem_location { - NON_LOCAL = 0, - LOCAL = 1, - INVALID = 0x7fffffff + XGI_MEMLOC_NON_LOCAL = 0, + XGI_MEMLOC_LOCAL = 1, + XGI_MEMLOC_INVALID = 0x7fffffff }; enum PcieOwner { diff --git a/linux-core/xgi_fb.c b/linux-core/xgi_fb.c index 32fde5ab..d7e9285d 100644 --- a/linux-core/xgi_fb.c +++ b/linux-core/xgi_fb.c @@ -48,7 +48,7 @@ void xgi_fb_alloc(struct xgi_info * info, struct xgi_mem_pid *mempid_block; if (req->is_front) { - alloc->location = LOCAL; + alloc->location = XGI_MEMLOC_LOCAL; alloc->bus_addr = info->fb.base; alloc->hw_addr = 0; XGI_INFO @@ -59,7 +59,7 @@ void xgi_fb_alloc(struct xgi_info * info, xgi_up(info->fb_sem); if (block == NULL) { - alloc->location = LOCAL; + alloc->location = XGI_MEMLOC_LOCAL; alloc->size = 0; alloc->bus_addr = 0; alloc->hw_addr = 0; @@ -67,7 +67,7 @@ void xgi_fb_alloc(struct xgi_info * info, } else { XGI_INFO("Video RAM allocation succeeded: 0x%p\n", (char *)block->offset); - alloc->location = LOCAL; + alloc->location = XGI_MEMLOC_LOCAL; alloc->size = block->size; alloc->bus_addr = info->fb.base + block->offset; alloc->hw_addr = block->offset; @@ -75,7 +75,7 @@ void xgi_fb_alloc(struct xgi_info * info, /* manage mempid */ mempid_block = kmalloc(sizeof(struct xgi_mem_pid), GFP_KERNEL); - mempid_block->location = LOCAL; + mempid_block->location = XGI_MEMLOC_LOCAL; mempid_block->bus_addr = alloc->bus_addr; mempid_block->pid = alloc->pid; @@ -111,7 +111,7 @@ void xgi_fb_free(struct xgi_info * info, unsigned long bus_addr) /* manage mempid */ list_for_each_entry(mempid_block, &xgi_mempid_list, list) { - if (mempid_block->location == LOCAL + if (mempid_block->location == XGI_MEMLOC_LOCAL && mempid_block->bus_addr == bus_addr) { mempid_freeblock = mempid_block; break; diff --git a/linux-core/xgi_misc.c b/linux-core/xgi_misc.c index eecd717b..b7923228 100644 --- a/linux-core/xgi_misc.c +++ b/linux-core/xgi_misc.c @@ -578,7 +578,7 @@ void xgi_mem_collect(struct xgi_info * info, unsigned int *pcnt) } } if (!find) { - if (block->location == LOCAL) { + if (block->location == XGI_MEMLOC_LOCAL) { XGI_INFO ("Memory ProcessID free fb and delete one block pid:%ld addr:0x%lx successfully! \n", block->pid, block->bus_addr); diff --git a/linux-core/xgi_pcie.c b/linux-core/xgi_pcie.c index e451ebd5..82111249 100644 --- a/linux-core/xgi_pcie.c +++ b/linux-core/xgi_pcie.c @@ -775,7 +775,7 @@ void xgi_pcie_alloc(struct xgi_info * info, unsigned long size, xgi_up(info->pcie_sem); if (block == NULL) { - alloc->location = INVALID; + alloc->location = XGI_MEMLOC_INVALID; alloc->size = 0; alloc->bus_addr = 0; alloc->hw_addr = 0; @@ -784,7 +784,7 @@ void xgi_pcie_alloc(struct xgi_info * info, unsigned long size, XGI_INFO ("PCIE RAM allocation succeeded: offset = 0x%lx, bus_addr = 0x%lx\n", block->offset, block->bus_addr); - alloc->location = NON_LOCAL; + alloc->location = XGI_MEMLOC_NON_LOCAL; alloc->size = block->size; alloc->bus_addr = block->bus_addr; alloc->hw_addr = block->hw_addr; @@ -799,7 +799,7 @@ void xgi_pcie_alloc(struct xgi_info * info, unsigned long size, kmalloc(sizeof(struct xgi_mem_pid), GFP_KERNEL); if (!mempid_block) XGI_ERROR("mempid_block alloc failed\n"); - mempid_block->location = NON_LOCAL; + mempid_block->location = XGI_MEMLOC_NON_LOCAL; if (owner == PCIE_3D) mempid_block->bus_addr = 0xFFFFFFFF; /*xgi_pcie_vertex_block has the address */ else @@ -832,7 +832,7 @@ void xgi_pcie_free(struct xgi_info * info, unsigned long bus_addr) processcnt = 0; list_for_each_entry(mempid_block, &xgi_mempid_list, list) { - if (mempid_block->location == NON_LOCAL + if (mempid_block->location == XGI_MEMLOC_NON_LOCAL && mempid_block->bus_addr == 0xFFFFFFFF) { ++processcnt; } @@ -855,7 +855,7 @@ void xgi_pcie_free(struct xgi_info * info, unsigned long bus_addr) /* manage mempid */ list_for_each_entry(mempid_block, &xgi_mempid_list, list) { - if (mempid_block->location == NON_LOCAL + if (mempid_block->location == XGI_MEMLOC_NON_LOCAL && ((isvertex && mempid_block->bus_addr == 0xFFFFFFFF) || (!isvertex && mempid_block->bus_addr == bus_addr))) { mempid_freeblock = mempid_block;