-/* $OpenBSD: probe.c,v 1.1 2004/05/12 22:54:13 mickey Exp $ */
+/* $OpenBSD: probe.c,v 1.2 2014/04/18 14:38:21 guenther Exp $ */
/*
* Written by Michael Shalayeff, 2004. Public Domain.
const char blah[] = "blah"; /* not */
volatile char *label;
-#define prober(r,a) __asm __volatile( \
+#define prober(r,a) __asm volatile( \
"prober (%2),%1,%0" : "=r" (r) : "r" (3), "r" (a));
-#define proberi(r,a) __asm __volatile( \
+#define proberi(r,a) __asm volatile( \
"proberi (%2),%1,%0" : "=r" (r) : "i" (3), "r" (a));
-#define probew(r,a) __asm __volatile( \
+#define probew(r,a) __asm volatile( \
"probew (%2),%1,%0" : "=r" (r) : "r" (3), "r" (a));
-#define probewi(r,a) __asm __volatile( \
+#define probewi(r,a) __asm volatile( \
"probewi (%2),%1,%0" : "=r" (r) : "i" (3), "r" (a));
void
-/* $OpenBSD: sfuid.c,v 1.1 2004/05/13 01:22:05 mickey Exp $ */
+/* $OpenBSD: sfuid.c,v 1.2 2014/04/18 14:38:21 guenther Exp $ */
/*
* Written by Michael Shalayeff, 2004. Public Domain.
#include <stdio.h>
#include <err.h>
-#define sfuid(i,r) __asm __volatile( \
+#define sfuid(i,r) __asm volatile( \
"spop1,%1,0 %0" : "=r" (r) : "i" (i))
volatile int sfu;
-/* $OpenBSD: testldt.c,v 1.8 2003/09/02 23:52:17 david Exp $ */
+/* $OpenBSD: testldt.c,v 1.9 2014/04/18 14:38:21 guenther Exp $ */
/* $NetBSD: testldt.c,v 1.4 1995/04/20 22:42:38 cgd Exp $ */
#include <stdio.h>
static inline void
set_fs(unsigned long val)
{
- __asm__ __volatile__("mov %0,%%fs"::"r" ((unsigned short) val));
+ __asm__ volatile("mov %0,%%fs"::"r" ((unsigned short) val));
}
static inline unsigned char
gated_call(void)
{
printf("Called from call gate...");
- __asm__ __volatile__("popl %ebp");
- __asm__ __volatile__(".byte 0xcb");
+ __asm__ volatile("popl %ebp");
+ __asm__ volatile(".byte 0xcb");
}
static struct segment_descriptor *
printf("setldt returned: %d\n", err);
#endif
- __asm__ __volatile__(".byte 0x9a"); /* This is a call to a call gate. */
- __asm__ __volatile__(".byte 0x00"); /* Value is ignored in a call gate but can be used. */
- __asm__ __volatile__(".byte 0x00"); /* by the called procedure. */
- __asm__ __volatile__(".byte 0x00");
- __asm__ __volatile__(".byte 0x00");
- __asm__ __volatile__(".byte 0x2f"); /* Selector 0x002f. This is index = 5 (the call gate), */
- __asm__ __volatile__(".byte 0x00"); /* and a requestor priveledge level of 3. */
+ __asm__ volatile(".byte 0x9a"); /* This is a call to a call gate. */
+ __asm__ volatile(".byte 0x00"); /* Value is ignored in a call gate but can be used. */
+ __asm__ volatile(".byte 0x00"); /* by the called procedure. */
+ __asm__ volatile(".byte 0x00");
+ __asm__ volatile(".byte 0x00");
+ __asm__ volatile(".byte 0x2f"); /* Selector 0x002f. This is index = 5 (the call gate), */
+ __asm__ volatile(".byte 0x00"); /* and a requestor priveledge level of 3. */
printf("Gated call returned\n");
exit (0);
-/* $OpenBSD: trap.c,v 1.2 2013/01/07 05:24:51 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.3 2014/04/18 14:38:21 guenther Exp $ */
/*
* Simple test program to check what happens when userland tries to trap.
#define TRAP(num) \
case num: \
- __asm__ __volatile__ ("tb0 0, %r0, " __STRING(num) ); \
+ __asm__ volatile ("tb0 0, %r0, " __STRING(num) ); \
break;
int
-/* $OpenBSD: simm13.c,v 1.5 2003/08/19 19:24:07 jason Exp $ */
+/* $OpenBSD: simm13.c,v 1.6 2014/04/18 14:38:21 guenther Exp $ */
/*
* Copyright (c) 2003 Jason L. Wright (jason@thought.net)
* popc imm, %o0
*/
p[0] = I_JMPLri(I_G0, I_O7, 8);
- __asm __volatile("iflush %0+0" : : "r" (p + 0));
+ __asm volatile("iflush %0+0" : : "r" (p + 0));
p[1] = _I_OP3_R_RI(I_O0, IOP3_POPC, I_G0, imm);
- __asm __volatile("iflush %0+0" : : "r" (p + 1));
- __asm __volatile("nop;nop;nop;nop;nop");
+ __asm volatile("iflush %0+0" : : "r" (p + 1));
+ __asm volatile("nop;nop;nop;nop;nop");
}
int64_t
-/* $OpenBSD: noexec.c,v 1.14 2014/01/10 13:45:00 jsing Exp $ */
+/* $OpenBSD: noexec.c,v 1.15 2014/04/18 14:38:21 guenther Exp $ */
/*
* Copyright (c) 2002,2003 Michael Shalayeff
fdcache(void *p, size_t size)
{
#ifdef __hppa__
- __asm __volatile( /* XXX this hardcodes the TESTSZ */
+ __asm volatile( /* XXX this hardcodes the TESTSZ */
"fdc,m %1(%0)\n\t"
"fdc,m %1(%0)\n\t"
"fdc,m %1(%0)\n\t"
int i;
for (i = 0; i < TESTSZ; i += 8)
- __asm __volatile("flush %0" : : "r" (s + i) : "memory");
+ __asm volatile("flush %0" : : "r" (s + i) : "memory");
#endif
}