sh updates for v6.10

- sh: setup: Add missing forward declaration for sh_fdt_init()
 - sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING
 - sh: of-generic: Add missing #include <asm/clock.h>
 - sh: dreamcast: Fix GAPS PCI bridge addressing
 - sh: boot: Add proper forward declarations
 - sh: boot: Remove sh5 cache handling
 - Revert "sh: Handle calling csum_partial with misaligned data"
 - sh: j2: Drop incorrect SPI controller spi-max-frequency property
 - sh: push-switch: Convert to platform remove callback returning void
 - sh: sh7785lcr: Make init_sh7785lcr_IRQ() static
 - sh: sh7757: Add missing #include <asm/mmzone.h>
 - sh: sh7757lcr: Make init_sh7757lcr_IRQ() static
 - sh: mach-sh03: Make sh03_rtc_settimeofday() static
 - sh: mach-highlander: Add missing #include <mach/highlander.h>
 - sh: traps: Make is_dsp_inst() static
 - sh: cache: Move forward declarations to <asm/cacheflush.h>
 - sh: dma: Remove unused functionality
 - sh: dwarf: Make dwarf_lookup_fde() static
 - sh: kprobes: Remove unneeded kprobe_opcode_t casts
 - sh: kprobes: Make trampoline_probe_handler() static
 - sh: kprobes: Merge arch_copy_kprobe() into arch_prepare_kprobe()
 - sh: smp: Fix missing prototypes
 - sh: sh7786: Remove unused sh7786_usb_use_exclock()
 - sh: sh2a: Add missing #include <asm/processor.h>
 - sh: dma: Remove unused dmac_search_free_channel()
 - sh: math-emu: Add missing #include <asm/fpu.h>
 - sh: nommu: Add missing #include <asm/cacheflush.h>
 - sh: ftrace: Fix missing prototypes
 - sh: hw_breakpoint: Add missing forward declaration for arch_bp_generic_fields()
 - sh: traps: Add missing #include <asm/setup.h>
 - sh: return_address: Add missing #include <asm/ftrace.h>
 - sh: tlb: Add missing forward declaration for handle_tlbmiss()
 - sh: syscall: Add missing forward declaration for sys_cacheflush()
 - sh: fpu: Add missing forward declarations
 - sh: pgtable: Fix missing prototypes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEYv+KdYTgKVaVRgAGdCY7N/W1+RMFAmZCiuwACgkQdCY7N/W1
 +RO1xA/+OSBo0VVSDxpMWnIlnhjzpOhg/cWjPWEV7PpYmCTac/KfpCkI63G9+O3o
 kYwmYiTWoryk6TQEUFZl3+aw0wbPQrv/ME6IBWKTCzOfZTgcHmHH3P6Am+TghqT/
 d5YIPe1bbyph5qr5Ou+SeFPXgYoTEDTWrtBMyIDORayfH7N9uoSTW3jxg1mHueku
 NLDdDvRGLR142AJXqSjYLBMJ5BAtjHZvoqcI+9PRVh5HuoTdR6vHYeoZzqOoh7z0
 ud/xDM2dbYjf3IxqpVArQVr9YpNRgWgbXVpELLAxCQUHmI3SoE8EijKGp5hxnQ9c
 clf7CTXFp898QgFFumEXD4Z58jed7eIfnmRKAyKBGm2e4N7bD/EKDD3TqmTJHLE7
 DDABQaqFb6vWPmvXl/Abs14+79lErUaZIh9EekAWbaIf+bRDYYUuL2f+4+GYj4/Z
 iQxS89yv35Bi2c63aE32IHHGSTFEvuVqwcyqe1tCpyK1ImhOaOVOOtYkCXfG/iEx
 trSEOEdDkU6nr8MsZkpqeIs2ulXccJMpoxpGhofz3ImwvukzEdNolnkJnBZ79xwc
 r6h5muKK8ZAtmzFHVhbcxeJy7UJAK1b4iLVDvhCaAVxWcrXSt9T4xbC83F6z7iQ2
 t6/fIkRDy7+ISTKdTB/eHr8Zz2+R9puAqz4gzXb33LFm9/8Zyq0=
 =UlIL
 -----END PGP SIGNATURE-----

