Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
On May 12, 2010, at 5:19 AM, Simon Burge wrote: > Matt Thomas wrote: > >> Module Name: src >> Committed By:matt >> Date:Tue May 11 22:08:02 UTC 2010 >> >> Modified Files: >> >> src/sys/arch/mips/include [matt-nb5-mips64]: locore.h >> >> Log Message: >> >> Use assembly since deref a 64bit value as a pointer does not make a >> 32bit compiler happy. > > Dang, ignore my previous because this code is a little different. > > + __asm volatile("lw %0, 0(%1)" : "=r"(rv) : "d"(addr)); > > "d" is listed as "General-purpose integer register" in the gcc docs. > Does the new code pass the full 64-bits of addr in when compiled on an > ABI where an int is 32-bits even though a full register is 64-bits? Yes.
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Matt Thomas wrote: > Module Name: src > Committed By: matt > Date: Tue May 11 22:08:02 UTC 2010 > > Modified Files: > > src/sys/arch/mips/include [matt-nb5-mips64]: locore.h > > Log Message: > > Use assembly since deref a 64bit value as a pointer does not make a > 32bit compiler happy. Dang, ignore my previous because this code is a little different. + __asm volatile("lw %0, 0(%1)" : "=r"(rv) : "d"(addr)); "d" is listed as "General-purpose integer register" in the gcc docs. Does the new code pass the full 64-bits of addr in when compiled on an ABI where an int is 32-bits even though a full register is 64-bits? Cheers, Simon.
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Matt Thomas wrote: > Module Name: src > Committed By: matt > Date: Tue May 11 21:51:34 UTC 2010 > > Modified Files: > > src/sys/arch/mips/include [matt-nb5-mips64]: locore.h > > Log Message: > > Need to turn KX for N32 kernels with mips3_lw_a64 and mips3_sw_a64 +#elif defined(__mips_n32) + uint32_t sr = mips_cp0_status_read(); + mips_cp0_status_write((sr & ~MIPS_SR_INT_IE) | MIPS3_SR_KX); + rv = *(const uint32_t *)addr; Erm, doesn't that cast toss away the high 32-bits of the address you're try to load/store from/to? Cheers, Simon.
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Good point :-) -- thor...@iphone On Aug 22, 2009, at 6:28 PM, Matt Thomas wrote: On Aug 22, 2009, at 6:28 PM, Jason Thorpe wrote: On Aug 22, 2009, at 4:30 PM, Matt Thomas wrote: On Aug 22, 2009, at 4:25 PM, Jason Thorpe wrote: On Aug 21, 2009, at 10:29 AM, Matt Thomas wrote: Module Name:src Committed By:matt Date:Fri Aug 21 17:29:42 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Adapt to ABI variations. Make sure mips_reg_t == register_t. Add PRIx{{P,V}{ADDR,SIZE}} and PRIxREGISTER{,32} macros to assist printing out above types. What's the point of having both? Why not just register_t and be done with it Mostly to avoid casting. If it's X, use PRIxX and don't worry. No, what's the point of having mips_reg_t ??? because I don't to change all that code right now? :)
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
On Aug 22, 2009, at 6:28 PM, Jason Thorpe wrote: On Aug 22, 2009, at 4:30 PM, Matt Thomas wrote: On Aug 22, 2009, at 4:25 PM, Jason Thorpe wrote: On Aug 21, 2009, at 10:29 AM, Matt Thomas wrote: Module Name:src Committed By: matt Date: Fri Aug 21 17:29:42 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Adapt to ABI variations. Make sure mips_reg_t == register_t. Add PRIx{{P,V}{ADDR,SIZE}} and PRIxREGISTER{,32} macros to assist printing out above types. What's the point of having both? Why not just register_t and be done with it Mostly to avoid casting. If it's X, use PRIxX and don't worry. No, what's the point of having mips_reg_t ??? because I don't to change all that code right now? :)
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
On Aug 22, 2009, at 4:30 PM, Matt Thomas wrote: On Aug 22, 2009, at 4:25 PM, Jason Thorpe wrote: On Aug 21, 2009, at 10:29 AM, Matt Thomas wrote: Module Name:src Committed By: matt Date: Fri Aug 21 17:29:42 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Adapt to ABI variations. Make sure mips_reg_t == register_t. Add PRIx{{P,V}{ADDR,SIZE}} and PRIxREGISTER{,32} macros to assist printing out above types. What's the point of having both? Why not just register_t and be done with it Mostly to avoid casting. If it's X, use PRIxX and don't worry. No, what's the point of having mips_reg_t ??? -- thorpej
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
On Aug 22, 2009, at 4:25 PM, Jason Thorpe wrote: On Aug 21, 2009, at 10:29 AM, Matt Thomas wrote: Module Name:src Committed By: matt Date: Fri Aug 21 17:29:42 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Adapt to ABI variations. Make sure mips_reg_t == register_t. Add PRIx{{P,V}{ADDR,SIZE}} and PRIxREGISTER{,32} macros to assist printing out above types. What's the point of having both? Why not just register_t and be done with it Mostly to avoid casting. If it's X, use PRIxX and don't worry.
Re: CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
On Aug 21, 2009, at 10:29 AM, Matt Thomas wrote: Module Name:src Committed By: matt Date: Fri Aug 21 17:29:42 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Adapt to ABI variations. Make sure mips_reg_t == register_t. Add PRIx{{P,V}{ADDR,SIZE}} and PRIxREGISTER{,32} macros to assist printing out above types. What's the point of having both? Why not just register_t and be done with it To generate a diff of this commit: cvs rdiff -u -r1.43.36.1 -r1.43.36.2 src/sys/arch/mips/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. -- thorpej