Module Name:    src
Committed By:   martin
Date:           Tue Mar 24 21:36:46 UTC 2009

Modified Files:
        src/sys/arch/mips/mips: genassym.cf mipsX_subr.S
        src/sys/external/isc/atheros_hal/ic: ah_osdep.c

Log Message:
Now that we compile the Atheros HAL from source we pass all the right
flags to the compiler so it obeys the same ABI as the rest of the kernel.
Remove the hacks used to work around the abi differences (using %s7 as
curlwp) intruduced for the binary hal.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mips/mips/genassym.cf
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/mips/mipsX_subr.S
cvs rdiff -u -r1.1 -r1.2 src/sys/external/isc/atheros_hal/ic/ah_osdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/genassym.cf
diff -u src/sys/arch/mips/mips/genassym.cf:1.44 src/sys/arch/mips/mips/genassym.cf:1.45
--- src/sys/arch/mips/mips/genassym.cf:1.44	Sat Sep 20 18:29:05 2008
+++ src/sys/arch/mips/mips/genassym.cf	Tue Mar 24 21:36:46 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.44 2008/09/20 18:29:05 tsutsui Exp $
+#	$NetBSD: genassym.cf,v 1.45 2009/03/24 21:36:46 martin Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -277,9 +277,6 @@
 define	TF_REG_EPC	offsetof(struct trapframe, tf_regs[TF_EPC])
 define	TF_PPL		offsetof(struct trapframe, tf_ppl)
 
-# XXX Atheros HAL
-define	TF_PAD		offsetof(struct trapframe, tf_pad)
-
 define	CTXSWFRAME_SIZ	sizeof(label_t)
 define	SF_REG_SR	offsetof(label_t, val[11])
 define	SF_REG_RA	offsetof(label_t, val[10])

Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26 src/sys/arch/mips/mips/mipsX_subr.S:1.27
--- src/sys/arch/mips/mips/mipsX_subr.S:1.26	Wed Oct 17 19:55:39 2007
+++ src/sys/arch/mips/mips/mipsX_subr.S	Tue Mar 24 21:36:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.26 2007/10/17 19:55:39 garbled Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.27 2009/03/24 21:36:46 martin Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1085,7 +1085,6 @@
 	REG_S	v0, TF_BASE+TF_REG_MULLO(sp)
 	REG_S	v1, TF_BASE+TF_REG_MULHI(sp)
 	REG_S	a2, TF_BASE+TF_REG_EPC(sp)
-	REG_S	MIPS_CURLWP, TF_BASE+TF_PAD(sp)	# XXX Atheros HAL
 /*
  * Call the interrupt handler.
  */
@@ -1101,7 +1100,6 @@
 #endif
 	mtc0	zero, MIPS_COP_0_STATUS		# Reset exl, trap possible.
 	COP0_SYNC
-	lw	MIPS_CURLWP, CPUVAR(CURLWP)	# XXX Atheros HAL
 	jal	_C_LABEL(cpu_intr)
 	and	a3, a0, a1			# 4th is STATUS & CAUSE
 /*
@@ -1120,7 +1118,6 @@
 	nop
 	.set noat
 #endif
-	REG_L	MIPS_CURLWP, TF_BASE+TF_PAD(sp)	# XXX Atheros HAL
 	REG_L	a0, TF_BASE+TF_REG_SR(sp)	# ??? why differs ???
 	DYNAMIC_STATUS_MASK(a0, t0)		# machine dependent masking
 	REG_L	t0, TF_BASE+TF_REG_MULLO(sp)

Index: src/sys/external/isc/atheros_hal/ic/ah_osdep.c
diff -u src/sys/external/isc/atheros_hal/ic/ah_osdep.c:1.1 src/sys/external/isc/atheros_hal/ic/ah_osdep.c:1.2
--- src/sys/external/isc/atheros_hal/ic/ah_osdep.c:1.1	Thu Dec 11 05:37:40 2008
+++ src/sys/external/isc/atheros_hal/ic/ah_osdep.c	Tue Mar 24 21:36:46 2009
@@ -26,11 +26,11 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: ah_osdep.c,v 1.1 2008/12/11 05:37:40 alc Exp $
+ * $Id: ah_osdep.c,v 1.2 2009/03/24 21:36:46 martin Exp $
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ah_osdep.c,v 1.1 2008/12/11 05:37:40 alc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ah_osdep.c,v 1.2 2009/03/24 21:36:46 martin Exp $");
 
 #include "opt_athhal.h"
 
@@ -52,16 +52,6 @@
 
 #include <external/isc/atheros_hal/dist/ah.h>
 
-#ifdef __mips__
-#include <sys/cpu.h>
-
-#define ENTER	lwp_t *savlwp = curlwp; curlwp = cpu_info_store.ci_curlwp;
-#define	EXIT	curlwp = savlwp;
-#else
-#define	ENTER	/* nothing */
-#define	EXIT	/* nothing */
-#endif
-
 extern	void ath_hal_printf(struct ath_hal *, const char*, ...)
 		__printflike(2,3);
 extern	void ath_hal_vprintf(struct ath_hal *, const char*, va_list)
