Changeset d7ef14b in mainline for kernel/arch/arm32/src/mach


Ignore:
Timestamp:
2010-06-25T20:58:06Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12b0d51
Parents:
1590e23
Message:

Link kernel to the proper base address for gta02. Change machine_get_memory_size() to machine_get_memory_extents() and trivially implement for gta02.

Location:
kernel/arch/arm32/src/mach
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mach/gta02/gta02.c

    r1590e23 rd7ef14b  
    3636#include <arch/exception.h>
    3737#include <arch/mach/gta02/gta02.h>
     38#include <arch/mm/page.h>
     39
     40#define GTA02_MEMORY_START      0x30000000      /* physical */
     41#define GTA02_MEMORY_SIZE       0x08000000      /* 128 MB */
     42#define GTA02_MEMORY_SKIP       0x8000          /* 2 pages */
    3843
    3944static void gta02_init(void);
    4045static void gta02_timer_irq_start(void);
    4146static void gta02_cpu_halt(void);
    42 static uintptr_t gta02_get_memory_size(void);
     47static void gta02_get_memory_extents(uintptr_t *start, uintptr_t *size);
    4348static void gta02_irq_exception(unsigned int exc_no, istate_t *istate);
    4449static void gta02_frame_init(void);
     
    5055        gta02_timer_irq_start,
    5156        gta02_cpu_halt,
    52         gta02_get_memory_size,
     57        gta02_get_memory_extents,
    5358        gta02_irq_exception,
    5459        gta02_frame_init,
     
    6974}
    7075
    71 static uintptr_t gta02_get_memory_size(void)
     76/** Get extents of available memory.
     77 *
     78 * @param start         Place to store memory start address.
     79 * @param size          Place to store memory size.
     80 */
     81static void gta02_get_memory_extents(uintptr_t *start, uintptr_t *size)
    7282{
    73         return 0;
     83        *start = PA2KA(GTA02_MEMORY_START) + GTA02_MEMORY_SKIP;
     84        *size  = GTA02_MEMORY_SIZE - GTA02_MEMORY_SKIP;
    7485}
    7586
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    r1590e23 rd7ef14b  
    6060        icp_timer_irq_start,
    6161        icp_cpu_halt,
    62         icp_get_memory_size,
     62        icp_get_memory_extents,
    6363        icp_irq_exception,
    6464        icp_frame_init,
     
    214214}
    215215
    216 /** Returns the size of emulated memory.
    217  *
    218  * @return Size in bytes.
    219  */
    220 size_t icp_get_memory_size(void)
    221 {
     216/** Get extents of available memory.
     217 *
     218 * @param start         Place to store memory start address.
     219 * @param size          Place to store memory size.
     220 */
     221void icp_get_memory_extents(uintptr_t *start, uintptr_t *size)
     222{
     223        *start = 0;
     224
    222225        if (hw_map_init_called) {
    223                 return (sdram[((*(uint32_t *)icp_hw_map.sdramcr & ICP_SDRAM_MASK) >> 2)]);
     226                *size = (sdram[((*(uint32_t *)icp_hw_map.sdramcr &
     227                    ICP_SDRAM_MASK) >> 2)]);
    224228        } else {
    225                 return SDRAM_SIZE;
    226         }
    227        
     229                *size = SDRAM_SIZE;
     230        }
    228231}
    229232
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    r1590e23 rd7ef14b  
    6060        gxemul_timer_irq_start,
    6161        gxemul_cpu_halt,
    62         gxemul_get_memory_size,
     62        gxemul_get_memory_extents,
    6363        gxemul_irq_exception,
    6464        gxemul_frame_init,
     
    185185}
    186186
    187 /** Returns the size of emulated memory.
    188  *
    189  * @return Size in bytes.
    190  */
    191 uintptr_t gxemul_get_memory_size(void)
    192 {
    193         return  *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET));
    194 }
    195 
     187/** Get extents of available memory.
     188 *
     189 * @param start         Place to store memory start address.
     190 * @param size          Place to store memory size.
     191 */
     192void gxemul_get_memory_size(uintptr_t *start, uintptr_t *size)
     193{
     194        start = 0;
     195        size = *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET));
     196}
    196197
    197198/** Returns the mask of active interrupts. */
Note: See TracChangeset for help on using the changeset viewer.