__asm__ -> __asm

This commit is contained in:
perry 2005-12-24 23:10:08 +00:00
parent 971a8b8cc7
commit ce666bb8ce
38 changed files with 135 additions and 135 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: flt_rounds.c,v 1.7 2005/06/12 05:21:25 lukem Exp $ */
/* $NetBSD: flt_rounds.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: flt_rounds.c,v 1.7 2005/06/12 05:21:25 lukem Exp $");
__RCSID("$NetBSD: flt_rounds.c,v 1.8 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -55,9 +55,9 @@ __flt_rounds()
double fpcrval;
u_int64_t old;
__asm__("trapb");
__asm__("mf_fpcr %0" : "=f" (fpcrval));
__asm__("trapb");
__asm("trapb");
__asm("mf_fpcr %0" : "=f" (fpcrval));
__asm("trapb");
old = *(u_int64_t *)(void *)&fpcrval;
return map[(old >> 58) & 0x3];

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetround.c,v 1.8 2005/06/12 05:21:25 lukem Exp $ */
/* $NetBSD: fpgetround.c,v 1.9 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetround.c,v 1.8 2005/06/12 05:21:25 lukem Exp $");
__RCSID("$NetBSD: fpgetround.c,v 1.9 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -54,7 +54,7 @@ fpgetround()
double fpcrval;
u_int64_t old;
__asm__("mf_fpcr %0" : "=f" (fpcrval));
__asm("mf_fpcr %0" : "=f" (fpcrval));
old = *(u_int64_t *)(void *)&fpcrval;
return ((old >> 58) & 0x3);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetround.c,v 1.9 2005/06/12 05:21:25 lukem Exp $ */
/* $NetBSD: fpsetround.c,v 1.10 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.9 2005/06/12 05:21:25 lukem Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.10 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -55,16 +55,16 @@ fpsetround(rnd_dir)
double fpcrval;
u_int64_t old, new;
__asm__("excb");
__asm__("mf_fpcr %0" : "=f" (fpcrval));
__asm("excb");
__asm("mf_fpcr %0" : "=f" (fpcrval));
old = *(u_int64_t *)(void *)&fpcrval;
new = old & ~(long)0x0c00000000000000;
new = (long)rnd_dir << 58;
*(u_int64_t *)(void *)&fpcrval = new;
__asm__("mt_fpcr %0" : : "f" (fpcrval));
__asm__("excb");
__asm("mt_fpcr %0" : : "f" (fpcrval));
__asm("excb");
return ((old >> 58) & 0x3);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: flt_rounds.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: flt_rounds.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include <machine/float.h>
@ -24,6 +24,6 @@ __flt_rounds()
{
int x;
__asm__("cfc1 %0,$31" : "=r" (x));
__asm("cfc1 %0,$31" : "=r" (x));
return map[x & 0x03];
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetmask()
{
int x;
__asm__("cfc1 %0,$31" : "=r" (x));
__asm("cfc1 %0,$31" : "=r" (x));
return (x >> 7) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetround()
{
int x;
__asm__("cfc1 %0,$31" : "=r" (x));
__asm("cfc1 %0,$31" : "=r" (x));
return x & 0x03;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetsticky()
{
int x;
__asm__("cfc1 %0,$31" : "=r" (x));
__asm("cfc1 %0,$31" : "=r" (x));
return (x >> 2) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetmask(mask)
fp_except old;
fp_except new;
__asm__("cfc1 %0,$31" : "=r" (old));
__asm("cfc1 %0,$31" : "=r" (old));
new = old;
new &= ~(0x1f << 7);
new |= ((mask & 0x1f) << 7);
__asm__("ctc1 %0,$31" : : "r" (new));
__asm("ctc1 %0,$31" : : "r" (new));
return (old >> 7) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetround(rnd_dir)
fp_rnd old;
fp_rnd new;
__asm__("cfc1 %0,$31" : "=r" (old));
__asm("cfc1 %0,$31" : "=r" (old));
new = old;
new &= ~0x03;
new |= (rnd_dir & 0x03);
__asm__("ctc1 %0,$31" : : "r" (new));
__asm("ctc1 %0,$31" : : "r" (new));
return old & 0x03;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetsticky(sticky)
fp_except old;
fp_except new;
__asm__("cfc1 %0,$31" : "=r" (old));
__asm("cfc1 %0,$31" : "=r" (old));
new = old;
new &= ~(0x1f << 2);
new |= ((sticky & 0x1f) << 2);
__asm__("ctc1 %0,$31" : : "r" (new));
__asm("ctc1 %0,$31" : : "r" (new));
return (old >> 2) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fabs.c,v 1.3 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fabs.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
#include <math.h>
@ -9,7 +9,7 @@ fabs(double x)
if (x < 0)
x = -x;
#else
__asm__ volatile("fabs %0,%1" : "=f"(x) : "f"(x));
__asm volatile("fabs %0,%1" : "=f"(x) : "f"(x));
#endif
return (x);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: flt_rounds.c,v 1.9 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: flt_rounds.c,v 1.10 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: flt_rounds.c,v 1.9 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: flt_rounds.c,v 1.10 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include <ieeefp.h>
@ -56,7 +56,7 @@ __flt_rounds(void)
#else
uint64_t fpscr;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
return map[((uint32_t)fpscr & FPSCR_RN)];
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetmask.c,v 1.7 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fpgetmask.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetmask.c,v 1.7 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: fpgetmask.c,v 1.8 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -59,6 +59,6 @@ fpgetmask(void)
{
uint64_t fpscr;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
return (((uint32_t)fpscr & MASKBITS) >> MASKSHFT);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetround.c,v 1.7 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fpgetround.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetround.c,v 1.7 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: fpgetround.c,v 1.8 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -59,6 +59,6 @@ fpgetround(void)
{
uint64_t fpscr;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
return (((uint32_t)fpscr & ROUNDBITS) >> ROUNDSHFT);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetsticky.c,v 1.7 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fpgetsticky.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetsticky.c,v 1.7 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: fpgetsticky.c,v 1.8 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -59,6 +59,6 @@ fpgetsticky(void)
{
uint64_t fpscr;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
return (((uint32_t)fpscr & STICKYBITS) >> STICKYSHFT);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetmask.c,v 1.7 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fpsetmask.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetmask.c,v 1.7 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: fpsetmask.c,v 1.8 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -60,10 +60,10 @@ fpsetmask(fp_except mask)
uint64_t fpscr;
fp_except old;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
old = ((uint32_t)fpscr & MASKBITS) >> MASKSHFT;
fpscr &= ~MASKBITS;
fpscr |= ((uint32_t)mask << MASKSHFT) & MASKBITS;
__asm__ volatile("mtfsf 0xff,%0" :: "f"(fpscr));
__asm volatile("mtfsf 0xff,%0" :: "f"(fpscr));
return (old);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetround.c,v 1.7 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fpsetround.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.7 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.8 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -59,10 +59,10 @@ fpsetround(fp_rnd rnd_dir)
uint64_t fpscr;
fp_rnd old;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
old = (uint32_t)fpscr & ROUNDBITS;
fpscr &= ~ROUNDBITS;
fpscr |= rnd_dir & ROUNDBITS;
__asm__ volatile("mtfsf 0xff,%0" :: "f"(fpscr));
__asm volatile("mtfsf 0xff,%0" :: "f"(fpscr));
return (old);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetsticky.c,v 1.8 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: fpsetsticky.c,v 1.9 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetsticky.c,v 1.8 2005/12/24 21:11:16 perry Exp $");
__RCSID("$NetBSD: fpsetsticky.c,v 1.9 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -63,7 +63,7 @@ fpsetsticky(fp_except mask)
uint64_t fpscr;
fp_except old;
__asm__ volatile("mffs %0" : "=f"(fpscr));
__asm volatile("mffs %0" : "=f"(fpscr));
old = ((uint32_t)fpscr & STICKYBITS) >> STICKYSHFT;
/*
* FPSCR_VX (aka FP_X_INV) is not a sticky bit but a summary of the
@ -86,6 +86,6 @@ fpsetsticky(fp_except mask)
/*
* Write back the fpscr.
*/
__asm__ volatile("mtfsf 0xff,%0" :: "f"(fpscr));
__asm volatile("mtfsf 0xff,%0" :: "f"(fpscr));
return (old);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: syncicache.c,v 1.13 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: syncicache.c,v 1.14 2005/12/24 23:10:08 perry Exp $ */
/*
* Copyright (C) 1995-1997, 1999 Wolfgang Solfrank.
@ -118,11 +118,11 @@ __syncicache(void *from, size_t len)
l = (len + off + linesz - 1) & ~(linesz - 1);
p = (char *)from - off;
do {
__asm__ volatile ("dcbst 0,%0" :: "r"(p));
__asm volatile ("dcbst 0,%0" :: "r"(p));
p += linesz;
} while ((l -= linesz) != 0);
}
__asm__ volatile ("sync");
__asm volatile ("sync");
if (CACHEINFO.icache_size > 0 ) {
linesz = CACHEINFO.icache_line_size;
@ -130,9 +130,9 @@ __syncicache(void *from, size_t len)
l = (len + off + linesz - 1) & ~(linesz - 1);
p = (char *)from - off;
do {
__asm__ volatile ("icbi 0,%0" :: "r"(p));
__asm volatile ("icbi 0,%0" :: "r"(p));
p += linesz;
} while ((l -= linesz) != 0);
}
__asm__ volatile ("sync; isync");
__asm volatile ("sync; isync");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: htonl.c,v 1.2 2003/08/07 16:42:20 agc Exp $ */
/* $NetBSD: htonl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -37,7 +37,7 @@
#include <sys/types.h>
#include <machine/endian.h>
#if defined(LIBC_SCCS)
__RCSID("$NetBSD: htonl.c,v 1.2 2003/08/07 16:42:20 agc Exp $");
__RCSID("$NetBSD: htonl.c,v 1.3 2005/12/24 23:10:08 perry Exp $");
#endif
/* hostorder = htonl(netorder) */
@ -48,9 +48,9 @@ htonl(x)
{
u_int32_t y = 0;
__asm__("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm__("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm__("swap.b %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (y));
return y;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: htons.c,v 1.2 2003/08/07 16:42:20 agc Exp $ */
/* $NetBSD: htons.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -37,7 +37,7 @@
#include <sys/types.h>
#include <machine/endian.h>
#if defined(LIBC_SCCS)
__RCSID("$NetBSD: htons.c,v 1.2 2003/08/07 16:42:20 agc Exp $");
__RCSID("$NetBSD: htons.c,v 1.3 2005/12/24 23:10:08 perry Exp $");
#endif
/* netorder = htons(hostorder) */
@ -46,7 +46,7 @@ u_int16_t
htons(x)
u_int16_t x;
{
__asm__("swap.b %1, %0" : "=r" (x) : "r" (x));
__asm("swap.b %1, %0" : "=r" (x) : "r" (x));
return x;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntohl.c,v 1.2 2003/08/07 16:42:20 agc Exp $ */
/* $NetBSD: ntohl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -37,7 +37,7 @@
#include <sys/types.h>
#include <machine/endian.h>
#if defined(LIBC_SCCS)
__RCSID("$NetBSD: ntohl.c,v 1.2 2003/08/07 16:42:20 agc Exp $");
__RCSID("$NetBSD: ntohl.c,v 1.3 2005/12/24 23:10:08 perry Exp $");
#endif
/* netorder = ntohl(hostorder) */
@ -48,9 +48,9 @@ ntohl(x)
{
u_int32_t y = 0;
__asm__("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm__("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm__("swap.b %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (y));
return y;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntohs.c,v 1.2 2003/08/07 16:42:20 agc Exp $ */
/* $NetBSD: ntohs.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -37,7 +37,7 @@
#include <sys/types.h>
#include <machine/endian.h>
#if defined(LIBC_SCCS)
__RCSID("$NetBSD: ntohs.c,v 1.2 2003/08/07 16:42:20 agc Exp $");
__RCSID("$NetBSD: ntohs.c,v 1.3 2005/12/24 23:10:08 perry Exp $");
#endif
/* hostorder = ntohs(netorder) */
@ -46,7 +46,7 @@ u_int16_t
ntohs(x)
u_int16_t x;
{
__asm__("swap.b %1, %0" : "=r" (x) : "r" (x));
__asm("swap.b %1, %0" : "=r" (x) : "r" (x));
return x;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: flt_rounds.c,v 1.5 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: flt_rounds.c,v 1.6 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: flt_rounds.c,v 1.6 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -25,6 +25,6 @@ __flt_rounds()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return map[(x >> 30) & 0x03];
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetmask()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return (x >> 23) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetround()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return (x >> 30) & 0x03;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetsticky()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return (x >> 5) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetmask.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetmask(mask)
fp_except old;
fp_except new;
__asm__("st %%fsr,%0" : "=m" (*&old));
__asm("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x1f << 23);
new |= ((mask & 0x1f) << 23);
__asm__("ld %0,%%fsr" : : "m" (*&new));
__asm("ld %0,%%fsr" : : "m" (*&new));
return (old >> 23) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetround(rnd_dir)
fp_rnd old;
fp_rnd new;
__asm__("st %%fsr,%0" : "=m" (*&old));
__asm("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x03 << 30);
new |= ((rnd_dir & 0x03) << 30);
__asm__("ld %0,%%fsr" : : "m" (*&new));
__asm("ld %0,%%fsr" : : "m" (*&new));
return (old >> 30) & 0x03;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetsticky(sticky)
fp_except old;
fp_except new;
__asm__("st %%fsr,%0" : "=m" (*&old));
__asm("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x1f << 5);
new |= ((sticky & 0x1f) << 5);
__asm__("ld %0,%%fsr" : : "m" (*&new));
__asm("ld %0,%%fsr" : : "m" (*&new));
return (old >> 5) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: flt_rounds.c,v 1.3 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: flt_rounds.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: flt_rounds.c,v 1.3 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: flt_rounds.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -25,6 +25,6 @@ __flt_rounds()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return map[(x >> 30) & 0x03];
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetmask.c,v 1.3 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetmask.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetmask.c,v 1.3 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetmask.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetmask()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return (x >> 23) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetround.c,v 1.3 2005/06/12 05:21:26 lukem Exp $ */
/* $NetBSD: fpgetround.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetround.c,v 1.3 2005/06/12 05:21:26 lukem Exp $");
__RCSID("$NetBSD: fpgetround.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetround()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return (x >> 30) & 0x03;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpgetsticky.c,v 1.3 2005/06/12 05:21:27 lukem Exp $ */
/* $NetBSD: fpgetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetsticky.c,v 1.3 2005/06/12 05:21:27 lukem Exp $");
__RCSID("$NetBSD: fpgetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -23,6 +23,6 @@ fpgetsticky()
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
__asm("st %%fsr,%0" : "=m" (*&x));
return (x >> 5) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetmask.c,v 1.3 2005/06/12 05:21:27 lukem Exp $ */
/* $NetBSD: fpsetmask.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetmask.c,v 1.3 2005/06/12 05:21:27 lukem Exp $");
__RCSID("$NetBSD: fpsetmask.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetmask(mask)
fp_except old;
fp_except new;
__asm__("st %%fsr,%0" : "=m" (*&old));
__asm("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x1f << 23);
new |= ((mask & 0x1f) << 23);
__asm__("ld %0,%%fsr" : : "m" (*&new));
__asm("ld %0,%%fsr" : : "m" (*&new));
return (old >> 23) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetround.c,v 1.3 2005/06/12 05:21:27 lukem Exp $ */
/* $NetBSD: fpsetround.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.3 2005/06/12 05:21:27 lukem Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetround(rnd_dir)
fp_rnd old;
fp_rnd new;
__asm__("st %%fsr,%0" : "=m" (*&old));
__asm("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x03 << 30);
new |= ((rnd_dir & 0x03) << 30);
__asm__("ld %0,%%fsr" : : "m" (*&new));
__asm("ld %0,%%fsr" : : "m" (*&new));
return (old >> 30) & 0x03;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpsetsticky.c,v 1.3 2005/06/12 05:21:27 lukem Exp $ */
/* $NetBSD: fpsetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetsticky.c,v 1.3 2005/06/12 05:21:27 lukem Exp $");
__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -25,13 +25,13 @@ fpsetsticky(sticky)
fp_except old;
fp_except new;
__asm__("st %%fsr,%0" : "=m" (*&old));
__asm("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x1f << 5);
new |= ((sticky & 0x1f) << 5);
__asm__("ld %0,%%fsr" : : "m" (*&new));
__asm("ld %0,%%fsr" : : "m" (*&new));
return (old >> 5) & 0x1f;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pthread_md.h,v 1.2 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: pthread_md.h,v 1.3 2005/12/24 23:11:13 perry Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
static inline long
pthread__sp(void)
{
register long sp __asm__("r30");
register long sp __asm("r30");
return sp;
}