Skip to content

Commit 46a1b6b

Browse files
committed
Merge tag 'nios2_update_for_v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux
Pull NIOS2 updates from Dinh Nguyen: - Replace __ASSEMBLY__ with __ASSEMBLER__ in headers - Set memblock.current_limit when setting pfn limits * tag 'nios2_update_for_v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: nios2: ensure that memblock.current_limit is set when setting pfn limits nios2: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers nios2: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
2 parents e129e47 + a20b83c commit 46a1b6b

10 files changed

Lines changed: 32 additions & 17 deletions

File tree

arch/nios2/include/asm/entry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef _ASM_NIOS2_ENTRY_H
1111
#define _ASM_NIOS2_ENTRY_H
1212

13-
#ifdef __ASSEMBLY__
13+
#ifdef __ASSEMBLER__
1414

1515
#include <asm/processor.h>
1616
#include <asm/registers.h>
@@ -117,5 +117,5 @@
117117
addi sp, sp, SWITCH_STACK_SIZE
118118
.endm
119119

120-
#endif /* __ASSEMBLY__ */
120+
#endif /* __ASSEMBLER__ */
121121
#endif /* _ASM_NIOS2_ENTRY_H */

arch/nios2/include/asm/page.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define PAGE_OFFSET \
2727
(CONFIG_NIOS2_MEM_BASE + CONFIG_NIOS2_KERNEL_REGION_BASE)
2828

29-
#ifndef __ASSEMBLY__
29+
#ifndef __ASSEMBLER__
3030

3131
/*
3232
* This gives the physical RAM offset.
@@ -90,6 +90,6 @@ extern struct page *mem_map;
9090

9191
#include <asm-generic/getorder.h>
9292

93-
#endif /* !__ASSEMBLY__ */
93+
#endif /* !__ASSEMBLER__ */
9494

9595
#endif /* _ASM_NIOS2_PAGE_H */

arch/nios2/include/asm/processor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/* Kuser helpers is mapped to this user space address */
3737
#define KUSER_BASE 0x1000
3838
#define KUSER_SIZE (PAGE_SIZE)
39-
#ifndef __ASSEMBLY__
39+
#ifndef __ASSEMBLER__
4040

4141
# define TASK_SIZE 0x7FFF0000UL
4242
# define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
@@ -72,6 +72,6 @@ extern unsigned long __get_wchan(struct task_struct *p);
7272

7373
#define cpu_relax() barrier()
7474

75-
#endif /* __ASSEMBLY__ */
75+
#endif /* __ASSEMBLER__ */
7676

7777
#endif /* _ASM_NIOS2_PROCESSOR_H */

arch/nios2/include/asm/ptrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/* This struct defines the way the registers are stored on the
1919
stack during a system call. */
2020

21-
#ifndef __ASSEMBLY__
21+
#ifndef __ASSEMBLER__
2222
struct pt_regs {
2323
unsigned long r8; /* r8-r15 Caller-saved GP registers */
2424
unsigned long r9;
@@ -78,5 +78,5 @@ extern void show_regs(struct pt_regs *);
7878

7979
int do_syscall_trace_enter(void);
8080
void do_syscall_trace_exit(void);
81-
#endif /* __ASSEMBLY__ */
81+
#endif /* __ASSEMBLER__ */
8282
#endif /* _ASM_NIOS2_PTRACE_H */

arch/nios2/include/asm/registers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef _ASM_NIOS2_REGISTERS_H
77
#define _ASM_NIOS2_REGISTERS_H
88

9-
#ifndef __ASSEMBLY__
9+
#ifndef __ASSEMBLER__
1010
#include <asm/cpuinfo.h>
1111
#endif
1212

@@ -44,7 +44,7 @@
4444

4545
/* tlbmisc register bits */
4646
#define TLBMISC_PID_SHIFT 4
47-
#ifndef __ASSEMBLY__
47+
#ifndef __ASSEMBLER__
4848
#define TLBMISC_PID_MASK ((1UL << cpuinfo.tlb_pid_num_bits) - 1)
4949
#endif
5050
#define TLBMISC_WAY_MASK 0xf

arch/nios2/include/asm/setup.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <asm-generic/setup.h>
1010

11-
#ifndef __ASSEMBLY__
11+
#ifndef __ASSEMBLER__
1212
#ifdef __KERNEL__
1313

1414
extern char exception_handler_hook[];
@@ -18,6 +18,6 @@ extern char fast_handler_end[];
1818
extern void pagetable_init(void);
1919

2020
#endif/* __KERNEL__ */
21-
#endif /* __ASSEMBLY__ */
21+
#endif /* __ASSEMBLER__ */
2222

2323
#endif /* _ASM_NIOS2_SETUP_H */

arch/nios2/include/asm/thread_info.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define THREAD_SIZE_ORDER 1
2525
#define THREAD_SIZE 8192 /* 2 * PAGE_SIZE */
2626

27-
#ifndef __ASSEMBLY__
27+
#ifndef __ASSEMBLER__
2828

2929
/*
3030
* low level task data that entry.S needs immediate access to
@@ -61,7 +61,7 @@ static inline struct thread_info *current_thread_info(void)
6161

6262
return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
6363
}
64-
#endif /* !__ASSEMBLY__ */
64+
#endif /* !__ASSEMBLER__ */
6565

6666
/*
6767
* thread information flags

arch/nios2/include/asm/traps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#define TRAP_ID_SYSCALL 0
1414

15-
#ifndef __ASSEMBLY__
15+
#ifndef __ASSEMBLER__
1616
void _exception(int signo, struct pt_regs *regs, int code, unsigned long addr);
1717
void do_page_fault(struct pt_regs *regs, unsigned long cause,
1818
unsigned long address);

arch/nios2/include/uapi/asm/ptrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef _UAPI_ASM_NIOS2_PTRACE_H
1414
#define _UAPI_ASM_NIOS2_PTRACE_H
1515

16-
#ifndef __ASSEMBLY__
16+
#ifndef __ASSEMBLER__
1717

1818
#include <linux/types.h>
1919

@@ -80,5 +80,5 @@ struct user_pt_regs {
8080
__u32 regs[49];
8181
};
8282

83-
#endif /* __ASSEMBLY__ */
83+
#endif /* __ASSEMBLER__ */
8484
#endif /* _UAPI_ASM_NIOS2_PTRACE_H */

arch/nios2/kernel/setup.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low,
142142
*max_high = PFN_DOWN(memblock_end_of_DRAM());
143143
}
144144

145+
static void __init adjust_lowmem_bounds(void)
146+
{
147+
phys_addr_t block_start, block_end;
148+
u64 i;
149+
phys_addr_t memblock_limit = 0;
150+
151+
for_each_mem_range(i, &block_start, &block_end) {
152+
if (block_end > memblock_limit)
153+
memblock_limit = block_end;
154+
}
155+
156+
memblock_set_current_limit(memblock_limit);
157+
}
158+
145159
void __init setup_arch(char **cmdline_p)
146160
{
147161
console_verbose();
@@ -157,6 +171,7 @@ void __init setup_arch(char **cmdline_p)
157171
/* Keep a copy of command line */
158172
*cmdline_p = boot_command_line;
159173

174+
adjust_lowmem_bounds();
160175
find_limits(&min_low_pfn, &max_low_pfn, &max_pfn);
161176

162177
memblock_reserve(__pa_symbol(_stext), _end - _stext);

0 commit comments

Comments
 (0)