Merge tag 'sh-for-v6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux

Pull sh updates from John Paul Adrian Glaubitz:
 "The majority of improvements are coming from Geert Uytterhoeven who
  took the time to fix a total of 30 cases of "-Wmissing-prototypes"
  compiler warnings, either by adding a missing header include, defining
  the missing forward declarations or making the functions in question
  static.

  In the case of several DMA functions, the fix was to actually just
  remove them as they were added but never used. Another one of these
  warnings was eliminated by removing the left-over sh5 cache handling
  support, a change that was suggested by Yoshinori Sato and, finally,
  the last of these warnings was fixed by guarding the function
  setup_profiling_timer() with CONFIG_PROFILING.

  While at it, Geert also removed two unneeded casts to kprobe_opcode_t
  in the kprobes code.

  Another change was contributed by Guenter Roeck to fix errors that
  were reported during checksum unit tests. The fix actually reverts the
  older change cadc4e1a2b ("sh: Handle calling csum_partial with
  misaligned data") which turned to be incorrect. It remains to be
  investigated whether there is a better way to handle misaligned data
  in csum_partial().

  A small fix contributed by Krzysztof Kozlowski drops the incorrect SPI
  controller spi-max-frequency property in the device tree source file
  for the J2 device platform while Uwe Kleine-König converted the
  push-switch driver to have its callback function return void, a change
  that is currently being applied to all drivers throughout the kernel
  in order to avoid resource leaks.

  Last but not least, Artur Rojek has fixed the IOPORT base address for
  the Sega Dreamcast platform which allows the Linux kernel to be
  successfully booted on this once popular video game console for the
  first time since a long time ago"

* tag 'sh-for-v6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux: (35 commits)
  sh: setup: Add missing forward declaration for sh_fdt_init()
  sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING
  sh: of-generic: Add missing #include <asm/clock.h>
  sh: dreamcast: Fix GAPS PCI bridge addressing
  sh: boot: Add proper forward declarations
  sh: boot: Remove sh5 cache handling
  Revert "sh: Handle calling csum_partial with misaligned data"
  sh: j2: Drop incorrect SPI controller spi-max-frequency property
  sh: push-switch: Convert to platform remove callback returning void
  sh: sh7785lcr: Make init_sh7785lcr_IRQ() static
  sh: sh7757: Add missing #include <asm/mmzone.h>
  sh: sh7757lcr: Make init_sh7757lcr_IRQ() static
  sh: mach-sh03: Make sh03_rtc_settimeofday() static
  sh: mach-highlander: Add missing #include <mach/highlander.h>
  sh: traps: Make is_dsp_inst() static
  sh: cache: Move forward declarations to <asm/cacheflush.h>
  sh: dma: Remove unused functionality
  sh: dwarf: Make dwarf_lookup_fde() static
  sh: kprobes: Remove unneeded kprobe_opcode_t casts
  sh: kprobes: Make trampoline_probe_handler() static
  ...
This commit is contained in:
Linus Torvalds 2024-05-14 11:24:29 -07:00
commit c59cebe8ff
41 changed files with 111 additions and 282 deletions

View File

@ -125,7 +125,8 @@ config ARCH_HAS_ILOG2_U64
config NO_IOPORT_MAP
def_bool !PCI
depends on !SH_SHMIN && !SH_HP6XX && !SH_SOLUTION_ENGINE
depends on !SH_SHMIN && !SH_HP6XX && !SH_SOLUTION_ENGINE && \
!SH_DREAMCAST
config IO_TRAPPED
bool

View File

@ -569,7 +569,7 @@ static int __init sh7757lcr_devices_setup(void)
arch_initcall(sh7757lcr_devices_setup);
/* Initialize IRQ setting */
void __init init_sh7757lcr_IRQ(void)
static void __init init_sh7757lcr_IRQ(void)
{
plat_irq_setup_pins(IRQ_MODE_IRQ7654);
plat_irq_setup_pins(IRQ_MODE_IRQ3210);

View File

@ -295,7 +295,7 @@ static int __init sh7785lcr_devices_setup(void)
device_initcall(sh7785lcr_devices_setup);
/* Initialize IRQ setting */
void __init init_sh7785lcr_IRQ(void)
static void __init init_sh7785lcr_IRQ(void)
{
plat_irq_setup_pins(IRQ_MODE_IRQ7654);
plat_irq_setup_pins(IRQ_MODE_IRQ3210);

View File

@ -25,10 +25,13 @@
#include <asm/irq.h>
#include <asm/rtc.h>
#include <asm/machvec.h>
#include <cpu/addrspace.h>
#include <mach/sysasic.h>
static void __init dreamcast_setup(char **cmdline_p)
{
/* GAPS PCI bridge assumes P2 area relative addresses. */
__set_io_port_base(P2SEG);
}
static struct sh_machine_vector mv_dreamcast __initmv = {

View File

@ -5,6 +5,7 @@
#include <linux/init.h>
#include <linux/gpio.h>
#include <cpu/sh7785.h>
#include <mach/highlander.h>
void __init highlander_plat_pinmux_setup(void)
{

View File

@ -120,7 +120,7 @@ static int set_rtc_mmss(struct rtc_time *tm)
return retval;
}
int sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm)
static int sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm)
{
return set_rtc_mmss(tm);
}

View File

@ -10,6 +10,8 @@
#include <linux/of_fdt.h>
#include <linux/clocksource.h>
#include <linux/irqchip.h>
#include <asm/clock.h>
#include <asm/machvec.h>
#include <asm/rtc.h>

View File

@ -5,7 +5,7 @@
# create a compressed vmlinux image from the original vmlinux
#
OBJECTS := head_32.o misc.o cache.o piggy.o \
OBJECTS := head_32.o misc.o piggy.o \
ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \

View File

@ -1,13 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
int cache_control(unsigned int command)
{
volatile unsigned int *p = (volatile unsigned int *) 0x80000000;
int i;
for (i = 0; i < (32 * 1024); i += 32) {
(void)*p;
p += (32 / sizeof(int));
}
return 0;
}

View File

@ -16,6 +16,8 @@
#include <asm/addrspace.h>
#include <asm/page.h>
#include "misc.h"
/*
* gzip declarations
*/
@ -26,11 +28,6 @@
#undef memcpy
#define memzero(s, n) memset ((s), 0, (n))
/* cache.c */
#define CACHE_ENABLE 0
#define CACHE_DISABLE 1
int cache_control(unsigned int command);
extern char input_data[];
extern int input_len;
static unsigned char *output;
@ -139,8 +136,6 @@ void decompress_kernel(void)
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
puts("Uncompressing Linux... ");
cache_control(CACHE_ENABLE);
__decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error);
cache_control(CACHE_DISABLE);
puts("Ok, booting the kernel.\n");
}

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef MISC_H
#define MISC_H
void arch_ftrace_ops_list_func(void);
void decompress_kernel(void);
void ftrace_stub(void);
#endif /* MISC_H */

