From patchwork Wed Mar 18 05:31:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 12762 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2I5YNpj011000 for ; Wed, 18 Mar 2009 05:34:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbZCRFeX (ORCPT ); Wed, 18 Mar 2009 01:34:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752502AbZCRFeX (ORCPT ); Wed, 18 Mar 2009 01:34:23 -0400 Received: from yw-out-2324.google.com ([74.125.46.29]:20221 "EHLO yw-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752093AbZCRFeW (ORCPT ); Wed, 18 Mar 2009 01:34:22 -0400 Received: by yw-out-2324.google.com with SMTP id 3so379430ywj.1 for ; Tue, 17 Mar 2009 22:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=ozwAWA9fXC+co3QLVgRXwDZUB3ezG8TWtRO3NSyFfQo=; b=myvTh1ZFqPF7pXE2fZd2orJST3JNyKo7Zt9tMDoKQx5LEPdItYkmsRAO3cYV25R4s5 0DK43RzWMeW0OQs+B+qfp+VeTz6CrPubStzv2ePbHsbyzAcCsOu/EXQYlX5su/JnzgQv fqO9YTDCkem1udZ8hdJGYSJoYGs/FiM3lPrxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=DfiL7QY3L0TCm1WyBxlN8zYmeCPWEaRQ4TRYz8b9wyeACzcfYm3jUe936GUDLGbygl Uw+LZ7IuugS6IF1wLqZQ52ZuwjU2CPrGoO9ec7JVb01Q7c41Nze37SCSvFc7WNgE+t0g 3J1T2xZISYta67YwTEA68qwyvEelFs0JkU5uY= Received: by 10.142.142.16 with SMTP id p16mr88490wfd.231.1237354460067; Tue, 17 Mar 2009 22:34:20 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id 30sm3071172wfc.24.2009.03.17.22.34.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 17 Mar 2009 22:34:19 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 18 Mar 2009 14:31:49 +0900 Message-Id: <20090318053149.22163.40168.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: simplify kexec vbr code Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Setup the vbr register in machine_kexec() instead of passing values to the assembly snippet. Signed-off-by: Magnus Damm --- arch/sh/kernel/machine_kexec.c | 16 +++++++--------- arch/sh/kernel/relocate_kernel.S | 4 ---- 2 files changed, 7 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/sh/kernel/machine_kexec.c +++ work/arch/sh/kernel/machine_kexec.c 2009-03-18 11:43:51.000000000 +0900 @@ -23,8 +23,7 @@ typedef NORET_TYPE void (*relocate_new_kernel_t)( unsigned long indirection_page, unsigned long reboot_code_buffer, - unsigned long start_address, - unsigned long vbr_reg) ATTRIB_NORET; + unsigned long start_address) ATTRIB_NORET; extern const unsigned char relocate_new_kernel[]; extern const unsigned int relocate_new_kernel_size; @@ -76,14 +75,8 @@ void machine_kexec(struct kimage *image) unsigned long page_list; unsigned long reboot_code_buffer; - unsigned long vbr_reg; relocate_new_kernel_t rnk; -#if defined(CONFIG_SH_STANDARD_BIOS) - vbr_reg = ((unsigned long )gdb_vbr_vector) - 0x100; -#else - vbr_reg = 0x80000000; // dummy -#endif /* Interrupts aren't acceptable while we reboot */ local_irq_disable(); @@ -100,9 +93,14 @@ void machine_kexec(struct kimage *image) kexec_info(image); flush_cache_all(); +#if defined(CONFIG_SH_STANDARD_BIOS) + asm volatile("ldc %0, vbr" : + : "r" (((unsigned long) gdb_vbr_vector) - 0x100) + : "memory"); +#endif /* now call it */ rnk = (relocate_new_kernel_t) reboot_code_buffer; - (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start), vbr_reg); + (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start)); } void arch_crash_save_vmcoreinfo(void) --- 0001/arch/sh/kernel/relocate_kernel.S +++ work/arch/sh/kernel/relocate_kernel.S 2009-03-18 11:43:27.000000000 +0900 @@ -16,7 +16,6 @@ relocate_new_kernel: /* r4 = indirection_page */ /* r5 = reboot_code_buffer */ /* r6 = start_address */ - /* r7 = vbr_reg */ mov.l 10f,r8 /* PAGE_SIZE */ mov.l 11f,r9 /* P2SEG */ @@ -80,9 +79,6 @@ relocate_new_kernel: bra 0b nop 6: -#ifdef CONFIG_SH_STANDARD_BIOS - ldc r7, vbr -#endif jmp @r6 nop