svn commit: r250138 - in head/sys/mips: include mips
Warner Losh
imp at FreeBSD.org
Wed May 1 06:57:47 UTC 2013
Author: imp
Date: Wed May 1 06:57:46 2013
New Revision: 250138
URL: http://svnweb.freebsd.org/changeset/base/250138
Log:
Don't include asm.h in non-asm files.
Remove #define to get kludges that asm.h used to define
Move clever macros to access assembler instructions to trap.c
Remove __ASSEMBLER__ ifdefs in regdef.h: they aren't needed anymore.
Modified:
head/sys/mips/include/asm.h
head/sys/mips/include/regdef.h
head/sys/mips/mips/db_interface.c
head/sys/mips/mips/trap.c
Modified: head/sys/mips/include/asm.h
==============================================================================
--- head/sys/mips/include/asm.h Wed May 1 06:55:13 2013 (r250137)
+++ head/sys/mips/include/asm.h Wed May 1 06:57:46 2013 (r250138)
@@ -56,9 +56,7 @@
#ifndef _MACHINE_ASM_H_
#define _MACHINE_ASM_H_
-#ifndef NO_REG_DEFS
#include <machine/regdef.h>
-#endif
#include <machine/endian.h>
#include <machine/cdefs.h>
@@ -111,26 +109,6 @@
#define WARN_REFERENCES(_sym,_msg) \
.section .gnu.warning. ## _sym ; .ascii _msg ; .text
-/*
- * These are temp registers whose names can be used in either the old
- * or new ABI, although they map to different physical registers. In
- * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7.
- *
- * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3
- * should be used only when we need more than t0-t3.
- */
-#if defined(__mips_n32) || defined(__mips_n64)
-#define ta0 $8
-#define ta1 $9
-#define ta2 $10
-#define ta3 $11
-#else
-#define ta0 $12
-#define ta1 $13
-#define ta2 $14
-#define ta3 $15
-#endif /* __mips_n32 || __mips_n64 */
-
#ifdef __ELF__
# define _C_LABEL(x) x
#else
@@ -674,97 +652,6 @@ _C_LABEL(x):
#define USE_ALT_CP(a) .cplocal a
#endif /* __mips_n32 || __mips_n64 */
-#define mfc0_macro(data, spr) \
- __asm __volatile ("mfc0 %0, $%1" \
- : "=r" (data) /* outputs */ \
- : "i" (spr)); /* inputs */
-
-#define mtc0_macro(data, spr) \
- __asm __volatile ("mtc0 %0, $%1" \
- : /* outputs */ \
- : "r" (data), "i" (spr)); /* inputs */
-
-#define cfc0_macro(data, spr) \
- __asm __volatile ("cfc0 %0, $%1" \
- : "=r" (data) /* outputs */ \
- : "i" (spr)); /* inputs */
-
-#define ctc0_macro(data, spr) \
- __asm __volatile ("ctc0 %0, $%1" \
- : /* outputs */ \
- : "r" (data), "i" (spr)); /* inputs */
-
-
-#define lbu_macro(data, addr) \
- __asm __volatile ("lbu %0, 0x0(%1)" \
- : "=r" (data) /* outputs */ \
- : "r" (addr)); /* inputs */
-
-#define lb_macro(data, addr) \
- __asm __volatile ("lb %0, 0x0(%1)" \
- : "=r" (data) /* outputs */ \
- : "r" (addr)); /* inputs */
-
-#define lwl_macro(data, addr) \
- __asm __volatile ("lwl %0, 0x0(%1)" \
- : "=r" (data) /* outputs */ \
- : "r" (addr)); /* inputs */
-
-#define lwr_macro(data, addr) \
- __asm __volatile ("lwr %0, 0x0(%1)" \
- : "=r" (data) /* outputs */ \
- : "r" (addr)); /* inputs */
-
-#define ldl_macro(data, addr) \
- __asm __volatile ("ldl %0, 0x0(%1)" \
- : "=r" (data) /* outputs */ \
- : "r" (addr)); /* inputs */
-
-#define ldr_macro(data, addr) \
- __asm __volatile ("ldr %0, 0x0(%1)" \
- : "=r" (data) /* outputs */ \
- : "r" (addr)); /* inputs */
-
-#define sb_macro(data, addr) \
- __asm __volatile ("sb %0, 0x0(%1)" \
- : /* outputs */ \
- : "r" (data), "r" (addr)); /* inputs */
-
-#define swl_macro(data, addr) \
- __asm __volatile ("swl %0, 0x0(%1)" \
- : /* outputs */ \
- : "r" (data), "r" (addr)); /* inputs */
-
-#define swr_macro(data, addr) \
- __asm __volatile ("swr %0, 0x0(%1)" \
- : /* outputs */ \
- : "r" (data), "r" (addr)); /* inputs */
-
-#define sdl_macro(data, addr) \
- __asm __volatile ("sdl %0, 0x0(%1)" \
- : /* outputs */ \
- : "r" (data), "r" (addr)); /* inputs */
-
-#define sdr_macro(data, addr) \
- __asm __volatile ("sdr %0, 0x0(%1)" \
- : /* outputs */ \
- : "r" (data), "r" (addr)); /* inputs */
-
-#define mfgr_macro(data, gr) \
- __asm __volatile ("move %0, $%1" \
- : "=r" (data) /* outputs */ \
- : "i" (gr)); /* inputs */
-
-#define dmfc0_macro(data, spr) \
- __asm __volatile ("dmfc0 %0, $%1" \
- : "=r" (data) /* outputs */ \
- : "i" (spr)); /* inputs */
-
-#define dmtc0_macro(data, spr, sel) \
- __asm __volatile ("dmtc0 %0, $%1, %2" \
- : /* no outputs */ \
- : "r" (data), "i" (spr), "i" (sel)); /* inputs */
-
#define GET_CPU_PCPU(reg) \
PTR_L reg, _C_LABEL(pcpup);
Modified: head/sys/mips/include/regdef.h
==============================================================================
--- head/sys/mips/include/regdef.h Wed May 1 06:55:13 2013 (r250137)
+++ head/sys/mips/include/regdef.h Wed May 1 06:57:46 2013 (r250138)
@@ -41,7 +41,6 @@
#include <machine/cdefs.h> /* for API selection */
-#if defined(__ASSEMBLER__)
#define zero $0 /* always zero */
#define AT $at /* assembler temporary */
#define v0 $2 /* return value */
@@ -106,5 +105,4 @@
#define ta3 $15
#endif /* __mips_n32 || __mips_n64 */
-#endif /* __ASSEMBLER__ */
#endif /* _MIPS_REGDEF_H */
Modified: head/sys/mips/mips/db_interface.c
==============================================================================
--- head/sys/mips/mips/db_interface.c Wed May 1 06:55:13 2013 (r250137)
+++ head/sys/mips/mips/db_interface.c Wed May 1 06:57:46 2013 (r250138)
@@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$");
#include <machine/mips_opcode.h>
#include <machine/vmparam.h>
#include <machine/md_var.h>
-#define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */
-#include <machine/asm.h>
#include <machine/setjmp.h>
#include <ddb/ddb.h>
Modified: head/sys/mips/mips/trap.c
==============================================================================
--- head/sys/mips/mips/trap.c Wed May 1 06:55:13 2013 (r250137)
+++ head/sys/mips/mips/trap.c Wed May 1 06:57:46 2013 (r250138)
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include "opt_ktrace.h"
#include "opt_kdtrace.h"
-#define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysent.h>
@@ -85,7 +84,6 @@ __FBSDID("$FreeBSD$");
#include <machine/frame.h>
#include <machine/regnum.h>
#include <machine/tls.h>
-#include <machine/asm.h>
#ifdef DDB
#include <machine/db_machdep.h>
@@ -127,6 +125,61 @@ SYSCTL_INT(_machdep, OID_AUTO, trap_debu
&trap_debug, 0, "Debug information on all traps");
#endif
+#define lbu_macro(data, addr) \
+ __asm __volatile ("lbu %0, 0x0(%1)" \
+ : "=r" (data) /* outputs */ \
+ : "r" (addr)); /* inputs */
+
+#define lb_macro(data, addr) \
+ __asm __volatile ("lb %0, 0x0(%1)" \
+ : "=r" (data) /* outputs */ \
+ : "r" (addr)); /* inputs */
+
+#define lwl_macro(data, addr) \
+ __asm __volatile ("lwl %0, 0x0(%1)" \
+ : "=r" (data) /* outputs */ \
+ : "r" (addr)); /* inputs */
+
+#define lwr_macro(data, addr) \
+ __asm __volatile ("lwr %0, 0x0(%1)" \
+ : "=r" (data) /* outputs */ \
+ : "r" (addr)); /* inputs */
+
+#define ldl_macro(data, addr) \
+ __asm __volatile ("ldl %0, 0x0(%1)" \
+ : "=r" (data) /* outputs */ \
+ : "r" (addr)); /* inputs */
+
+#define ldr_macro(data, addr) \
+ __asm __volatile ("ldr %0, 0x0(%1)" \
+ : "=r" (data) /* outputs */ \
+ : "r" (addr)); /* inputs */
+
+#define sb_macro(data, addr) \
+ __asm __volatile ("sb %0, 0x0(%1)" \
+ : /* outputs */ \
+ : "r" (data), "r" (addr)); /* inputs */
+
+#define swl_macro(data, addr) \
+ __asm __volatile ("swl %0, 0x0(%1)" \
+ : /* outputs */ \
+ : "r" (data), "r" (addr)); /* inputs */
+
+#define swr_macro(data, addr) \
+ __asm __volatile ("swr %0, 0x0(%1)" \
+ : /* outputs */ \
+ : "r" (data), "r" (addr)); /* inputs */
+
+#define sdl_macro(data, addr) \
+ __asm __volatile ("sdl %0, 0x0(%1)" \
+ : /* outputs */ \
+ : "r" (data), "r" (addr)); /* inputs */
+
+#define sdr_macro(data, addr) \
+ __asm __volatile ("sdr %0, 0x0(%1)" \
+ : /* outputs */ \
+ : "r" (data), "r" (addr)); /* inputs */
+
static void log_illegal_instruction(const char *, struct trapframe *);
static void log_bad_page_fault(char *, struct trapframe *, int);
static void log_frame_dump(struct trapframe *frame);
More information about the svn-src-head
mailing list