summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-04 19:46:57 +0000
committerdg <dg@FreeBSD.org>1994-08-04 19:46:57 +0000
commitf9c5964667dd365032b3d33ded3bf17c25e888d6 (patch)
tree905a21f1ca5b251c7bfc405636b3dc334fb7b1b7
parent92c719582bba1d40d15d5ee88ae8fb3f6077ebf0 (diff)
downloadFreeBSD-src-f9c5964667dd365032b3d33ded3bf17c25e888d6.zip
FreeBSD-src-f9c5964667dd365032b3d33ded3bf17c25e888d6.tar.gz
Inlined insque and remque.
-rw-r--r--sys/amd64/include/cpufunc.h29
-rw-r--r--sys/i386/include/cpufunc.h29
2 files changed, 54 insertions, 4 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 02f044f..74067a7 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: cpufunc.h,v 1.13 1994/08/02 07:38:43 davidg Exp $
*/
/*
@@ -107,11 +107,36 @@ tlbflush()
static inline u_long
rcr2()
{
- u_long data;
+ u_long data;
__asm __volatile("movl %%cr2,%%eax" : "=a" (data));
return data;
}
+struct quehead {
+ struct quehead *qh_link;
+ struct quehead *qh_rlink;
+};
+
+static inline void
+insque(void *a, void *b)
+{
+ register struct quehead *element = a, *head = b;
+ element->qh_link = head->qh_link;
+ head->qh_link = (struct quehead *)element;
+ element->qh_rlink = (struct quehead *)head;
+ ((struct quehead *)(element->qh_link))->qh_rlink
+ = (struct quehead *)element;
+}
+
+static inline void
+remque(void *a)
+{
+ register struct quehead *element = a;
+ ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
+ ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link;
+ element->qh_rlink = 0;
+}
+
#else /* not __GNUC__ */
extern void insque __P((void *, void *));
extern void remque __P((void *));
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 02f044f..74067a7 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: cpufunc.h,v 1.13 1994/08/02 07:38:43 davidg Exp $
*/
/*
@@ -107,11 +107,36 @@ tlbflush()
static inline u_long
rcr2()
{
- u_long data;
+ u_long data;
__asm __volatile("movl %%cr2,%%eax" : "=a" (data));
return data;
}
+struct quehead {
+ struct quehead *qh_link;
+ struct quehead *qh_rlink;
+};
+
+static inline void
+insque(void *a, void *b)
+{
+ register struct quehead *element = a, *head = b;
+ element->qh_link = head->qh_link;
+ head->qh_link = (struct quehead *)element;
+ element->qh_rlink = (struct quehead *)head;
+ ((struct quehead *)(element->qh_link))->qh_rlink
+ = (struct quehead *)element;
+}
+
+static inline void
+remque(void *a)
+{
+ register struct quehead *element = a;
+ ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
+ ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link;
+ element->qh_rlink = 0;
+}
+
#else /* not __GNUC__ */
extern void insque __P((void *, void *));
extern void remque __P((void *));
OpenPOWER on IntegriCloud