#define __NO_VERSION__
#include <linux/config.h>
#include "drmP.h"
-#include <linux/wrapper.h>
/* Cut down version of drm_memory_debug.h, which used to be called
* drm_memory.h. If you want the debug functionality, change 0 to 1
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_reserve(virt_to_page(addr));
+ SetPageReserved(virt_to_page(addr));
}
return address;
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_unreserve(virt_to_page(addr));
+ ClearPageReserved(virt_to_page(addr));
}
free_pages(address, order);
#define __NO_VERSION__
#include <linux/config.h>
#include "drmP.h"
-#include <linux/wrapper.h>
typedef struct drm_mem_stats {
const char *name;
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_reserve(virt_to_page(addr));
+ SetPageReserved(virt_to_page(addr));
}
return address;
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_unreserve(virt_to_page(addr));
+ ClearPageReserved(virt_to_page(addr));
}
free_pages(address, order);
}
current->state = TASK_INTERRUPTIBLE; \
if (condition) \
break; \
- if((signed)(end - jiffies) <= 0) { \
+ if (time_after_eq(jiffies, end)) { \
ret = -EBUSY; \
break; \
} \
{
drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = dev->dev_private;
- u32 *temp = (u32 *)dev_priv->hw_status_page;
+ u32 *temp = dev_priv->hw_status_page;
int i;
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
dev_priv->ring.Size);
}
- if(dev_priv->hw_status_page != 0UL) {
+ if (dev_priv->hw_status_page) {
pci_free_consistent(dev->pdev, PAGE_SIZE,
- (void *)dev_priv->hw_status_page,
+ dev_priv->hw_status_page,
dev_priv->dma_status_page);
/* Need to rewrite hardware status page */
I810_WRITE(0x02080, 0x1ffff000);
/* Program Hardware Status Page */
dev_priv->hw_status_page =
- (unsigned long) pci_alloc_consistent(dev->pdev, PAGE_SIZE,
+ pci_alloc_consistent(dev->pdev, PAGE_SIZE,
&dev_priv->dma_status_page);
- if(dev_priv->hw_status_page == 0UL) {
+ if (!dev_priv->hw_status_page) {
dev->dev_private = (void *)dev_priv;
i810_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n");
return -ENOMEM;
}
- memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE);
- DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
+ memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
+ DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
I810_WRITE(0x02080, dev_priv->dma_status_page);
DRM_DEBUG("Enabled hardware status page\n");
drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
drm_i810_vertex_t vertex;
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
int retcode = 0;
drm_i810_dma_t d;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
drm_i810_mc_t mc;
drm_i810_sarea_t *sarea_priv;
drm_i810_ring_buffer_t ring;
- unsigned long hw_status_page;
+ void *hw_status_page;
unsigned long counter;
dma_addr_t dma_status_page;
#define up_write up
#endif
-#ifndef LockPage
-#define LockPage(page) set_bit(PG_locked, &(page)->flags)
-#endif
-#ifndef UnlockPage
-#define UnlockPage(page) unlock_page(page)
-#endif
-
-
static inline void i830_print_status_page(drm_device_t *dev)
{
drm_device_dma_t *dma = dev->dma;
drm_i830_private_t *dev_priv = dev->dev_private;
- u32 *temp = (u32 *)dev_priv->hw_status_page;
+ u32 *temp = dev_priv->hw_status_page;
int i;
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
buf->bus_address);
dev_priv->mmap_buffer = NULL;
filp->f_op = old_fops;
- if ((unsigned long)buf_priv->virtual > -1024UL) {
+ if (IS_ERR(buf_priv->virtual)) {
/* Real error */
DRM_ERROR("mmap error\n");
- retcode = (signed int)buf_priv->virtual;
+ retcode = PTR_ERR(buf_priv->virtual);
buf_priv->virtual = 0;
}
up_write( ¤t->mm->mmap_sem );
DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
dev_priv->ring.Size);
}
- if(dev_priv->hw_status_page != 0UL) {
+ if (dev_priv->hw_status_page) {
pci_free_consistent(dev->pdev, PAGE_SIZE,
- (void *)dev_priv->hw_status_page,
+ dev_priv->hw_status_page,
dev_priv->dma_status_page);
/* Need to rewrite hardware status page */
I830_WRITE(0x02080, 0x1ffff000);
/* Program Hardware Status Page */
dev_priv->hw_status_page =
- (unsigned long) pci_alloc_consistent(dev->pdev, PAGE_SIZE,
+ pci_alloc_consistent(dev->pdev, PAGE_SIZE,
&dev_priv->dma_status_page);
- if(dev_priv->hw_status_page == 0UL) {
+ if (!dev_priv->hw_status_page) {
dev->dev_private = (void *)dev_priv;
i830_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n");
return -ENOMEM;
}
- memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE);
- DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
+ memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
+ DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
I830_WRITE(0x02080, dev_priv->dma_status_page);
DRM_DEBUG("Enabled hardware status page\n");
drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv;
drm_i830_vertex_t vertex;
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv;
int retcode = 0;
drm_i830_dma_t d;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv;
drm_i830_sarea_t *sarea_priv;
drm_i830_ring_buffer_t ring;
- unsigned long hw_status_page;
+ void * hw_status_page;
unsigned long counter;
dma_addr_t dma_status_page;
#define __NO_VERSION__
#include <linux/config.h>
#include "drmP.h"
-#include <linux/wrapper.h>
/* Cut down version of drm_memory_debug.h, which used to be called
* drm_memory.h. If you want the debug functionality, change 0 to 1
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_reserve(virt_to_page(addr));
+ SetPageReserved(virt_to_page(addr));
}
return address;
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_unreserve(virt_to_page(addr));
+ ClearPageReserved(virt_to_page(addr));
}
free_pages(address, order);
#define __NO_VERSION__
#include <linux/config.h>
#include "drmP.h"
-#include <linux/wrapper.h>
typedef struct drm_mem_stats {
const char *name;
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_reserve(virt_to_page(addr));
+ SetPageReserved(virt_to_page(addr));
}
return address;
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
- mem_map_unreserve(virt_to_page(addr));
+ ClearPageReserved(virt_to_page(addr));
}
free_pages(address, order);
}
current->state = TASK_INTERRUPTIBLE; \
if (condition) \
break; \
- if((signed)(end - jiffies) <= 0) { \
+ if (time_after_eq(jiffies, end)) { \
ret = -EBUSY; \
break; \
} \
{
drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = dev->dev_private;
- u32 *temp = (u32 *)dev_priv->hw_status_page;
+ u32 *temp = dev_priv->hw_status_page;
int i;
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
dev_priv->ring.Size);
}
- if(dev_priv->hw_status_page != 0UL) {
+ if (dev_priv->hw_status_page) {
pci_free_consistent(dev->pdev, PAGE_SIZE,
- (void *)dev_priv->hw_status_page,
+ dev_priv->hw_status_page,
dev_priv->dma_status_page);
/* Need to rewrite hardware status page */
I810_WRITE(0x02080, 0x1ffff000);
/* Program Hardware Status Page */
dev_priv->hw_status_page =
- (unsigned long) pci_alloc_consistent(dev->pdev, PAGE_SIZE,
+ pci_alloc_consistent(dev->pdev, PAGE_SIZE,
&dev_priv->dma_status_page);
- if(dev_priv->hw_status_page == 0UL) {
+ if (!dev_priv->hw_status_page) {
dev->dev_private = (void *)dev_priv;
i810_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n");
return -ENOMEM;
}
- memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE);
- DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
+ memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
+ DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
I810_WRITE(0x02080, dev_priv->dma_status_page);
DRM_DEBUG("Enabled hardware status page\n");
drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
drm_i810_vertex_t vertex;
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
int retcode = 0;
drm_i810_dma_t d;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv;
drm_i810_mc_t mc;
drm_i810_sarea_t *sarea_priv;
drm_i810_ring_buffer_t ring;
- unsigned long hw_status_page;
+ void *hw_status_page;
unsigned long counter;
dma_addr_t dma_status_page;
#define up_write up
#endif
-#ifndef LockPage
-#define LockPage(page) set_bit(PG_locked, &(page)->flags)
-#endif
-#ifndef UnlockPage
-#define UnlockPage(page) unlock_page(page)
-#endif
-
-
static inline void i830_print_status_page(drm_device_t *dev)
{
drm_device_dma_t *dma = dev->dma;
drm_i830_private_t *dev_priv = dev->dev_private;
- u32 *temp = (u32 *)dev_priv->hw_status_page;
+ u32 *temp = dev_priv->hw_status_page;
int i;
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
buf->bus_address);
dev_priv->mmap_buffer = NULL;
filp->f_op = old_fops;
- if ((unsigned long)buf_priv->virtual > -1024UL) {
+ if (IS_ERR(buf_priv->virtual)) {
/* Real error */
DRM_ERROR("mmap error\n");
- retcode = (signed int)buf_priv->virtual;
+ retcode = PTR_ERR(buf_priv->virtual);
buf_priv->virtual = 0;
}
up_write( ¤t->mm->mmap_sem );
DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
dev_priv->ring.Size);
}
- if(dev_priv->hw_status_page != 0UL) {
+ if (dev_priv->hw_status_page) {
pci_free_consistent(dev->pdev, PAGE_SIZE,
- (void *)dev_priv->hw_status_page,
+ dev_priv->hw_status_page,
dev_priv->dma_status_page);
/* Need to rewrite hardware status page */
I830_WRITE(0x02080, 0x1ffff000);
/* Program Hardware Status Page */
dev_priv->hw_status_page =
- (unsigned long) pci_alloc_consistent(dev->pdev, PAGE_SIZE,
+ pci_alloc_consistent(dev->pdev, PAGE_SIZE,
&dev_priv->dma_status_page);
- if(dev_priv->hw_status_page == 0UL) {
+ if (!dev_priv->hw_status_page) {
dev->dev_private = (void *)dev_priv;
i830_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n");
return -ENOMEM;
}
- memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE);
- DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
+ memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
+ DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
I830_WRITE(0x02080, dev_priv->dma_status_page);
DRM_DEBUG("Enabled hardware status page\n");
drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv;
drm_i830_vertex_t vertex;
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv;
int retcode = 0;
drm_i830_dma_t d;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
- u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv;
drm_i830_sarea_t *sarea_priv;
drm_i830_ring_buffer_t ring;
- unsigned long hw_status_page;
+ void * hw_status_page;
unsigned long counter;
dma_addr_t dma_status_page;