Vivek Goyal <[EMAIL PROTECTED]> writes:

> I am still going through the list but for many arches __pa() will
> work on kernel text and data also because kernel text and data is
> part of lineaerly mapped region. For example ppc64, sh64, parisc.

And i386. :)

> Does that mean that there is no arch independent way of determining
> kernel text and data physical addresses. So if one has to know the 
> physical address for kernel text and data, they should implement
> the functionality in arch dependent section and hope either arch
> has provided a macro like __pa_symbol() or both kernel text and linearly
> mapped region are same and __pa() will work for both?
>
> So following implementation is broken? This should be pushed into
> arch dependent code.
>
> static inline int pfn_is_nosave(unsigned long pfn)
> {
>         unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
>         unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >>
> PAGE_SHIFT;
>         return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
> }

Looks like it.  What is also interesting is that in there are exactly two
variables (in the entire kernel) in the  pfn nosave section.

If we weren't relocating the kernel I would be inclined to just fix the
linker scripts to return an appropriate value.  But for x86_64 we
certainly need a function we can call.

It shouldn't be too hard to move the bits of suspend to swap into arch
dependent code that need to be there.

Eric
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to