Date: Wed, 23 Aug 2006 22:17:12 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 104871 for review Message-ID: <200608232217.k7NMHCeJ026162@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=104871 Change 104871 by gonzo@gonzo_hideout on 2006/08/23 22:16:12 o Replace "arm" string with "mips". TODO: check if it's enough. Affected files ... .. //depot/projects/mips2/src/lib/libpthread/arch/mips/include/pthread_md.h#2 edit .. //depot/projects/mips2/src/lib/libpthread/arch/mips/mips/pthread_md.c#2 edit Differences ... ==== //depot/projects/mips2/src/lib/libpthread/arch/mips/include/pthread_md.h#2 (text+ko) ==== @@ -62,7 +62,7 @@ * XXX - Both static and dynamic allocation of any of these structures * will result in a valid, well-aligned thread pointer??? */ -struct arm_tp { +struct mips_tp { struct tdv *tp_tdv; /* dynamic TLS */ }; @@ -71,7 +71,7 @@ struct kcb *tcb_curkcb; uint32_t tcb_isfake; struct kse_thr_mailbox tcb_tmbx; /* needs 32-byte alignment */ - struct arm_tp tcb_tp; + struct mips_tp tcb_tp; }; struct kcb { @@ -81,8 +81,8 @@ struct kse *kcb_kse; }; -extern struct arm_tp **arm_tp; -#define _tp (*arm_tp) +extern struct mips_tp **mips_tp; +#define _tp (*mips_tp) #define _tcb ((struct tcb*)((char*)(_tp) - offsetof(struct tcb, tcb_tp))) @@ -94,13 +94,16 @@ struct kcb *_kcb_ctor(struct kse *kse); void _kcb_dtor(struct kcb *); +/* XXXMIPS: Should we do this using ll/sc? */ static __inline uint32_t __kcb_swp(uint32_t val, void *ptr) { - - __asm __volatile("swp %0, %1, [%2]" - : "=r" (val) : "r" (val) , "r" (ptr) : "memory"); - return (val); + register_t tmp; + __asm __volatile( + "lw %1, (%2)\n\t" \ + "sw (%2), %0\n\t" \ + : "=r" (val), "=r" (tmp) : "r" (val) , "r" (ptr) : "memory"); + return (tmp); } /* Called from the KSE to set its private data. */ ==== //depot/projects/mips2/src/lib/libpthread/arch/mips/mips/pthread_md.c#2 (text+ko) ==== @@ -41,7 +41,7 @@ #include "pthread_md.h" -struct arm_tp **arm_tp = (struct arm_tp **)ARM_TP_ADDRESS; +/* struct mips_tp **mips_tp = (struct mips_tp **)MIPS_TP_ADDRESS; */ struct tcb * _tcb_ctor(struct pthread *thread, int initial)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608232217.k7NMHCeJ026162>