From: Sam Ravnborg <sam@ravnborg.org>
To: liqin.chen@sunplusct.com
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>,
Andrew Morton <akpm@linux-foundation.org>,
torvalds@linux-foundation.org
Subject: Re: [PATCH 19/27] score: create kernel files asm-offsets.c entry.S head.S
Date: Tue, 9 Jun 2009 21:18:26 +0200 [thread overview]
Message-ID: <20090609191826.GD7181@uranus.ravnborg.org> (raw)
In-Reply-To: <OF62B83071.8F1A9FCF-ON482575D0.00241345-482575D0.0024859C@sunplusct.com>
> new file mode 100644
> index 0000000..a7432c1
> --- /dev/null
> +++ b/arch/score/kernel/head.S
> @@ -0,0 +1,70 @@
> +/*
> + * arch/score/kernel/head.S
> + *
> + * Score Processor version.
> + *
> + * Copyright (C) 2009 Sunplus Core Technology Co., Ltd.
> + * Chen Liqin <liqin.chen@sunplusct.com>
> + * Lennox Wu <lennox.wu@sunplusct.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, see the file COPYING, or write
> + * to the Free Software Foundation, Inc.,
> + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include <asm/asm-offsets.h>
> +
> + .extern start_kernel
> + .global init_thread_union
> + .global kernelsp
> +
> + .section .init.text, "ax"
Please use section definitions from include/linux/init.h.
__INIT in this case.
Other architectures uses __HEAD so they have full control
on where to add this code in the final image.
> + .align 2;
> + .globl _stext;
> +_stext:
Usually a linker defined symbol?
> + la r30, __bss_start /* initialize BSS segment. */
> + la r31, _end
> + xor r8, r8, r8
> +
> +1: cmp.c r31, r30
> + beq 2f
> +
> + sw r8, [r30] /* clean memory. */
> + addi r30, 4
> + b 1b
> +
> +2: la r28, init_thread_union /* set kernel stack. */
> + mv r0, r28
> + addi r0, KERNEL_STACK_SIZE - 32
> + la r30, kernelsp
> + sw r0, [r30]
> + subi r0, 4*4
> + xor r30, r30, r30
> + ori r30, 0x02 /* enable MMU. */
> + mtcr r30, cr4
> + nop
> + nop
> + nop
> + nop
> + nop
> + nop
> + nop
> +
> + /* there is no parameter */
> + xor r4, r4, r4
> + xor r5, r5, r5
> + xor r6, r6, r6
> + xor r7, r7, r7
> + la r30, start_kernel /* jump to init_arch */
> + br r30
Sam
next prev parent reply other threads:[~2009-06-09 19:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 6:34 liqin.chen
2009-06-09 19:18 ` Sam Ravnborg [this message]
2009-06-13 6:58 ` liqin.chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090609191826.GD7181@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liqin.chen@sunplusct.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®