Changeset 8fa827c in rtems


Ignore:
Timestamp:
Oct 26, 2017, 10:51:09 PM (18 months ago)
Author:
Hesham Almatary <heshamelmatary@…>
Branches:
master
Children:
81fd79d
Parents:
11ff3a9
git-author:
Hesham Almatary <heshamelmatary@…> (10/26/17 22:51:09)
git-committer:
Hesham Almatary <heshamelmatary@…> (10/31/17 23:11:20)
Message:

bsp: Make riscv_generic work for both riscv32 and riscv64 - v2

Update #3109

Location:
c/src
Files:
1 added
1 edited
21 moved

Legend:

Unmodified
Added
Removed
  • c/src/aclocal/canonical-target-name.m4

    r11ff3a9 r8fa827c  
    99AC_MSG_CHECKING(rtems target cpu)
    1010case "${host}" in
     11riscv*-*-rtems*)
     12        RTEMS_CPU=riscv;;
    1113*-*-rtems*)
    1214        RTEMS_CPU="$host_cpu";;
  • c/src/lib/libbsp/riscv/configure.ac

    r11ff3a9 r8fa827c  
    22
    33AC_PREREQ([2.69])
    4 AC_INIT([rtems-c-src-lib-libbsp-riscv32],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
    5 AC_CONFIG_SRCDIR([../riscv32])
     4AC_INIT([rtems-c-src-lib-libbsp-riscv],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
     5AC_CONFIG_SRCDIR([../riscv])
    66RTEMS_TOP(../../../../..)
    77
  • c/src/lib/libbsp/riscv/riscv_generic/include/bsp.h

    r11ff3a9 r8fa827c  
    6161  */
    6262
    63 #define REG(x)           (*((volatile uint32_t *) (x)))
     63#define REG(x)           (*((volatile unsigned long *) (x)))
    6464#define BIT(n)           (1 << (n))
    6565
    66 #define MTIME_MM    0x0200bff8
    67 #define MTIMECMP_MM 0x02004000
     66#define MTIME_MM    0x000000000200bff8
     67#define MTIMECMP_MM 0x0000000002004000
    6868
    6969#ifdef __cplusplus
  • c/src/lib/libbsp/riscv/riscv_generic/make/custom/riscv_generic.cfg

    r11ff3a9 r8fa827c  
    11include $(RTEMS_ROOT)/make/custom/default.cfg
    22
    3 RTEMS_CPU = riscv32
     3RTEMS_CPU = riscv
    44
    55CPU_CFLAGS =
  • c/src/lib/libbsp/riscv/riscv_generic/start/start.S

    r11ff3a9 r8fa827c  
    2929#include <bsp/linker-symbols.h>
    3030#include <rtems/score/riscv-utility.h>
     31#include <rtems/score/cpu.h>
    3132#include <rtems/asm.h>
    32 
    33 # define LREG lw
    34 # define SREG sw
    3533
    3634EXTERN(bsp_section_bss_begin)
     
    9189_loop_clear_bss:
    9290  bge   t0, t1, _end_clear_bss
    93   sw    x0, 0(t0)
    94   addi  t0, t0, 4
     91  SREG    x0, 0(t0)
     92  addi  t0, t0, CPU_SIZEOF_POINTER
    9593  j     _loop_clear_bss
    9694_end_clear_bss:
     
    102100  j boot_card
    103101
    104   .align 2
     102  .align 4
    105103bsp_start_vector_table_begin:
    106104  .word _RISCV_Exception_default /* User int */
  • c/src/lib/libbsp/riscv/riscv_generic/startup/linkcmds

    r11ff3a9 r8fa827c  
    3434 */
    3535
    36 OUTPUT_FORMAT("elf32-littleriscv", "elf32-littleriscv", "elf32-littleriscv")
    3736OUTPUT_ARCH (riscv)
    3837
     
    6968bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1;
    7069
    71 bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 8;
    72 
    73 bsp_stack_main_size = DEFINED (bsp_stack_main_size) ? bsp_stack_main_size : 1024;
     70bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 16;
     71
     72bsp_stack_main_size = DEFINED (bsp_stack_main_size) ? bsp_stack_main_size : 4096;
    7473bsp_stack_main_size = ALIGN (bsp_stack_main_size, bsp_stack_align);
    7574
Note: See TracChangeset for help on using the changeset viewer.