Skip to content

Commit

Permalink
make this work with ktrace-lwp
Browse files Browse the repository at this point in the history
  • Loading branch information
christos committed Dec 14, 2005
1 parent 049367f commit 7ba5c4f
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 11 deletions.
4 changes: 2 additions & 2 deletions sysutils/aperture/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.33 2005/12/05 20:50:59 rillig Exp $
# $NetBSD: Makefile,v 1.34 2005/12/14 13:42:45 christos Exp $

DISTNAME= apNetBSD
PKGNAME= aperture-2.0
PKGREVISION= 5
PKGREVISION= 6
CATEGORIES= sysutils x11
EXTRACT_SUFX= .shar
# Not sure why ${MASTER_SITE_LOCAL:=${PKGNAME}} doesn't work, but the
Expand Down
4 changes: 2 additions & 2 deletions sysutils/aperture/distinfo
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
$NetBSD: distinfo,v 1.10 2005/02/24 13:40:50 agc Exp $
$NetBSD: distinfo,v 1.11 2005/12/14 13:42:45 christos Exp $

SHA1 (aperture-2.0nb5/apNetBSD.shar) = 66022d35f41df667bbc9ad86a8f2ded292e1098b
RMD160 (aperture-2.0nb5/apNetBSD.shar) = 74739d4d0a5d21d5098c3fab000ad4d622137895
Size (aperture-2.0nb5/apNetBSD.shar) = 66731 bytes
SHA1 (patch-aa) = 544d71b6524b7aaeb5deb985372599f1962af4fe
SHA1 (patch-ab) = fc3f65e9b9bc94880dc18e2091d7daccd3d480ad
SHA1 (patch-ac) = 676b2f426d6f9e725262342e0d7e9ac1c8418362
SHA1 (patch-ad) = ff298db28cf5d4ca0cfe42f4be28c8b1908c828e
SHA1 (patch-ad) = a61b7b252e83f33d5f7b67635f126153402d513a
SHA1 (patch-ae) = b6ae1d888db3a0cbefd7088a7acf7ca881fdc767
SHA1 (patch-af) = 475c127658ba1050154a7dcabe39482c088e2d02
SHA1 (patch-ag) = cc4d08404f5fcd4fc01b1c711984506408e930bc
119 changes: 112 additions & 7 deletions sysutils/aperture/patches/patch-ad
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
$NetBSD: patch-ad,v 1.6 2003/03/19 17:56:39 jmmv Exp $
$NetBSD: patch-ad,v 1.7 2005/12/14 13:42:45 christos Exp $

--- module/aperture.c.orig 2003-03-19 18:52:51.000000000 +0100
+++ module/aperture.c
@@ -117,8 +117,17 @@ xf86close(dev, cflags, devtype, p)
--- aperture.c.orig 2005-12-14 08:34:23.000000000 -0500
+++ aperture.c 2005-12-14 08:41:10.000000000 -0500
@@ -71,6 +71,10 @@
/* open counter */
static int xf86_open_count = 0;

+#if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 399001400
+#define PROC
+#endif
+
/* mem range descriptors */
struct mem_range_softc mem_range_softc;

@@ -78,12 +82,15 @@
* Open the device
*/
int
-xf86open(dev, oflags, devtype, p)
- dev_t dev;
- int oflags;
- int devtype;
- struct proc *p;
+xf86open(dev_t dev, int oflags, int devtype,
+#ifdef PROC
+ struct proc *p)
+{
+#else
+ struct lwp *l)
{
+ struct proc *p = l->l_proc;
+#endif

if (suser(p->p_ucred, &p->p_acflag) != 0) {
return(EPERM);
@@ -101,11 +108,13 @@
* Close the device
*/
int
-xf86close(dev, cflags, devtype, p)
- dev_t dev;
- int cflags;
- int devtype;
- struct proc *p;
+xf86close(dev_t dev, int cflags, int devtype,
+#ifdef PROC
+ struct proc *p
+#else
+ struct lwp *l
+#endif
+)
{
xf86_open_count--;
return(0);
@@ -117,19 +126,22 @@
* allow only section in the vga framebuffer and above main memory
* to be mapped
*/
Expand All @@ -19,9 +70,22 @@ $NetBSD: patch-ad,v 1.6 2003/03/19 17:56:39 jmmv Exp $
+ ((__NetBSD_Version__ < 105000000) || \
+ (__NetBSD_Version__ >= 105010000) && (__NetBSD_Version__ < 105020000)))
int
xf86mmap(dev, offset, length)
dev_t dev;
@@ -144,7 +153,11 @@ xf86mmap(dev, offset, length)
-xf86mmap(dev, offset, length)
- dev_t dev;
- int offset;
- int length;
+xf86mmap(dev_t dev, int offset, int length)
#else
paddr_t
-xf86mmap(dev, offset, length)
- dev_t dev;
- off_t offset;
- int length;
+xf86mmap(dev_t dev, off_t offset, int length)
#endif /* __NetBSD_Version__ */
{

@@ -144,19 +156,24 @@
&& (unsigned)offset <= HOLE16M_END)
#endif
)) {
Expand All @@ -33,3 +97,44 @@ $NetBSD: patch-ad,v 1.6 2003/03/19 17:56:39 jmmv Exp $
} else {
return(-1);
}
}

int
-xf86ioctl(dev, cmd, data, flags, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flags;
- struct proc *p;
+xf86ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
+#ifdef PROC
+ struct proc *p
+#else
+ struct lwp *l
+#endif
+)
{
int nd, error = 0;
struct mem_range_op *mo = (struct mem_range_op *)data;
@@ -212,9 +229,7 @@
* memory range attributes.
*/
int
-mem_range_attr_get(mrd, arg)
- struct mem_range_desc *mrd;
- int *arg;
+mem_range_attr_get(struct mem_range_desc *mrd, int *arg)
{
/* can we handle this? */
if (mem_range_softc.mr_op == NULL)
@@ -229,9 +244,7 @@
}

int
-mem_range_attr_set(mrd, arg)
- struct mem_range_desc *mrd;
- int *arg;
+mem_range_attr_set(struct mem_range_desc *mrd, int *arg)
{
/* can we handle this? */
if (mem_range_softc.mr_op == NULL)

0 comments on commit 7ba5c4f

Please sign in to comment.