View File

@ -71,8 +71,6 @@
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <25000000>;
reg = <0x40 0x8>;
sdcard@0 {

View File

@ -41,21 +41,6 @@ struct dma_info *get_dma_info(unsigned int chan)
}
EXPORT_SYMBOL(get_dma_info);
struct dma_info *get_dma_info_by_name(const char *dmac_name)
{
struct dma_info *info;
list_for_each_entry(info, &registered_dmac_list, list) {
if (dmac_name && (strcmp(dmac_name, info->name) != 0))
continue;
else
return info;
}
return NULL;
}
EXPORT_SYMBOL(get_dma_info_by_name);
static unsigned int get_nr_channels(void)
{
struct dma_info *info;
@ -101,93 +86,6 @@ int get_dma_residue(unsigned int chan)
}
EXPORT_SYMBOL(get_dma_residue);
static int search_cap(const char **haystack, const char *needle)
{
const char **p;
for (p = haystack; *p; p++)
if (strcmp(*p, needle) == 0)
return 1;
return 0;
}
/**
* request_dma_bycap - Allocate a DMA channel based on its capabilities
* @dmac: List of DMA controllers to search
* @caps: List of capabilities
*
* Search all channels of all DMA controllers to find a channel which
* matches the requested capabilities. The result is the channel
* number if a match is found, or %-ENODEV if no match is found.
*
* Note that not all DMA controllers export capabilities, in which
* case they can never be allocated using this API, and so
* request_dma() must be used specifying the channel number.
*/
int request_dma_bycap(const char **dmac, const char **caps, const char *dev_id)
{
unsigned int found = 0;
struct dma_info *info;
const char **p;
int i;
BUG_ON(!dmac || !caps);
list_for_each_entry(info, &registered_dmac_list, list)
if (strcmp(*dmac, info->name) == 0) {
found = 1;
break;
}
if (!found)
return -ENODEV;
for (i = 0; i < info->nr_channels; i++) {
struct dma_channel *channel = &info->channels[i];
if (unlikely(!channel->caps))
continue;
for (p = caps; *p; p++) {
if (!search_cap(channel->caps, *p))
break;
if (request_dma(channel->chan, dev_id) == 0)
return channel->chan;
}
}
return -EINVAL;
}
EXPORT_SYMBOL(request_dma_bycap);
int dmac_search_free_channel(const char *dev_id)
{
struct dma_channel *channel = { 0 };
struct dma_info *info = get_dma_info(0);
int i;
for (i = 0; i < info->nr_channels; i++) {
channel = &info->channels[i];
if (unlikely(!channel))
return -ENODEV;
if (atomic_read(&channel->busy) == 0)
break;
}
if (info->ops->request) {
int result = info->ops->request(channel);
if (result)
return result;
atomic_set(&channel->busy, 1);
return channel->chan;
}
return -ENOSYS;
}
int request_dma(unsigned int chan, const char *dev_id)
{
struct dma_channel *channel = { 0 };
@ -240,35 +138,6 @@ void dma_wait_for_completion(unsigned int chan)
}
EXPORT_SYMBOL(dma_wait_for_completion);
int register_chan_caps(const char *dmac, struct dma_chan_caps *caps)
{
struct dma_info *info;
unsigned int found = 0;
int i;
list_for_each_entry(info, &registered_dmac_list, list)
if (strcmp(dmac, info->name) == 0) {
found = 1;
break;
}
if (unlikely(!found))
return -ENODEV;
for (i = 0; i < info->nr_channels; i++, caps++) {
struct dma_channel *channel;
if ((info->first_channel_nr + i) != caps->ch_num)
return -EINVAL;
channel = &info->channels[i];
channel->caps = caps->caplist;
}
return 0;
}
EXPORT_SYMBOL(register_chan_caps);
void dma_configure_channel(unsigned int chan, unsigned long flags)
{
struct dma_info *info = get_dma_info(chan);
@ -294,18 +163,6 @@ int dma_xfer(unsigned int chan, unsigned long from,
}
EXPORT_SYMBOL(dma_xfer);
int dma_extend(unsigned int chan, unsigned long op, void *param)
{
struct dma_info *info = get_dma_info(chan);
struct dma_channel *channel = get_dma_channel(chan);
if (info->ops->extend)
return info->ops->extend(channel, op, param);
return -ENOSYS;
}
EXPORT_SYMBOL(dma_extend);
static int dma_proc_show(struct seq_file *m, void *v)
{
struct dma_info *info = v;

View File

@ -91,7 +91,7 @@ err:
return ret;
}
static int switch_drv_remove(struct platform_device *pdev)
static void switch_drv_remove(struct platform_device *pdev)
{
struct push_switch *psw = platform_get_drvdata(pdev);
struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
@ -106,13 +106,11 @@ static int switch_drv_remove(struct platform_device *pdev)
free_irq(irq, pdev);
kfree(psw);
return 0;
}
static struct platform_driver switch_driver = {
.probe = switch_drv_probe,
.remove = switch_drv_remove,
.remove_new = switch_drv_remove,
.driver = {
.name = DRV_NAME,
},

View File

@ -104,6 +104,18 @@ void kunmap_coherent(void *kvaddr);
void cpu_cache_init(void);
void __weak l2_cache_init(void);
void __weak j2_cache_init(void);
void __weak sh2_cache_init(void);
void __weak sh2a_cache_init(void);
void __weak sh3_cache_init(void);
void __weak shx3_cache_init(void);
void __weak sh4_cache_init(void);
void __weak sh7705_cache_init(void);
void __weak sh4__flush_region_init(void);
static inline void *sh_cacheop_vaddr(void *vaddr)
{
if (__in_29bit_mode())

View File

@ -56,7 +56,6 @@ struct dma_ops {
int (*get_residue)(struct dma_channel *chan);
int (*xfer)(struct dma_channel *chan);
int (*configure)(struct dma_channel *chan, unsigned long flags);
int (*extend)(struct dma_channel *chan, unsigned long op, void *param);
};
struct dma_channel {
@ -118,8 +117,6 @@ extern int dma_xfer(unsigned int chan, unsigned long from,
#define dma_read_page(chan, from, to) \
dma_read(chan, from, to, PAGE_SIZE)
extern int request_dma_bycap(const char **dmac, const char **caps,
const char *dev_id);
extern int get_dma_residue(unsigned int chan);
extern struct dma_info *get_dma_info(unsigned int chan);
extern struct dma_channel *get_dma_channel(unsigned int chan);
@ -128,10 +125,6 @@ extern void dma_configure_channel(unsigned int chan, unsigned long flags);
extern int register_dmac(struct dma_info *info);
extern void unregister_dmac(struct dma_info *info);
extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
extern int dma_extend(unsigned int chan, unsigned long op, void *param);
extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
/* arch/sh/drivers/dma/dma-sysfs.c */
extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);

View File

@ -64,6 +64,9 @@ static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
preempt_enable();
}
void float_raise(unsigned int flags);
int float_rounding_mode(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_FPU_H */

View File

@ -33,6 +33,8 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
return addr;
}
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr);
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_FUNCTION_TRACER */
@ -43,6 +45,14 @@ extern void *return_address(unsigned int);
#define ftrace_return_address(n) return_address(n)
#ifdef CONFIG_DYNAMIC_FTRACE
extern void arch_ftrace_nmi_enter(void);
extern void arch_ftrace_nmi_exit(void);
#else
static inline void arch_ftrace_nmi_enter(void) { }
static inline void arch_ftrace_nmi_exit(void) { }
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_FTRACE_H */

View File

@ -52,6 +52,8 @@ struct pmu;
/* arch/sh/kernel/hw_breakpoint.c */
extern int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw);
extern int arch_bp_generic_fields(int sh_len, int sh_type, int *gen_len,
int *gen_type);
extern int hw_breakpoint_arch_parse(struct perf_event *bp,
const struct perf_event_attr *attr,
struct arch_hw_breakpoint *hw);

View File

@ -21,5 +21,6 @@
void sh_mv_setup(void);
void check_for_initrd(void);
void per_cpu_trap_init(void);
void sh_fdt_init(phys_addr_t dt_phys);
#endif /* _SH_SETUP_H */

View File

@ -8,6 +8,7 @@ asmlinkage int old_mmap(unsigned long addr, unsigned long len,
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op);
#include <asm/syscalls_32.h>

View File

@ -24,6 +24,10 @@ static inline void tlb_unwire_entry(void)
BUG();
}
#endif /* CONFIG_CPU_SH4 */
asmlinkage int handle_tlbmiss(struct pt_regs *regs, unsigned long error_code,
unsigned long address);
#endif /* CONFIG_MMU */
#endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_TLB_H */

