Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 2010 15:36:55 -0700
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Merging 64 bit changes to -HEAD - part 4
Message-ID:  <AANLkTimuoaetD2JTHv50oJ65pz1e3bIYXXP0n-fm15BP@mail.gmail.com>
In-Reply-To: <20100709.153409.59640143160064195.imp@bsdimp.com>
References:  <AANLkTik8fBlxMyZ3AZETF_7DvlSpPsx2hozIWinRy0U0@mail.gmail.com>  <20100709.144631.1141490504242621103.imp@bsdimp.com> <AANLkTimcCqP2SinyKJUqpT9l0j07AqGCLxMCuCGXc2wA@mail.gmail.com>  <20100709.153409.59640143160064195.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 9, 2010 at 14:34, M. Warner Losh <imp@bsdimp.com> wrote:
> In message: <AANLkTimcCqP2SinyKJUqpT9l0j07AqGCLxMCuCGXc2wA@mail.gmail.com=
>
> =A0 =A0 =A0 =A0 =A0 =A0Juli Mallett <jmallett@FreeBSD.org> writes:
> : =A0* =A0 =A0The value passed in '*virt' is a suggested virtual address =
for
> : =A0* =A0 =A0the mapping. Architectures which can support a direct-mappe=
d
> : =A0* =A0 =A0physical to virtual region can return the appropriate addre=
ss
> : =A0* =A0 =A0within that region, leaving '*virt' unchanged. Other
> : =A0* =A0 =A0architectures should map the pages starting at '*virt' and
> : =A0* =A0 =A0update '*virt' with the first usable address after the mapp=
ed
> : =A0* =A0 =A0region.
>
> That's rather generic, and on some mips we do a mixed-mode here...

I guess you and I read the word "can" differently wrt mixed-mode :)

> : > : mips-ddb-64.patch (from Juli's branch)
> : > : Minor fixups for ddb support.
> : >
> : > Can you explain the casting for all the calls to kbdpeek*?
> :
> : Yes. =A0sp is (or should be) a register_t. =A0You can't go from a
> : register_t to a pointer on n32. =A0Even if we don't intend to support
> : n32 kernels from head, we shouldn't make n32 harder by using the wrong
> : types without casts :)
>
> True, but can't we redefine these functions such that we don't need
> these great big ugly casts? =A0They are written in assembler, after all,
> but are specific to mips so the API can change here...

Of course we can change them.  We could change the function to not
take a pointer, but an intptr_t or a register_t, but the latter is
wrong and the former is kind of weird (especially if we spell it as
vm_offset_t, which is more normal for the kernel, since vm_offset_t is
unsigned and blah blah sign extension.)  It may make sense to make the
'sp' on the stack an intptr_t rather than a register_t.  What we
really can't do is keep sp a register_t and pass register_t to kdbpeek
and do the math on sp without a cast to intptr_t, since on n32 that's
extremely incorrect since 64-bit signed integer arithmetic works
differently to 32-bit signed integer arithmetic sign-extended to 64
bits :(



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimuoaetD2JTHv50oJ65pz1e3bIYXXP0n-fm15BP>