summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-03-27 17:44:13 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-03-27 17:44:13 +0000
commit6b9d819b8bcb1c0c17f40578151e34adc84133c9 (patch)
treee96487633480f0c596ac16b8e17676108454deae /sys
parent5fbb82136cabca7b1191a71052cafed4522a1654 (diff)
Remove a bunch of compat macros, just expand them to the openbsd
equivalent.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drmP.h16
-rw-r--r--sys/dev/pci/drm/drm_bufs.c5
-rw-r--r--sys/dev/pci/drm/drm_dma.c1
-rw-r--r--sys/dev/pci/drm/drm_drv.c2
-rw-r--r--sys/dev/pci/drm/drm_irq.c6
-rw-r--r--sys/dev/pci/drm/drm_memory.c2
-rw-r--r--sys/dev/pci/drm/i915_drv.c2
-rw-r--r--sys/dev/pci/drm/i915_irq.c2
-rw-r--r--sys/dev/pci/drm/mach64_state.c2
-rw-r--r--sys/dev/pci/drm/mga_irq.c2
-rw-r--r--sys/dev/pci/drm/radeon_irq.c2
11 files changed, 10 insertions, 32 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 580e05855a4..9f8a2ed7b57 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -78,37 +78,21 @@
#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
/* Internal types and structures */
-#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-#define DRM_MIN(a,b) ((a)<(b)?(a):(b))
-#define DRM_MAX(a,b) ((a)>(b)?(a):(b))
-
#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
#define __OS_HAS_AGP 1
-#define DRM_WAKEUP(w) wakeup((void *)w)
-
-#define DRM_CURPROC curproc
#define DRM_CURRENTPID curproc->p_pid
-#define DRM_NOOP do {} while(0)
#define DRM_SPINTYPE struct mutex
#define DRM_SPININIT(l,name) mtx_init(l,IPL_NONE)
-#define DRM_SPINUNINIT(l) DRM_NOOP
#define DRM_SPINLOCK(l) mtx_enter(l)
#define DRM_SPINUNLOCK(l) mtx_leave(l)
-#define DRM_SPINLOCK_IRQSAVE(l, irqflags) do { \
- DRM_SPINLOCK(l); \
- (void)irqflags; \
-} while (0)
-#define DRM_SPINUNLOCK_IRQRESTORE(u, irqflags) DRM_SPINUNLOCK(u)
-#define DRM_SPINLOCK_ASSERT(l) DRM_NOOP
#define DRM_LOCK() rw_enter_write(&dev->dev_lock)
#define DRM_UNLOCK() rw_exit_write(&dev->dev_lock)
#define DRM_MAXUNITS 8
/* Deal with netbsd code where only the print statements differ */
#define printk printf
-#define __unused /* nothing */
#define DRM_IRQ_ARGS void *arg
typedef int irqreturn_t;
diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c
index a77336a3c89..236ca48a5d4 100644
--- a/sys/dev/pci/drm/drm_bufs.c
+++ b/sys/dev/pci/drm/drm_bufs.c
@@ -897,7 +897,7 @@ drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
if (!vfinddev(file_priv->kdev, VCHR, &vn))
return EINVAL;
- vms = DRM_CURPROC->p_vmspace;
+ vms = curproc->p_vmspace;
DRM_SPINLOCK(&dev->dma_lock);
dev->buf_use++; /* Can't allocate more after this call */
@@ -927,7 +927,8 @@ drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
vaddr = round_page((vaddr_t)vms->vm_daddr + MAXDSIZ);
retcode = uvm_mmap(&vms->vm_map, &vaddr, size,
UVM_PROT_READ | UVM_PROT_WRITE, UVM_PROT_ALL, MAP_SHARED,
- (caddr_t)vn, foff, DRM_CURPROC->p_rlimit[RLIMIT_MEMLOCK].rlim_cur,DRM_CURPROC);
+ (caddr_t)vn, foff, curproc->p_rlimit[RLIMIT_MEMLOCK].rlim_cur,
+ curproc);
if (retcode) {
DRM_DEBUG("uvm_mmap failed\n");
goto done;
diff --git a/sys/dev/pci/drm/drm_dma.c b/sys/dev/pci/drm/drm_dma.c
index 2f527efcb5c..1e60bae4ea7 100644
--- a/sys/dev/pci/drm/drm_dma.c
+++ b/sys/dev/pci/drm/drm_dma.c
@@ -93,7 +93,6 @@ drm_dma_takedown(struct drm_device *dev)
drm_free(dma->pagelist);
drm_free(dev->dma);
dev->dma = NULL;
- DRM_SPINUNINIT(&dev->dma_lock);
}
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index 7e6a7821c40..48ddf17b0cf 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -843,7 +843,7 @@ drm_setversion(struct drm_device *dev, void *data, struct drm_file *file_priv)
return EINVAL;
}
if_version = DRM_IF_VERSION(ver.drm_di_major, ver.drm_dd_minor);
- dev->if_version = DRM_MAX(if_version, dev->if_version);
+ dev->if_version = imax(if_version, dev->if_version);
}
if (ver.drm_dd_major != -1) {
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c
index 12a99740caa..e6c9423a235 100644
--- a/sys/dev/pci/drm/drm_irq.c
+++ b/sys/dev/pci/drm/drm_irq.c
@@ -96,7 +96,6 @@ drm_irq_install(struct drm_device *dev)
err:
DRM_LOCK();
dev->irq_enabled = 0;
- DRM_SPINUNINIT(&dev->irq_lock);
DRM_UNLOCK();
return (ret);
}
@@ -118,9 +117,7 @@ drm_irq_uninstall(struct drm_device *dev)
dev->driver->irq_uninstall(dev);
- DRM_SPINUNINIT(&dev->irq_lock);
-
- return 0;
+ return (0);
}
int
@@ -182,7 +179,6 @@ drm_vblank_cleanup(struct drm_device *dev)
dev->vblank = NULL;
dev->num_crtcs = 0;
- DRM_SPINUNINIT(&dev->vbl_lock);
}
int
diff --git a/sys/dev/pci/drm/drm_memory.c b/sys/dev/pci/drm/drm_memory.c
index 031d23cda98..d2c905fa315 100644
--- a/sys/dev/pci/drm/drm_memory.c
+++ b/sys/dev/pci/drm/drm_memory.c
@@ -130,7 +130,7 @@ drm_mtrr_add(unsigned long offset, size_t size, int flags)
}
int
-drm_mtrr_del(int __unused handle, unsigned long offset, size_t size, int flags)
+drm_mtrr_del(int handle, unsigned long offset, size_t size, int flags)
{
#ifndef DRM_NO_MTRR
int act;
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 5b6c53e247b..75bde5862e0 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -189,8 +189,6 @@ inteldrm_detach(struct device *self, int flags)
if (dev_priv->regs != NULL)
vga_pci_bar_unmap(dev_priv->regs);
- DRM_SPINUNINIT(&dev_priv->user_irq_lock);
-
return (0);
}
diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c
index 0fbebf71413..71bc282cbd0 100644
--- a/sys/dev/pci/drm/i915_irq.c
+++ b/sys/dev/pci/drm/i915_irq.c
@@ -230,7 +230,7 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
if (iir & I915_USER_INTERRUPT) {
- DRM_WAKEUP(dev_priv);
+ wakeup(dev_priv);
}
if (pipea_stats & I915_VBLANK_INTERRUPT_STATUS)
diff --git a/sys/dev/pci/drm/mach64_state.c b/sys/dev/pci/drm/mach64_state.c
index 7f597f50204..1a40a60195e 100644
--- a/sys/dev/pci/drm/mach64_state.c
+++ b/sys/dev/pci/drm/mach64_state.c
@@ -436,7 +436,7 @@ static int mach64_do_get_frames_queued(drm_mach64_private_t * dev_priv)
head = ring->head;
start = (MACH64_MAX_QUEUED_FRAMES -
- DRM_MIN(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
+ min(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
if (head == tail) {
sarea_priv->frames_queued = 0;
diff --git a/sys/dev/pci/drm/mga_irq.c b/sys/dev/pci/drm/mga_irq.c
index 9c49c42d5e8..441948836c4 100644
--- a/sys/dev/pci/drm/mga_irq.c
+++ b/sys/dev/pci/drm/mga_irq.c
@@ -83,7 +83,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS)
}
atomic_inc(&dev_priv->last_fence_retired);
- DRM_WAKEUP(dev_priv);
+ wakeup(dev_priv);
handled = 1;
}
diff --git a/sys/dev/pci/drm/radeon_irq.c b/sys/dev/pci/drm/radeon_irq.c
index fa18ba8dc40..0ebfabcec27 100644
--- a/sys/dev/pci/drm/radeon_irq.c
+++ b/sys/dev/pci/drm/radeon_irq.c
@@ -207,7 +207,7 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS)
/* SW interrupt */
if (stat & RADEON_SW_INT_TEST)
- DRM_WAKEUP(dev_priv);
+ wakeup(dev_priv);
/* VBLANK interrupt */
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690) {