Blue Swirl wrote:
On 10/13/07, Robert Reif <[EMAIL PROTECTED]> wrote:
I'm trying to add SuperSparc II MXCC support and need some feedback.
Is there a better way to read and write physical memory in 64bit chunks?
I'm not sure what I'm doing is portable between 32/64 and big/little endian.
Thank you for your effort. Applying the patch allows NetBSD on SS-10
to boot as far as on SS-5, previously it crashed.
I think the code is portable, but I think changing the register type
to uint32_t and using a DPRINTF system like used in for example
hw/iommu.c should make the code slightly clearer.
I don't have access to chip specs but from reading linux and *bsd code it
appears that the registers are 64 bits wide but sometimes accessed as 32
bits to get
only the bottom 32 bits. Do you mean using two uint32_t for a 64 bit
register? How about a union of 2 uint32_t and a uint64_t. Is that
portable?
Never mind. I just found out there is an ldq_phys and stq_phys. I'll
use those.
I looked at DPRINTF but would need a DPRINTF_MMU and DPRINTF_MXCC ...
Would that be acceptable?
For the memory access, ldl/q_phys/stl/q_phys is used in other block
copy routines. For longer blocks or if the address can be unaligned,
cpu_physical_memory_read() could be a better choice.
+int cpu_sparc_register (CPUSPARCState *env, const sparc_def_t *def, int cpu);
unsigned int cpu?
OK
+ printf("ERROR: helper_ld_asi(asi = %d, size = %d, sign = %d) T0 =
%08x: unsupported size\n", asi, size, sign, T0);
If it's an error to access the registers with different size, you
should use do_unassigned_access() to report this.
These are more for me to make sure I catch all the necessary accesses
without adding unnecessary code.
linux 2.4 and netbsd only use the ones I have implemented. openboot
uses more and
also some undocumented ones which are caught by this but I don't know
how to handle
them yet. I will use do_unassigned_access where necessary now.
Thanks for the review.