Merge pull request #3842 from Michael0066/dev

MIPS:remove redundant #ifdef ARCH_MIPS64
This commit is contained in:
Bernard Xiong 2020-08-26 17:35:07 +08:00 committed by GitHub
commit 5b3ec9490c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 8 deletions

View File

@ -15,6 +15,7 @@ DefaultEnvironment(tools=[])
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -12,6 +12,7 @@
#include <rthw.h>
#include "mips_regs.h"
#include "mips_fpu.h"
#include "exception.h"
#include "drv_uart.h"
#include "board.h"

View File

@ -73,7 +73,7 @@ static int loongson_pin_read(struct rt_device *device, rt_base_t pin)
gpio = (void *)device->user_data;
rt_uint64_t m;
m = gpio->GPIO1_I;
m = gpio->GPIO0_I;
m &= (rt_uint64_t)1 << pin;
rc = !!m;

View File

@ -17,6 +17,8 @@
#include <rtthread.h>
#include "ls2k1000.h"
#ifdef RT_USING_RTC
struct loongson_rtc {
rt_uint32_t sys_toytrim;
rt_uint32_t sys_toywrite0;
@ -176,3 +178,5 @@ int rt_hw_rtc_init(void)
}
INIT_DEVICE_EXPORT(rt_hw_rtc_init);
#endif /*RT_USING_RTC*/

View File

@ -78,6 +78,23 @@ SECTIONS
*(.sdata.*)
}
. = ALIGN(4);
.ctors :
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
}
.dtors :
{
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
}
.stack :
{
. = ALIGN(8);

View File

@ -31,6 +31,7 @@ BUILD = 'debug'
PREFIX = 'mips-sde-elf-'
CC = PREFIX + 'gcc'
CXX = PREFIX + 'g++'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
LINK = PREFIX + 'gcc'

View File

@ -261,11 +261,7 @@ symbol = value
#define LONG_SRAV srav
#define LONG .word
#ifdef ARCH_MIPS64
#define LONGSIZE 8
#else
#define LONGSIZE 4
#endif
#define LONGMASK 3
#define LONGLOG 2

View File

@ -22,7 +22,9 @@
#ifdef RT_USING_FPU
/* Ensure CU1 (FPU) is enabled */
MFC0 v1, CP0_STATUS
ori v1, ST0_CU1
lui t1, %hi(ST0_CU1)
addiu t1, t1, %lo(ST0_CU1)
or v1, v1, t1
MTC0 v1, CP0_STATUS
SSNOP
cfc1 v1, fcr31
@ -125,11 +127,13 @@
#ifdef RT_USING_FPU
/* Ensure CU1 (FPU) is enabled */
MFC0 v1, CP0_STATUS
ori v1, ST0_CU1
lui t1, %hi(ST0_CU1)
addiu t1, t1, %lo(ST0_CU1)
or v1, v1, t1
MTC0 v1, CP0_STATUS
SSNOP
LONG_L v1, PT_FPU_FCSR31(sp)
ctc1 v1, fcsr31
ctc1 v1, fcr31
l.d $f0, PT_FPU_R0(sp)
l.d $f2, PT_FPU_R2(sp)
l.d $f4, PT_FPU_R4(sp)