View File

@ -8,6 +8,8 @@
*/
#include <linux/kernel.h>
#include <asm/processor.h>
/*
* Instructions on SH are generally fixed at 16-bits, however, SH-2A
* introduces some 32-bit instructions. Since there are no real

View File

@ -14,9 +14,12 @@
#include <linux/sh_timer.h>
#include <linux/sh_intc.h>
#include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/clock.h>
#include <asm/mmzone.h>
#include <asm/platform_early.h>
#include <cpu/sh7723.h>
/* Serial */

View File

@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/notifier.h>
#include <asm/cacheflush.h>
#include <asm/suspend.h>
#include <asm/clock.h>
#include <asm/mmzone.h>

View File

@ -17,8 +17,11 @@
#include <linux/sh_dma.h>
#include <linux/sh_intc.h>
#include <linux/usb/ohci_pdriver.h>
#include <cpu/dma-register.h>
#include <cpu/sh7757.h>
#include <asm/mmzone.h>
#include <asm/platform_early.h>
static struct plat_sci_port scif2_platform_data = {

View File

@ -400,20 +400,6 @@ static struct platform_device *sh7786_devices[] __initdata = {
&usb_ohci_device,
};
/*
* Please call this function if your platform board
* use external clock for USB
* */
#define USBCTL0 0xffe70858
#define CLOCK_MODE_MASK 0xffffff7f
#define EXT_CLOCK_MODE 0x00000080
void __init sh7786_usb_use_exclock(void)
{
u32 val = __raw_readl(USBCTL0) & CLOCK_MODE_MASK;
__raw_writel(val | EXT_CLOCK_MODE, USBCTL0);
}
#define USBINITREG1 0xffe70094
#define USBINITREG2 0xffe7009c
#define USBINITVAL1 0x00ff0040

View File

@ -344,7 +344,7 @@ out:
* dwarf_lookup_fde - locate the FDE that covers pc
* @pc: the program counter
*/
struct dwarf_fde *dwarf_lookup_fde(unsigned long pc)
static struct dwarf_fde *dwarf_lookup_fde(unsigned long pc)
{
struct rb_node **rb_node = &fde_root.rb_node;
struct dwarf_fde *fde = NULL;

View File

@ -39,22 +39,17 @@ static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2);
int __kprobes arch_prepare_kprobe(struct kprobe *p)
{
kprobe_opcode_t opcode = *(kprobe_opcode_t *) (p->addr);
kprobe_opcode_t opcode = *p->addr;
if (OPCODE_RTE(opcode))
return -EFAULT; /* Bad breakpoint */
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = opcode;
return 0;
}
void __kprobes arch_copy_kprobe(struct kprobe *p)
{
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = *p->addr;
}
void __kprobes arch_arm_kprobe(struct kprobe *p)
{
*p->addr = BREAKPOINT_INSTRUCTION;
@ -253,7 +248,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
p = get_kprobe(addr);
if (!p) {
/* Not one of ours: let kernel handle it */
if (*(kprobe_opcode_t *)addr != BREAKPOINT_INSTRUCTION) {
if (*addr != BREAKPOINT_INSTRUCTION) {
/*
* The breakpoint instruction was removed right
* after we hit it. Another cpu has removed
@ -301,7 +296,7 @@ static void __used kretprobe_trampoline_holder(void)
/*
* Called when we hit the probe point at __kretprobe_trampoline
*/
int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
static int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
{
regs->pc = __kretprobe_trampoline_handler(regs, NULL);

View File

@ -7,7 +7,9 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/dwarf.h>
#include <asm/ftrace.h>
#ifdef CONFIG_DWARF_UNWINDER

View File

@ -21,6 +21,8 @@
#include <linux/sched/hotplug.h>
#include <linux/atomic.h>
#include <linux/clockchips.h>
#include <linux/profile.h>
#include <asm/processor.h>
#include <asm/mmu_context.h>
#include <asm/smp.h>
@ -170,7 +172,7 @@ void native_play_dead(void)
}
#endif
asmlinkage void start_secondary(void)
static asmlinkage void start_secondary(void)
{
unsigned int cpu = smp_processor_id();
struct mm_struct *mm = &init_mm;
@ -320,11 +322,13 @@ void smp_message_recv(unsigned int msg)
}
}
#ifdef CONFIG_PROFILING
/* Not really SMP stuff ... */
int setup_profiling_timer(unsigned int multiplier)
{
return 0;
}
#endif
#ifdef CONFIG_MMU

View File

@ -15,6 +15,8 @@
#include <linux/extable.h>
#include <linux/module.h> /* print_modules */
#include <asm/ftrace.h>
#include <asm/unwinder.h>
#include <asm/traps.h>
@ -170,14 +172,6 @@ BUILD_TRAP_HANDLER(bug)
force_sig(SIGTRAP);
}
#ifdef CONFIG_DYNAMIC_FTRACE
extern void arch_ftrace_nmi_enter(void);
extern void arch_ftrace_nmi_exit(void);
#else
static inline void arch_ftrace_nmi_enter(void) { }
static inline void arch_ftrace_nmi_exit(void) { }
#endif
BUILD_TRAP_HANDLER(nmi)
{
TRAP_HANDLER_DECL;

View File

@ -27,6 +27,7 @@
#include <asm/alignment.h>
#include <asm/fpu.h>
#include <asm/kprobes.h>
#include <asm/setup.h>
#include <asm/traps.h>
#include <asm/bl_bit.h>
@ -568,7 +569,7 @@ uspace_segv:
/*
* SH-DSP support gerg@snapgear.com.
*/
int is_dsp_inst(struct pt_regs *regs)
static int is_dsp_inst(struct pt_regs *regs)
{
unsigned short inst = 0;
@ -590,7 +591,7 @@ int is_dsp_inst(struct pt_regs *regs)
return 0;
}
#else
#define is_dsp_inst(regs) (0)
static inline int is_dsp_inst(struct pt_regs *regs) { return 0; }
#endif /* CONFIG_SH_DSP */
#ifdef CONFIG_CPU_SH2A

View File

@ -33,7 +33,8 @@
*/
/*
* asmlinkage __wsum csum_partial(const void *buf, int len, __wsum sum);
* unsigned int csum_partial(const unsigned char *buf, int len,
* unsigned int sum);
*/
.text
@ -45,31 +46,11 @@ ENTRY(csum_partial)
* Fortunately, it is easy to convert 2-byte alignment to 4-byte
* alignment for the unrolled loop.
*/
mov r5, r1
mov r4, r0
tst #3, r0 ! Check alignment.
bt/s 2f ! Jump if alignment is ok.
mov r4, r7 ! Keep a copy to check for alignment
tst #2, r0 ! Check alignment.
bt 2f ! Jump if alignment is ok.
!
tst #1, r0 ! Check alignment.
bt 21f ! Jump if alignment is boundary of 2bytes.
! buf is odd
tst r5, r5
add #-1, r5
bt 9f
mov.b @r4+, r0
extu.b r0, r0
addc r0, r6 ! t=0 from previous tst
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
mov r4, r0
tst #2, r0
bt 2f
21:
! buf is 2 byte aligned (len could be 0)
add #-2, r5 ! Alignment uses up two bytes.
cmp/pz r5 !
bt/s 1f ! Jump if we had at least two bytes.
@ -77,17 +58,16 @@ ENTRY(csum_partial)
bra 6f
add #2, r5 ! r5 was < 2. Deal with it.
1:
mov r5, r1 ! Save new len for later use.
mov.w @r4+, r0
extu.w r0, r0
addc r0, r6
bf 2f
add #1, r6
2:
! buf is 4 byte aligned (len could be 0)
mov r5, r1
mov #-5, r0
shld r0, r1
tst r1, r1
shld r0, r5
tst r5, r5
bt/s 4f ! if it's =0, go to 4f
clrt
.align 2
@ -109,31 +89,30 @@ ENTRY(csum_partial)
addc r0, r6
addc r2, r6
movt r0
dt r1
dt r5
bf/s 3b
cmp/eq #1, r0
! here, we know r1==0
addc r1, r6 ! add carry to r6
! here, we know r5==0
addc r5, r6 ! add carry to r6
4:
mov r5, r0
mov r1, r0
and #0x1c, r0
tst r0, r0
bt 6f
! 4 bytes or more remaining
mov r0, r1
shlr2 r1
bt/s 6f
mov r0, r5
shlr2 r5
mov #0, r2
5:
addc r2, r6
mov.l @r4+, r2
movt r0
dt r1
dt r5
bf/s 5b
cmp/eq #1, r0
addc r2, r6
addc r1, r6 ! r1==0 here, so it means add carry-bit
addc r5, r6 ! r5==0 here, so it means add carry-bit
6:
! 3 bytes or less remaining
mov r1, r5
mov #3, r0
and r0, r5
tst r5, r5
@ -159,16 +138,6 @@ ENTRY(csum_partial)
mov #0, r0
addc r0, r6
9:
! Check if the buffer was misaligned, if so realign sum
mov r7, r0
tst #1, r0
bt 10f
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
10:
rts
mov r6, r0

View File

@ -15,6 +15,8 @@
#include <linux/perf_event.h>
#include <linux/uaccess.h>
#include <asm/fpu.h>
#include <asm/processor.h>
#include <asm/io.h>

View File

@ -376,8 +376,6 @@ static void __flush_cache_one(unsigned long addr, unsigned long phys,
} while (--way_count != 0);
}
extern void __weak sh4__flush_region_init(void);
/*
* SH-4 has virtually indexed and physically tagged cache.
*/

View File

@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/io.h>
#include <asm/cache.h>
#include <asm/cacheflush.h>
#define CCR_CACHE_SNM 0x40000 /* Hardware-assisted synonym avoidance */
#define CCR_CACHE_IBE 0x1000000 /* ICBI broadcast */

View File

@ -320,30 +320,20 @@ void __init cpu_cache_init(void)
goto skip;
if (boot_cpu_data.type == CPU_J2) {
extern void __weak j2_cache_init(void);
j2_cache_init();
} else if (boot_cpu_data.family == CPU_FAMILY_SH2) {
extern void __weak sh2_cache_init(void);
sh2_cache_init();
}
if (boot_cpu_data.family == CPU_FAMILY_SH2A) {
extern void __weak sh2a_cache_init(void);
sh2a_cache_init();
}
if (boot_cpu_data.family == CPU_FAMILY_SH3) {
extern void __weak sh3_cache_init(void);
sh3_cache_init();
if ((boot_cpu_data.type == CPU_SH7705) &&
(boot_cpu_data.dcache.sets == 512)) {
extern void __weak sh7705_cache_init(void);
sh7705_cache_init();
}
}
@ -351,14 +341,10 @@ void __init cpu_cache_init(void)
if ((boot_cpu_data.family == CPU_FAMILY_SH4) ||
(boot_cpu_data.family == CPU_FAMILY_SH4A) ||
(boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {
extern void __weak sh4_cache_init(void);
sh4_cache_init();
if ((boot_cpu_data.type == CPU_SH7786) ||
(boot_cpu_data.type == CPU_SHX3)) {
extern void __weak shx3_cache_init(void);
shx3_cache_init();
}
}

View File

@ -10,6 +10,8 @@
#include <linux/init.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
#include <asm/page.h>
#include <linux/uaccess.h>

View File

@ -2,12 +2,14 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <asm/pgalloc.h>
static struct kmem_cache *pgd_cachep;
#if PAGETABLE_LEVELS > 2
static struct kmem_cache *pmd_cachep;
#endif
void pgd_ctor(void *x)
static void pgd_ctor(void *x)
{
pgd_t *pgd = x;

View File

@ -14,6 +14,7 @@
#include <linux/kdebug.h>
#include <asm/mmu_context.h>
#include <asm/thread_info.h>
#include <asm/tlb.h>
/*
* Called with interrupts disabled.