@@ -148,48 +138,34 @@
 void*
 ath_hal_malloc(size_t size)
 {
-	void *ret;
-	ENTER
-	ret = malloc(size, M_ATH_HAL, M_NOWAIT | M_ZERO);
-	EXIT
-	return ret;
+	return malloc(size, M_ATH_HAL, M_NOWAIT | M_ZERO);
 }
 
 void
 ath_hal_free(void* p)
 {
-	ENTER
 	free(p, M_ATH_HAL);
-	EXIT
 }
 
 void
 ath_hal_vprintf(struct ath_hal *ah, const char* fmt, va_list ap)
 {
-	ENTER
 	vprintf(fmt, ap);
-	EXIT
 }
 
 void
 ath_hal_printf(struct ath_hal *ah, const char* fmt, ...)
 {
 	va_list ap;
-	ENTER
 	va_start(ap, fmt);
 	ath_hal_vprintf(ah, fmt, ap);
 	va_end(ap);
-	EXIT
 }
 
 const char*
 ath_hal_ether_sprintf(const u_int8_t *mac)
 {
-	const char *ret;
-	ENTER
-	ret = ether_sprintf(mac);
-	EXIT
-	return ret;
+	return ether_sprintf(mac);
 }
 
 #ifdef ATHHAL_DEBUG
@@ -198,11 +174,9 @@
 {
 	if (ath_hal_debug) {
 		va_list ap;
-		ENTER
 		va_start(ap, fmt);
 		ath_hal_vprintf(ah, fmt, ap);
 		va_end(ap);
-		EXIT
 	}
 }
 
@@ -211,11 +185,9 @@
 {
 	if (ath_hal_debug >= level) {
 		va_list ap;
-		ENTER
 		va_start(ap, fmt);
 		ath_hal_vprintf(ah, fmt, ap);
 		va_end(ap);
-		EXIT
 	}
 }
 #endif /* ATHHAL_DEBUG */
@@ -319,7 +291,6 @@
 ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val)
 {
 	bus_space_tag_t t = BUSTAG(ah);
-	ENTER
 
 	if (ath_hal_alq) {
 		struct ale *ale = ath_hal_alq_get(ah);
@@ -337,8 +308,6 @@
 	else
 #endif
 		bus_space_write_stream_4(t, h, reg, val);
-
-	EXIT
 }
 
 u_int32_t
@@ -347,7 +316,6 @@
 	u_int32_t val;
 	bus_space_handle_t h = BUSHANDLE(ah);
 	bus_space_tag_t t = BUSTAG(ah);
-	ENTER
 
 #if _BYTE_ORDER == _BIG_ENDIAN
 	if (reg >= 0x4000 && reg < 0x5000)
@@ -367,7 +335,6 @@
 		}
 	}
 
-	EXIT
 	return val;
 }
 
@@ -376,7 +343,7 @@
 {
 	if (ath_hal_alq) {
 		struct ale *ale = ath_hal_alq_get(ah);
-		ENTER
+
 		if (ale) {
 			struct athregrec *r = (struct athregrec *) ale->ae_data;
 			r->op = OP_MARK;
@@ -384,7 +351,6 @@
 			r->val = v;
 			alq_post(ath_hal_alq, ale);
 		}
-		EXIT
 	}
 }
 #elif defined(ATHHAL_DEBUG) || defined(AH_REGOPS_FUNC)
@@ -404,7 +370,6 @@
 {
 	bus_space_handle_t h = BUSHANDLE(ah);
 	bus_space_tag_t t = BUSTAG(ah);
-	ENTER
 
 #if _BYTE_ORDER == _BIG_ENDIAN
 	if (reg >= 0x4000 && reg < 0x5000)
@@ -412,7 +377,6 @@
 	else
 #endif
 		bus_space_write_stream_4(t, h, reg, val);
-	EXIT
 }
 
 u_int32_t
@@ -421,7 +385,6 @@
 	bus_space_handle_t h = BUSHANDLE(ah);
 	bus_space_tag_t t = BUSTAG(ah);
 	uint32_t ret;
-	ENTER
 
 #if _BYTE_ORDER == _BIG_ENDIAN
 	if (reg >= 0x4000 && reg < 0x5000)
@@ -429,7 +392,6 @@
 	else
 #endif
 		ret = bus_space_read_stream_4(t, h, reg);
-	EXIT
 
 	return ret;
 }
@@ -439,7 +401,6 @@
 void
 ath_hal_assert_failed(const char* filename, int lineno, const char *msg)
 {
-	ENTER
 	printf("Atheros HAL assertion failure: %s: line %u: %s\n",
 		filename, lineno, msg);
 	panic("ath_hal_assert");
@@ -452,9 +413,7 @@
 void
 ath_hal_delay(int n)
 {
-	ENTER
 	DELAY(n);
-	EXIT
 }
 
 u_int32_t
@@ -462,28 +421,20 @@
 {
 	struct bintime bt;
 	uint32_t ret;
-	ENTER
 	getbinuptime(&bt);
 	ret = (bt.sec * 1000) +
 		(((uint64_t)1000 * (uint32_t)(bt.frac >> 32)) >> 32);
-	EXIT
 	return ret;
 }
 
 void
 ath_hal_memzero(void *dst, size_t n)
 {
-	ENTER
 	(void)memset(dst, 0, n);
-	EXIT
 }
 
 void *
 ath_hal_memcpy(void *dst, const void *src, size_t n)
 {
-	void *ret;
-	ENTER
-	ret = memcpy(dst, src, n);
-	EXIT
-	return ret;
+	return memcpy(dst, src, n);
 }

Reply via email to