On Sat, Sep 01, 2018 at 01:11:15AM -0400, Wei Huang wrote:
> +.section .text
> +
> +        .globl  _start
> +
> +_start:
> +        /* disable MMU to use phys mem address */
> +        mrs     x0, sctlr_el1
> +        bic     x0, x0, #(1<<0)
> +        msr     sctlr_el1, x0
> +        isb
> +
> +        /* traverse test memory region */
> +        mov     x0, #ARM_TEST_MEM_START
> +        mov     x1, #ARM_TEST_MEM_END

I don't think there's any reason to require the start and
end addresses to be hard coded. We should be able to get
the start address with

#define KERNEL_OFFSET 0x80000
           adr     x0, _start
           add     x0, x0, #(1024 * 1024 - KERNEL_OFFSET)

and the end address with

           add     x1, x0, #(99 * 1024 * 1024)

Thanks,
drew

Reply via email to