You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: (33 commits) microblaze: Do not copy reset vectors/manual reset vector setup microblaze: Fix _reset function microblaze: Fix microblaze init vectors microblaze: Fix circular headers dependency when ftrace is enabled. microblaze: Fix typo in Kconfig microblaze: Add missing export symbols for lib functions microblaze: Fix /dev/zero corruption from __clear_user() microblaze: Convert irq_chip to new functions microblaze: Select GENERIC_HARDIRQS_NO_DEPRECATED microblaze: Remove stale irq_chip.end microblaze: Fix sparse warnings - signal.c microblaze: Fix sparse warning - fault.c microblaze: Fix missing microblaze specific syscalls declaration microblaze: Fix sparse warnings - cache.c microblaze: Fix sparse warning - cpuinfo.h microblaze: Fix sparse warning - unwind.c microblaze: Fix sparse warning - consistent_alloc function microblaze: Fix sparse warnings - ptrace microblaze: Fix sparse warning - sw_exceptions microblaze: Fix sparse warning - timer.c ...
This commit is contained in:
+13
-1
@@ -17,6 +17,7 @@ config MICROBLAZE
|
||||
select OF_EARLY_FLATTREE
|
||||
select HAVE_GENERIC_HARDIRQS
|
||||
select GENERIC_IRQ_PROBE
|
||||
select GENERIC_HARDIRQS_NO_DEPRECATED
|
||||
|
||||
config SWAP
|
||||
def_bool n
|
||||
@@ -183,6 +184,17 @@ config LOWMEM_SIZE
|
||||
hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
|
||||
default "0x30000000"
|
||||
|
||||
config MANUAL_RESET_VECTOR
|
||||
hex "Microblaze reset vector address setup"
|
||||
default "0x0"
|
||||
help
|
||||
Set this option to have the kernel override the CPU Reset vector.
|
||||
If zero, no change will be made to the MicroBlaze reset vector at
|
||||
address 0x0.
|
||||
If non-zero, a jump instruction to this address, will be written
|
||||
to the reset vector at address 0x0.
|
||||
If you are unsure, set it to default value 0x0.
|
||||
|
||||
config KERNEL_START_BOOL
|
||||
bool "Set custom kernel base address"
|
||||
depends on ADVANCED_OPTIONS
|
||||
@@ -247,7 +259,7 @@ endmenu
|
||||
|
||||
source "mm/Kconfig"
|
||||
|
||||
menu "Exectuable file formats"
|
||||
menu "Executable file formats"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
||||
|
||||
@@ -84,12 +84,13 @@ do { \
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
|
||||
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
|
||||
|
||||
#define flush_cache_page(vma, vmaddr, pfn) \
|
||||
flush_dcache_range(pfn << PAGE_SHIFT, (pfn << PAGE_SHIFT) + PAGE_SIZE);
|
||||
|
||||
/* MS: kgdb code use this macro, wrong len with FLASH */
|
||||
#if 0
|
||||
@@ -104,9 +105,13 @@ do { \
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
do { \
|
||||
u32 addr = virt_to_phys(dst); \
|
||||
invalidate_icache_range((unsigned) (addr), (unsigned) (addr) + (len));\
|
||||
memcpy((dst), (src), (len)); \
|
||||
flush_dcache_range((unsigned) (addr), (unsigned) (addr) + (len));\
|
||||
if (vma->vm_flags & VM_EXEC) { \
|
||||
invalidate_icache_range((unsigned) (addr), \
|
||||
(unsigned) (addr) + PAGE_SIZE); \
|
||||
flush_dcache_range((unsigned) (addr), \
|
||||
(unsigned) (addr) + PAGE_SIZE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
|
||||
@@ -96,8 +96,8 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
|
||||
|
||||
static inline unsigned int fcpu(struct device_node *cpu, char *n)
|
||||
{
|
||||
int *val;
|
||||
return (val = (int *) of_get_property(cpu, n, NULL)) ?
|
||||
const __be32 *val;
|
||||
return (val = of_get_property(cpu, n, NULL)) ?
|
||||
be32_to_cpup(val) : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,40 +31,4 @@ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
|
||||
DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
|
||||
# endif /* __ASSEMBLY__ */
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
|
||||
/* noMMU hasn't any space for args */
|
||||
# define STATE_SAVE_ARG_SPACE (0)
|
||||
|
||||
#else /* CONFIG_MMU */
|
||||
|
||||
/* If true, system calls save and restore all registers (except result
|
||||
* registers, of course). If false, then `call clobbered' registers
|
||||
* will not be preserved, on the theory that system calls are basically
|
||||
* function calls anyway, and the caller should be able to deal with it.
|
||||
* This is a security risk, of course, as `internal' values may leak out
|
||||
* after a system call, but that certainly doesn't matter very much for
|
||||
* a processor with no MMU protection! For a protected-mode kernel, it
|
||||
* would be faster to just zero those registers before returning.
|
||||
*
|
||||
* I can not rely on the glibc implementation. If you turn it off make
|
||||
* sure that r11/r12 is saved in user-space. --KAA
|
||||
*
|
||||
* These are special variables using by the kernel trap/interrupt code
|
||||
* to save registers in, at a time when there are no spare registers we
|
||||
* can use to do so, and we can't depend on the value of the stack
|
||||
* pointer. This means that they must be within a signed 16-bit
|
||||
* displacement of 0x00000000.
|
||||
*/
|
||||
|
||||
/* A `state save frame' is a struct pt_regs preceded by some extra space
|
||||
* suitable for a function call stack frame. */
|
||||
|
||||
/* Amount of room on the stack reserved for arguments and to satisfy the
|
||||
* C calling conventions, in addition to the space used by the struct
|
||||
* pt_regs that actually holds saved values. */
|
||||
#define STATE_SAVE_ARG_SPACE (6*4) /* Up to six arguments */
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
#endif /* _ASM_MICROBLAZE_ENTRY_H */
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
|
||||
int fsr, int addr);
|
||||
|
||||
asmlinkage void sw_exception(struct pt_regs *regs);
|
||||
void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig);
|
||||
|
||||
void die(const char *str, struct pt_regs *fp, long err);
|
||||
void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#define NR_IRQS 32
|
||||
#include <asm-generic/irq.h>
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
/* This type is the placeholder for a hardware interrupt number. It has to
|
||||
* be big enough to enclose whatever representation is used by a given
|
||||
* platform.
|
||||
|
||||
@@ -572,7 +572,7 @@ void __init *early_get_page(void);
|
||||
|
||||
extern unsigned long ioremap_bot, ioremap_base;
|
||||
|
||||
void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle);
|
||||
void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle);
|
||||
void consistent_free(size_t size, void *vaddr);
|
||||
void consistent_sync(void *vaddr, size_t size, int direction);
|
||||
void consistent_sync_page(struct page *page, unsigned long offset,
|
||||
|
||||
@@ -155,7 +155,7 @@ unsigned long get_wchan(struct task_struct *p);
|
||||
# define task_regs(task) ((struct pt_regs *)task_tos(task) - 1)
|
||||
|
||||
# define task_pt_regs_plus_args(tsk) \
|
||||
(((void *)task_pt_regs(tsk)) - STATE_SAVE_ARG_SPACE)
|
||||
((void *)task_pt_regs(tsk))
|
||||
|
||||
# define task_sp(task) (task_regs(task)->r1)
|
||||
# define task_pc(task) (task_regs(task)->pc)
|
||||
|
||||
@@ -66,13 +66,13 @@ void show_regs(struct pt_regs *);
|
||||
#else /* __KERNEL__ */
|
||||
|
||||
/* pt_regs offsets used by gdbserver etc in ptrace syscalls */
|
||||
#define PT_GPR(n) ((n) * sizeof(microblaze_reg_t))
|
||||
#define PT_PC (32 * sizeof(microblaze_reg_t))
|
||||
#define PT_MSR (33 * sizeof(microblaze_reg_t))
|
||||
#define PT_EAR (34 * sizeof(microblaze_reg_t))
|
||||
#define PT_ESR (35 * sizeof(microblaze_reg_t))
|
||||
#define PT_FSR (36 * sizeof(microblaze_reg_t))
|
||||
#define PT_KERNEL_MODE (37 * sizeof(microblaze_reg_t))
|
||||
#define PT_GPR(n) ((n) * sizeof(microblaze_reg_t))
|
||||
#define PT_PC (32 * sizeof(microblaze_reg_t))
|
||||
#define PT_MSR (33 * sizeof(microblaze_reg_t))
|
||||
#define PT_EAR (34 * sizeof(microblaze_reg_t))
|
||||
#define PT_ESR (35 * sizeof(microblaze_reg_t))
|
||||
#define PT_FSR (36 * sizeof(microblaze_reg_t))
|
||||
#define PT_KERNEL_MODE (37 * sizeof(microblaze_reg_t))
|
||||
|
||||
#endif /* __KERNEL */
|
||||
|
||||
|
||||
@@ -96,4 +96,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
|
||||
microblaze_set_syscall_arg(regs, i++, *args++);
|
||||
}
|
||||
|
||||
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
|
||||
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
|
||||
|
||||
#endif /* __ASM_MICROBLAZE_SYSCALL_H */
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#ifndef __ASM_MICROBLAZE_SYSCALLS_H
|
||||
|
||||
asmlinkage long microblaze_vfork(struct pt_regs *regs);
|
||||
asmlinkage long microblaze_clone(int flags, unsigned long stack,
|
||||
struct pt_regs *regs);
|
||||
asmlinkage long microblaze_execve(const char __user *filenamei,
|
||||
const char __user *const __user *argv,
|
||||
const char __user *const __user *envp,
|
||||
struct pt_regs *regs);
|
||||
|
||||
asmlinkage long sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
|
||||
#define sys_clone sys_clone
|
||||
|
||||
|
||||
@@ -120,16 +120,16 @@ static inline unsigned long __must_check __clear_user(void __user *to,
|
||||
{
|
||||
/* normal memset with two words to __ex_table */
|
||||
__asm__ __volatile__ ( \
|
||||
"1: sb r0, %2, r0;" \
|
||||
"1: sb r0, %1, r0;" \
|
||||
" addik %0, %0, -1;" \
|
||||
" bneid %0, 1b;" \
|
||||
" addik %2, %2, 1;" \
|
||||
" addik %1, %1, 1;" \
|
||||
"2: " \
|
||||
__EX_TABLE_SECTION \
|
||||
".word 1b,2b;" \
|
||||
".previous;" \
|
||||
: "=r"(n) \
|
||||
: "0"(n), "r"(to)
|
||||
: "=r"(n), "=r"(to) \
|
||||
: "0"(n), "1"(to)
|
||||
);
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -12,18 +12,19 @@
|
||||
|
||||
# ifdef __KERNEL__
|
||||
|
||||
# include <linux/unaligned/be_byteshift.h>
|
||||
# include <linux/unaligned/le_byteshift.h>
|
||||
# include <linux/unaligned/generic.h>
|
||||
|
||||
|
||||
# ifdef __MICROBLAZEEL__
|
||||
# include <linux/unaligned/le_struct.h>
|
||||
# include <linux/unaligned/be_byteshift.h>
|
||||
# define get_unaligned __get_unaligned_le
|
||||
# define put_unaligned __put_unaligned_le
|
||||
# else
|
||||
# include <linux/unaligned/be_struct.h>
|
||||
# include <linux/unaligned/le_byteshift.h>
|
||||
# define get_unaligned __get_unaligned_be
|
||||
# define put_unaligned __put_unaligned_be
|
||||
# endif
|
||||
|
||||
# include <linux/unaligned/generic.h>
|
||||
|
||||
# endif /* __KERNEL__ */
|
||||
#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
|
||||
|
||||
@@ -519,7 +519,7 @@ static void __flush_dcache_range_wb(unsigned long start, unsigned long end)
|
||||
struct scache *mbc;
|
||||
|
||||
/* new wb cache model */
|
||||
const struct scache wb_msr = {
|
||||
static const struct scache wb_msr = {
|
||||
.ie = __enable_icache_msr,
|
||||
.id = __disable_icache_msr,
|
||||
.ifl = __flush_icache_all_noirq,
|
||||
@@ -535,7 +535,7 @@ const struct scache wb_msr = {
|
||||
};
|
||||
|
||||
/* There is only difference in ie, id, de, dd functions */
|
||||
const struct scache wb_nomsr = {
|
||||
static const struct scache wb_nomsr = {
|
||||
.ie = __enable_icache_nomsr,
|
||||
.id = __disable_icache_nomsr,
|
||||
.ifl = __flush_icache_all_noirq,
|
||||
@@ -551,7 +551,7 @@ const struct scache wb_nomsr = {
|
||||
};
|
||||
|
||||
/* Old wt cache model with disabling irq and turn off cache */
|
||||
const struct scache wt_msr = {
|
||||
static const struct scache wt_msr = {
|
||||
.ie = __enable_icache_msr,
|
||||
.id = __disable_icache_msr,
|
||||
.ifl = __flush_icache_all_msr_irq,
|
||||
@@ -566,7 +566,7 @@ const struct scache wt_msr = {
|
||||
.dinr = __invalidate_dcache_range_msr_irq_wt,
|
||||
};
|
||||
|
||||
const struct scache wt_nomsr = {
|
||||
static const struct scache wt_nomsr = {
|
||||
.ie = __enable_icache_nomsr,
|
||||
.id = __disable_icache_nomsr,
|
||||
.ifl = __flush_icache_all_nomsr_irq,
|
||||
@@ -582,7 +582,7 @@ const struct scache wt_nomsr = {
|
||||
};
|
||||
|
||||
/* New wt cache model for newer Microblaze versions */
|
||||
const struct scache wt_msr_noirq = {
|
||||
static const struct scache wt_msr_noirq = {
|
||||
.ie = __enable_icache_msr,
|
||||
.id = __disable_icache_msr,
|
||||
.ifl = __flush_icache_all_noirq,
|
||||
@@ -597,7 +597,7 @@ const struct scache wt_msr_noirq = {
|
||||
.dinr = __invalidate_dcache_range_nomsr_wt,
|
||||
};
|
||||
|
||||
const struct scache wt_nomsr_noirq = {
|
||||
static const struct scache wt_nomsr_noirq = {
|
||||
.ie = __enable_icache_nomsr,
|
||||
.id = __disable_icache_nomsr,
|
||||
.ifl = __flush_icache_all_noirq,
|
||||
@@ -624,7 +624,7 @@ void microblaze_cache_init(void)
|
||||
if (cpuinfo.dcache_wb) {
|
||||
INFO("wb_msr");
|
||||
mbc = (struct scache *)&wb_msr;
|
||||
if (cpuinfo.ver_code < CPUVER_7_20_D) {
|
||||
if (cpuinfo.ver_code <= CPUVER_7_20_D) {
|
||||
/* MS: problem with signal handling - hw bug */
|
||||
INFO("WB won't work properly");
|
||||
}
|
||||
@@ -641,7 +641,7 @@ void microblaze_cache_init(void)
|
||||
if (cpuinfo.dcache_wb) {
|
||||
INFO("wb_nomsr");
|
||||
mbc = (struct scache *)&wb_nomsr;
|
||||
if (cpuinfo.ver_code < CPUVER_7_20_D) {
|
||||
if (cpuinfo.ver_code <= CPUVER_7_20_D) {
|
||||
/* MS: problem with signal handling - hw bug */
|
||||
INFO("WB won't work properly");
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
|
||||
{"7.30.b", 0x11},
|
||||
{"8.00.a", 0x12},
|
||||
{"8.00.b", 0x13},
|
||||
{"8.10.a", 0x14},
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ static inline void __dma_sync_page(unsigned long paddr, unsigned long offset,
|
||||
{
|
||||
switch (direction) {
|
||||
case DMA_TO_DEVICE:
|
||||
case DMA_BIDIRECTIONAL:
|
||||
flush_dcache_range(paddr + offset, paddr + offset + size);
|
||||
break;
|
||||
case DMA_FROM_DEVICE:
|
||||
|
||||
@@ -115,7 +115,7 @@ ENTRY(_interrupt)
|
||||
/* restore r31 */
|
||||
lwi r31, r0, PER_CPU(CURRENT_SAVE)
|
||||
/* prepare the link register, the argument and jump */
|
||||
la r15, r0, ret_from_intr - 8
|
||||
addik r15, r0, ret_from_intr - 8
|
||||
addk r6, r0, r15
|
||||
braid do_IRQ
|
||||
add r5, r0, r1
|
||||
@@ -283,7 +283,7 @@ ENTRY(_user_exception)
|
||||
add r12, r12, r12 /* convert num -> ptr */
|
||||
add r12, r12, r12
|
||||
lwi r12, r12, sys_call_table /* Get function pointer */
|
||||
la r15, r0, ret_to_user-8 /* set return address */
|
||||
addik r15, r0, ret_to_user-8 /* set return address */
|
||||
bra r12 /* Make the system call. */
|
||||
bri 0 /* won't reach here */
|
||||
1:
|
||||
|
||||
+167
-158
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,7 @@ void die(const char *str, struct pt_regs *fp, long err)
|
||||
}
|
||||
|
||||
/* for user application debugging */
|
||||
void sw_exception(struct pt_regs *regs)
|
||||
asmlinkage void sw_exception(struct pt_regs *regs)
|
||||
{
|
||||
_exception(SIGTRAP, regs, TRAP_BRKPT, regs->r16);
|
||||
flush_dcache_range(regs->r16, regs->r16 + 0x4);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <asm/mmu.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
.data
|
||||
.section .data
|
||||
.global empty_zero_page
|
||||
.align 12
|
||||
empty_zero_page:
|
||||
@@ -50,6 +50,11 @@ swapper_pg_dir:
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
.section .rodata
|
||||
.align 4
|
||||
endian_check:
|
||||
.word 1
|
||||
|
||||
__HEAD
|
||||
ENTRY(_start)
|
||||
#if CONFIG_KERNEL_BASE_ADDR == 0
|
||||
@@ -79,10 +84,7 @@ real_start:
|
||||
/* Does r7 point to a valid FDT? Load HEADER magic number */
|
||||
/* Run time Big/Little endian platform */
|
||||
/* Save 1 as word and load byte - 0 - BIG, 1 - LITTLE */
|
||||
addik r11, r0, 0x1 /* BIG/LITTLE checking value */
|
||||
/* __bss_start will be zeroed later - it is just temp location */
|
||||
swi r11, r0, TOPHYS(__bss_start)
|
||||
lbui r11, r0, TOPHYS(__bss_start)
|
||||
lbui r11, r0, TOPHYS(endian_check)
|
||||
beqid r11, big_endian /* DO NOT break delay stop dependency */
|
||||
lw r11, r0, r7 /* Big endian load in delay slot */
|
||||
lwr r11, r0, r7 /* Little endian load */
|
||||
@@ -222,26 +224,26 @@ start_here:
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
/* Initialize small data anchors */
|
||||
la r13, r0, _KERNEL_SDA_BASE_
|
||||
la r2, r0, _KERNEL_SDA2_BASE_
|
||||
addik r13, r0, _KERNEL_SDA_BASE_
|
||||
addik r2, r0, _KERNEL_SDA2_BASE_
|
||||
|
||||
/* Initialize stack pointer */
|
||||
la r1, r0, init_thread_union + THREAD_SIZE - 4
|
||||
addik r1, r0, init_thread_union + THREAD_SIZE - 4
|
||||
|
||||
/* Initialize r31 with current task address */
|
||||
la r31, r0, init_task
|
||||
addik r31, r0, init_task
|
||||
|
||||
/*
|
||||
* Call platform dependent initialize function.
|
||||
* Please see $(ARCH)/mach-$(SUBARCH)/setup.c for
|
||||
* the function.
|
||||
*/
|
||||
la r9, r0, machine_early_init
|
||||
addik r9, r0, machine_early_init
|
||||
brald r15, r9
|
||||
nop
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
la r15, r0, machine_halt
|
||||
addik r15, r0, machine_halt
|
||||
braid start_kernel
|
||||
nop
|
||||
#else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user