Subject: Re: cpu_intr_p() does not exist for all ports
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Paul Goyette <paul@whooppee.com>
List: current-users
Date: 12/06/2007 06:05:50
On Thu, 6 Dec 2007, Izumi Tsutsui wrote:

>> I'd be happy to write a dummy function for the ports that I use, but I
>> haven't a clue how to write a dummy machine-independant version and have
>> the MD version supersede it where the MD version exists.  It doesn't
>> seem smart to implement a separate dummy function for each port.
>
> Maybe an easy way is to put the dummy function in kern_rwlock.c
> itself and use __weak_alias()?

OK, I've successfully built both i386 and amd64 'build.sh release' with 
the following patch.

I noticed that Andy just checked in a fix for x86 (includes both amd64 
and i386), so perhaps this isn't needed after all.

Index: kern_rwlock.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_rwlock.c,v
retrieving revision 1.13
diff -u -p -r1.13 kern_rwlock.c
--- kern_rwlock.c	4 Dec 2007 09:13:59 -0000	1.13
+++ kern_rwlock.c	6 Dec 2007 13:57:23 -0000
@@ -110,6 +110,20 @@ do {									\

  #endif	/* DIAGNOSTIC */

+/* XXX
+ * XXX For platforms that don't implement a way to tell if we're running
+ * XXX in interrupt context, just pretend that we're never interrupted.
+ * XXX
+ */
+bool __cpu_intr_p(void);
+
+bool
+__cpu_intr_p(void)
+{
+	return FALSE;
+}
+__weak_alias(cpu_intr_p, __cpu_intr_p)
+
  /*
   * For platforms that use 'simple' RW locks.
   */


----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul@whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette@juniper.net |
----------------------------------------------------------------------