Correcting banked vs. non-banked issues (there are more)

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3320 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-02-26 22:29:46 +00:00
parent d5e7ff76b1
commit 953baaa76a
6 changed files with 737 additions and 30 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
############################################################################ ############################################################################
# arch/hc/src/Makefile # arch/hc/src/Makefile
# #
# Copyright (C) 2009 Gregory Nutt. All rights reserved. # Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr> # Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
File diff suppressed because it is too large Load Diff
+11 -3
View File
@@ -52,6 +52,14 @@
* Private Definitions * Private Definitions
**************************************************************************/ **************************************************************************/
#ifdef CONFIG_HCS12_NONBANKED
# define CALL jsr
# define RETURN rts
#else
# define CALL call
# define RETURN rtc
#endif
/* Select SCI parameters for the selected console */ /* Select SCI parameters for the selected console */
#if defined(CONFIG_SCI0_SERIAL_CONSOLE) #if defined(CONFIG_SCI0_SERIAL_CONSOLE)
@@ -166,7 +174,7 @@ up_lowsetup:
#endif /* CONFIG_HCS12_SERIALMON */ #endif /* CONFIG_HCS12_SERIALMON */
#endif /* HAVE_SERIAL_CONSOLE */ #endif /* HAVE_SERIAL_CONSOLE */
rts RETURN
.size up_lowsetup, . - up_lowsetup .size up_lowsetup, . - up_lowsetup
/************************************************************************** /**************************************************************************
@@ -207,11 +215,11 @@ up_lowputc:
#endif /* HCS12_CONSOLE_BITS == 9 */ #endif /* HCS12_CONSOLE_BITS == 9 */
stab (HCS12_CONSOLE_BASE+HCS12_SCI_DRL_OFFSET) stab (HCS12_CONSOLE_BASE+HCS12_SCI_DRL_OFFSET)
rts RETURN
#endif /* !CONFIG_HCS12_SERIALMON */ #endif /* !CONFIG_HCS12_SERIALMON */
#else #else
rts RETURN
#endif /* HAVE_SERIAL_CONSOLE */ #endif /* HAVE_SERIAL_CONSOLE */
.size up_lowputc, . - up_lowputc .size up_lowputc, . - up_lowputc
.end .end
+9 -1
View File
@@ -48,6 +48,14 @@
* Private Definitions * Private Definitions
**************************************************************************/ **************************************************************************/
#ifdef CONFIG_HCS12_NONBANKED
# define CALL jsr
# define RETURN rts
#else
# define CALL call
# define RETURN rtc
#endif
/************************************************************************** /**************************************************************************
* Private Types * Private Types
**************************************************************************/ **************************************************************************/
@@ -176,6 +184,6 @@ up_saveusercontext:
#endif #endif
clra clra
clrb clrb
rts RETURN
.size up_saveusercontext, . - up_saveusercontext .size up_saveusercontext, . - up_saveusercontext
.end .end
+14 -23
View File
@@ -51,6 +51,14 @@
* Private Definitions * Private Definitions
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_HCS12_NONBANKED
# define CALL jsr
# define RETURN rts
#else
# define CALL call
# define RETURN rtc
#endif
#define INITRG_REG (MMC_INITRG_REG(HCS12_REG_BASE)) #define INITRG_REG (MMC_INITRG_REG(HCS12_REG_BASE))
#define INITRM_MAP (MMC_INITRM_RAM(HCS12_SRAM_BASE)|MMC_INITRM_RAMHAL) #define INITRM_MAP (MMC_INITRM_RAM(HCS12_SRAM_BASE)|MMC_INITRM_RAMHAL)
#define INITEE_EE (MMC_INITEE_EE(HCS12_EEPROM_BASE)|MMC_INITEE_EEON) #define INITEE_EE (MMC_INITEE_EE(HCS12_EEPROM_BASE)|MMC_INITEE_EEON)
@@ -79,11 +87,7 @@
#ifdef CONFIG_HCS12_SERIALMON #ifdef CONFIG_HCS12_SERIALMON
jsr #PutChar jsr #PutChar
#else #else
#ifdef CONFIG_HCS12_NONBANKED CALL up_lowputc
jsr up_lowputc
#else
call up_lowputc
#endif
#endif #endif
#endif #endif
.endm .endm
@@ -107,8 +111,8 @@
movb #INITRM_MAP, HCS12_MMC_INITRM /* Set RAM position to 0x2000-0x3fff */ movb #INITRM_MAP, HCS12_MMC_INITRM /* Set RAM position to 0x2000-0x3fff */
movb #INITEE_EE, HCS12_MMC_INITEE /* Set EEPROM position to 0x0800 */ movb #INITEE_EE, HCS12_MMC_INITEE /* Set EEPROM position to 0x0800 */
/* In the non-banked mode, PPAGE is set to 0x3d to create a contiguous, 48Kb /* In the non-banked mode, PPAGE is set to 0x3d to create a (non-contiguous),
* .text address space. * fixed, 48Kb .text address space.
*/ */
#ifdef CONFIG_HCS12_NONBANKED #ifdef CONFIG_HCS12_NONBANKED
@@ -176,11 +180,7 @@ __start:
/* Perform early, low-level initialization */ /* Perform early, low-level initialization */
#ifndef CONFIG_HCS12_SERIALMON #ifndef CONFIG_HCS12_SERIALMON
#ifdef CONFIG_HCS12_NONBANKED CALL up_lowsetup
jsr up_lowsetup
#else
call up_lowsetup
#endif
#endif #endif
showprogress 'A' showprogress 'A'
@@ -219,21 +219,13 @@ __start:
/* Perform early board-level initialization */ /* Perform early board-level initialization */
#ifdef CONFIG_HCS12_NONBANKED CALL hcs12_boardinitialize
jsr hcs12_boardinitialize
#else
call hcs12_boardinitialize
#endif
showprogress 'D' showprogress 'D'
/* Now, start the OS */ /* Now, start the OS */
showprogress '\n' showprogress '\n'
#ifdef CONFIG_HCS12_NONBANKED CALL os_start
jsr os_start
#else
call os_start
#endif
bra __start bra __start
/* Variables: /* Variables:
@@ -259,7 +251,6 @@ __start:
.hword _edata .hword _edata
.size __start, .-__start .size __start, .-__start
/************************************************************************************ /************************************************************************************
* .rodata * .rodata
************************************************************************************/ ************************************************************************************/
+10 -2
View File
@@ -45,6 +45,14 @@
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_HCS12_NONBANKED
# define CALL jsr
# define RETURN rts
#else
# define CALL call
# define RETURN rtc
#endif
/************************************************************************************ /************************************************************************************
* Global Symbols * Global Symbols
************************************************************************************/ ************************************************************************************/
@@ -161,7 +169,7 @@ hcs12_vectors:
* .text * .text
************************************************************************************/ ************************************************************************************/
.text .section nonbanked, "x"
.type handlers, function .type handlers, function
handlers: handlers:
@@ -301,7 +309,7 @@ vcommon:
/* Recover the IRQ number and call up_doirq() */ /* Recover the IRQ number and call up_doirq() */
ldab .Lbsave ldab .Lbsave
bsr up_doirq CALL up_doirq
leas 2, sp leas 2, sp
/* Check if the return value in d is the same as regs parameter passed in the TOS */ /* Check if the return value in d is the same as regs parameter passed in the TOS */