Skip to content

Commit 5b3ec94

Browse files
authored
Merge pull request #3842 from Michael0066/dev
MIPS:remove redundant #ifdef ARCH_MIPS64
2 parents 241a29a + 52a4bac commit 5b3ec94

File tree

8 files changed

+32
-8
lines changed

8 files changed

+32
-8
lines changed

bsp/ls2kdev/SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ DefaultEnvironment(tools=[])
1515
env = Environment(tools = ['mingw'],
1616
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
1717
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
18+
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
1819
AR = rtconfig.AR, ARFLAGS = '-rc',
1920
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
2021
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

bsp/ls2kdev/drivers/board.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <rthw.h>
1313

1414
#include "mips_regs.h"
15+
#include "mips_fpu.h"
1516
#include "exception.h"
1617
#include "drv_uart.h"
1718
#include "board.h"

bsp/ls2kdev/drivers/drv_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int loongson_pin_read(struct rt_device *device, rt_base_t pin)
7373
gpio = (void *)device->user_data;
7474
rt_uint64_t m;
7575

76-
m = gpio->GPIO1_I;
76+
m = gpio->GPIO0_I;
7777
m &= (rt_uint64_t)1 << pin;
7878

7979
rc = !!m;

bsp/ls2kdev/drivers/drv_rtc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <rtthread.h>
1818
#include "ls2k1000.h"
1919

20+
#ifdef RT_USING_RTC
21+
2022
struct loongson_rtc {
2123
rt_uint32_t sys_toytrim;
2224
rt_uint32_t sys_toywrite0;
@@ -176,3 +178,5 @@ int rt_hw_rtc_init(void)
176178
}
177179

178180
INIT_DEVICE_EXPORT(rt_hw_rtc_init);
181+
182+
#endif /*RT_USING_RTC*/

bsp/ls2kdev/ls2k_ram.lds

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ SECTIONS
7878
*(.sdata.*)
7979
}
8080

81+
. = ALIGN(4);
82+
.ctors :
83+
{
84+
PROVIDE(__ctors_start__ = .);
85+
KEEP(*(SORT(.ctors.*)))
86+
KEEP(*(.ctors))
87+
PROVIDE(__ctors_end__ = .);
88+
}
89+
90+
.dtors :
91+
{
92+
PROVIDE(__dtors_start__ = .);
93+
KEEP(*(SORT(.dtors.*)))
94+
KEEP(*(.dtors))
95+
PROVIDE(__dtors_end__ = .);
96+
}
97+
8198
.stack :
8299
{
83100
. = ALIGN(8);

bsp/ls2kdev/rtconfig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
PREFIX = 'mips-sde-elf-'
3333
CC = PREFIX + 'gcc'
34+
CXX = PREFIX + 'g++'
3435
AS = PREFIX + 'gcc'
3536
AR = PREFIX + 'ar'
3637
LINK = PREFIX + 'gcc'

libcpu/mips/common/asm.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,7 @@ symbol = value
261261
#define LONG_SRAV srav
262262

263263
#define LONG .word
264-
#ifdef ARCH_MIPS64
265-
#define LONGSIZE 8
266-
#else
267264
#define LONGSIZE 4
268-
#endif
269265
#define LONGMASK 3
270266
#define LONGLOG 2
271267

libcpu/mips/common/stackframe.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#ifdef RT_USING_FPU
2323
/* Ensure CU1 (FPU) is enabled */
2424
MFC0 v1, CP0_STATUS
25-
ori v1, ST0_CU1
25+
lui t1, %hi(ST0_CU1)
26+
addiu t1, t1, %lo(ST0_CU1)
27+
or v1, v1, t1
2628
MTC0 v1, CP0_STATUS
2729
SSNOP
2830
cfc1 v1, fcr31
@@ -125,11 +127,13 @@
125127
#ifdef RT_USING_FPU
126128
/* Ensure CU1 (FPU) is enabled */
127129
MFC0 v1, CP0_STATUS
128-
ori v1, ST0_CU1
130+
lui t1, %hi(ST0_CU1)
131+
addiu t1, t1, %lo(ST0_CU1)
132+
or v1, v1, t1
129133
MTC0 v1, CP0_STATUS
130134
SSNOP
131135
LONG_L v1, PT_FPU_FCSR31(sp)
132-
ctc1 v1, fcsr31
136+
ctc1 v1, fcr31
133137
l.d $f0, PT_FPU_R0(sp)
134138
l.d $f2, PT_FPU_R2(sp)
135139
l.d $f4, PT_FPU_R4(sp)

0 commit comments

Comments
 (0)