diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
commit | dc50eab76b709d68175a358d6e23a5a3890764d3 (patch) | |
tree | c754d0390db060af0213ff994f0ac310e4cfd6e9 /arch/m68k | |
parent | Adding debian version 6.6.15-2. (diff) | |
download | linux-dc50eab76b709d68175a358d6e23a5a3890764d3.tar.xz linux-dc50eab76b709d68175a358d6e23a5a3890764d3.zip |
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'arch/m68k')
128 files changed, 728 insertions, 746 deletions
diff --git a/arch/m68k/68000/entry.S b/arch/m68k/68000/entry.S index 7d63e2f155..72e95663b6 100644 --- a/arch/m68k/68000/entry.S +++ b/arch/m68k/68000/entry.S @@ -1,12 +1,9 @@ -/* +/* SPDX-License-Identifier: GPL-2.0-or-later + * * entry.S -- non-mmu 68000 interrupt and exception entry points * * Copyright (C) 1991, 1992 Linus Torvalds * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. - * * Linux/m68k support by Hamish Macdonald */ diff --git a/arch/m68k/68000/ints.c b/arch/m68k/68000/ints.c index f9a5ec7814..2ba9926e91 100644 --- a/arch/m68k/68000/ints.c +++ b/arch/m68k/68000/ints.c @@ -14,6 +14,7 @@ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <linux/cpu.h> #include <asm/traps.h> #include <asm/io.h> #include <asm/machdep.h> @@ -26,6 +27,8 @@ #include <asm/MC68328.h> #endif +#include "ints.h" + /* assembler routines */ asmlinkage void system_call(void); asmlinkage void buserr(void); @@ -74,7 +77,7 @@ asmlinkage irqreturn_t inthandler7(void); * into one vector and look in the blasted mask register... * This code is designed to be fast, almost constant time, not clean! */ -void process_int(int vec, struct pt_regs *fp) +asmlinkage void process_int(int vec, struct pt_regs *fp) { int irq; int mask; diff --git a/arch/m68k/68000/ints.h b/arch/m68k/68000/ints.h new file mode 100644 index 0000000000..d9cfd0eb9f --- /dev/null +++ b/arch/m68k/68000/ints.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> + +struct pt_regs; + +asmlinkage void process_int(int vec, struct pt_regs *fp); diff --git a/arch/m68k/68000/timers.c b/arch/m68k/68000/timers.c index 0d0417cebc..00fb0dd12f 100644 --- a/arch/m68k/68000/timers.c +++ b/arch/m68k/68000/timers.c @@ -25,6 +25,8 @@ #include <asm/machdep.h> #include <asm/MC68VZ328.h> +#include "m68328.h" + /***************************************************************************/ #if defined(CONFIG_DRAGEN2) diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 3e318bf950..4b3e93cac7 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -6,19 +6,22 @@ config M68K select ARCH_HAS_BINFMT_FLAT select ARCH_HAS_CPU_FINALIZE_INIT if MMU select ARCH_HAS_CURRENT_STACK_POINTER - select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE - select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA + select ARCH_HAS_DMA_PREP_COHERENT if M68K_NONCOHERENT_DMA && !COLDFIRE + select ARCH_HAS_SYNC_DMA_FOR_DEVICE if M68K_NONCOHERENT_DMA select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS select ARCH_MIGHT_HAVE_PC_PARPORT if ISA select ARCH_NO_PREEMPT if !COLDFIRE select ARCH_USE_MEMTEST if MMU_MOTOROLA select ARCH_WANT_IPC_PARSE_VERSION select BINFMT_FLAT_ARGVP_ENVP_ON_STACK - select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE + select DMA_DIRECT_REMAP if M68K_NONCOHERENT_DMA && !COLDFIRE select GENERIC_ATOMIC64 select GENERIC_CPU_DEVICES select GENERIC_IOMAP select GENERIC_IRQ_SHOW + select GENERIC_LIB_ASHLDI3 + select GENERIC_LIB_ASHRDI3 + select GENERIC_LIB_LSHRDI3 select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA select HAVE_ARCH_SECCOMP select HAVE_ARCH_SECCOMP_FILTER diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu index b826e9c677..ad69b466a0 100644 --- a/arch/m68k/Kconfig.cpu +++ b/arch/m68k/Kconfig.cpu @@ -535,3 +535,15 @@ config CACHE_COPYBACK The ColdFire CPU cache is set into Copy-back mode. endchoice endif # HAVE_CACHE_CB + +# Coldfire cores that do not have a data cache configured can do coherent DMA. +config COLDFIRE_COHERENT_DMA + bool + default y + depends on COLDFIRE + depends on !HAVE_CACHE_CB && !CACHE_D && !CACHE_BOTH + +config M68K_NONCOHERENT_DMA + bool + default y + depends on HAS_DMA && !COLDFIRE_COHERENT_DMA diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine index 1f3574aef6..d06b1c5d9b 100644 --- a/arch/m68k/Kconfig.machine +++ b/arch/m68k/Kconfig.machine @@ -441,7 +441,7 @@ config ROM config ROMVEC hex "Address of the base of the ROM vectors" - default "0" + default "0x10c10000" depends on ROM help This is almost always the same as the base of the ROM. Since on all @@ -450,7 +450,7 @@ config ROMVEC config ROMSTART hex "Address of the base of system image in ROM" - default "0x400" + default "0x10c10400" depends on ROM help Define the start address of the system image in ROM. Commonly this diff --git a/arch/m68k/amiga/amiga.h b/arch/m68k/amiga/amiga.h new file mode 100644 index 0000000000..0039278144 --- /dev/null +++ b/arch/m68k/amiga/amiga.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* amisound.c */ +void amiga_init_sound(void); +void amiga_mksound(unsigned int hz, unsigned int ticks); diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c index 442bdeee6b..714fe8ec6a 100644 --- a/arch/m68k/amiga/amisound.c +++ b/arch/m68k/amiga/amisound.c @@ -16,6 +16,8 @@ #include <asm/amigahw.h> +#include "amiga.h" + static unsigned short *snd_data; static const signed char sine_data[] = { 0, 39, 75, 103, 121, 127, 121, 103, 75, 39, diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 3137b45750..7791673e54 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -39,6 +39,8 @@ #include <asm/io.h> #include <asm/config.h> +#include "amiga.h" + static unsigned long amiga_model; unsigned long amiga_eclock; @@ -96,9 +98,7 @@ static char amiga_model_name[13] = "Amiga "; static void amiga_sched_init(void); static void amiga_get_model(char *model); static void amiga_get_hardware_list(struct seq_file *m); -extern void amiga_mksound(unsigned int count, unsigned int ticks); static void amiga_reset(void); -extern void amiga_init_sound(void); static void amiga_mem_console_write(struct console *co, const char *b, unsigned int count); #ifdef CONFIG_HEARTBEAT diff --git a/arch/m68k/amiga/pcmcia.c b/arch/m68k/amiga/pcmcia.c index 7106f0c363..63cce6b590 100644 --- a/arch/m68k/amiga/pcmcia.c +++ b/arch/m68k/amiga/pcmcia.c @@ -26,11 +26,10 @@ static unsigned char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS; void pcmcia_reset(void) { unsigned long reset_start_time = jiffies; - unsigned char b; gayle_reset = 0x00; while (time_before(jiffies, reset_start_time + 1*HZ/100)); - b = gayle_reset; + READ_ONCE(gayle_reset); } EXPORT_SYMBOL(pcmcia_reset); diff --git a/arch/m68k/apollo/apollo.h b/arch/m68k/apollo/apollo.h new file mode 100644 index 0000000000..1fe9d856df --- /dev/null +++ b/arch/m68k/apollo/apollo.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* dn_ints.c */ +void dn_init_IRQ(void); diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 42a8b8e2b6..e161ecd760 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -4,7 +4,6 @@ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/tty.h> -#include <linux/console.h> #include <linux/rtc.h> #include <linux/vt_kern.h> #include <linux/interrupt.h> @@ -18,6 +17,8 @@ #include <asm/machdep.h> #include <asm/config.h> +#include "apollo.h" + u_long sio01_physaddr; u_long sio23_physaddr; u_long rtc_physaddr; @@ -28,9 +29,8 @@ u_long timer_physaddr; u_long apollo_model; extern void dn_sched_init(void); -extern void dn_init_IRQ(void); extern int dn_dummy_hwclk(int, struct rtc_time *); -extern void dn_dummy_reset(void); +static void dn_dummy_reset(void); #ifdef CONFIG_HEARTBEAT static void dn_heartbeat(int on); #endif @@ -108,28 +108,7 @@ static void __init dn_setup_model(void) } -int dn_serial_console_wait_key(struct console *co) { - - while(!(sio01.srb_csrb & 1)) - barrier(); - return sio01.rhrb_thrb; -} - -void dn_serial_console_write (struct console *co, const char *str,unsigned int count) -{ - while(count--) { - if (*str == '\n') { - sio01.rhrb_thrb = (unsigned char)'\r'; - while (!(sio01.srb_csrb & 0x4)) - ; - } - sio01.rhrb_thrb = (unsigned char)*str++; - while (!(sio01.srb_csrb & 0x4)) - ; - } -} - -void dn_serial_print (const char *str) +static void dn_serial_print(const char *str) { while (*str) { if (*str == '\n') { @@ -168,13 +147,13 @@ void __init config_apollo(void) irqreturn_t dn_timer_int(int irq, void *dev_id) { - volatile unsigned char x; + unsigned char *at = (unsigned char *)apollo_timer; legacy_timer_tick(1); timer_heartbeat(); - x = *(volatile unsigned char *)(apollo_timer + 3); - x = *(volatile unsigned char *)(apollo_timer + 5); + READ_ONCE(*(at + 3)); + READ_ONCE(*(at + 5)); return IRQ_HANDLED; } @@ -229,20 +208,14 @@ int dn_dummy_hwclk(int op, struct rtc_time *t) { } -void dn_dummy_reset(void) { - +static void dn_dummy_reset(void) +{ dn_serial_print("The end !\n"); for(;;); } -void dn_dummy_waitbut(void) { - - dn_serial_print("waitbut\n"); - -} - static void dn_get_model(char *model) { strcpy(model, "Apollo "); diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index 02cff7efc8..ba96a92f8f 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c @@ -5,7 +5,9 @@ #include <asm/traps.h> #include <asm/apollohw.h> -unsigned int apollo_irq_startup(struct irq_data *data) +#include "apollo.h" + +static unsigned int apollo_irq_startup(struct irq_data *data) { unsigned int irq = data->irq; @@ -16,7 +18,7 @@ unsigned int apollo_irq_startup(struct irq_data *data) return 0; } -void apollo_irq_shutdown(struct irq_data *data) +static void apollo_irq_shutdown(struct irq_data *data) { unsigned int irq = data->irq; @@ -26,7 +28,7 @@ void apollo_irq_shutdown(struct irq_data *data) *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8)); } -void apollo_irq_eoi(struct irq_data *data) +static void apollo_irq_eoi(struct irq_data *data) { *(volatile unsigned char *)(pica) = 0x20; *(volatile unsigned char *)(picb) = 0x20; diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 56f02ea2c2..2325643419 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -52,6 +52,7 @@ #include <asm/entry.h> #include <asm/io.h> +#include "atari.h" /* * Atari interrupt handling scheme: @@ -81,8 +82,6 @@ __ALIGN_STR "\n\t" "orw #0x200,%sp@\n\t" /* set saved ipl to 2 */ "rte"); -extern void atari_microwire_cmd(int cmd); - static unsigned int atari_irq_startup(struct irq_data *data) { unsigned int irq = data->irq; diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index 5e0e682f9c..49a9a459bd 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c @@ -332,7 +332,7 @@ void ikbd_write(const char *str, int len) } /* Reset (without touching the clock) */ -void ikbd_reset(void) +static void ikbd_reset(void) { static const char cmd[2] = { 0x80, 0x01 }; diff --git a/arch/m68k/atari/atari.h b/arch/m68k/atari/atari.h new file mode 100644 index 0000000000..494a03ddac --- /dev/null +++ b/arch/m68k/atari/atari.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct rtc_time; + +/* ataints.c */ +void atari_init_IRQ(void); + +/* atasound.c */ +void atari_microwire_cmd(int cmd); +void atari_mksound(unsigned int hz, unsigned int ticks); + +/* time.c */ +void atari_sched_init(void); +int atari_mste_hwclk(int op, struct rtc_time *t); +int atari_tt_hwclk(int op, struct rtc_time *t); diff --git a/arch/m68k/atari/atasound.c b/arch/m68k/atari/atasound.c index a8724d998c..c38ef0e607 100644 --- a/arch/m68k/atari/atasound.c +++ b/arch/m68k/atari/atasound.c @@ -28,6 +28,7 @@ #include <asm/irq.h> #include <asm/atariints.h> +#include "atari.h" /* * stuff from the old atasound.c diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 38a7c05781..b48a0606a0 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -48,6 +48,8 @@ #include <asm/io.h> #include <asm/config.h> +#include "atari.h" + u_long atari_mch_cookie; EXPORT_SYMBOL(atari_mch_cookie); @@ -69,19 +71,10 @@ int atari_rtc_year_offset; static void atari_reset(void); static void atari_get_model(char *model); static void atari_get_hardware_list(struct seq_file *m); - -/* atari specific irq functions */ -extern void atari_init_IRQ (void); -extern void atari_mksound(unsigned int count, unsigned int ticks); #ifdef CONFIG_HEARTBEAT static void atari_heartbeat(int on); #endif -/* atari specific timer functions (in time.c) */ -extern void atari_sched_init(void); -extern int atari_mste_hwclk (int, struct rtc_time *); -extern int atari_tt_hwclk (int, struct rtc_time *); - /* ++roman: This is a more elaborate test for an SCC chip, since the plain * Medusa board generates DTACK at the SCC's standard addresses, but a SCC * board in the Medusa is possible. Also, the addresses where the ST_ESCC @@ -880,7 +873,7 @@ static const struct resource atari_falconide_rsrc[] __initconst = { DEFINE_RES_MEM(FALCON_IDE_BASE + 0x38, 2), }; -int __init atari_platform_init(void) +static int __init atari_platform_init(void) { struct platform_device *pdev; int rv = 0; diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c index ce6818eff7..155fefff19 100644 --- a/arch/m68k/atari/stdma.c +++ b/arch/m68k/atari/stdma.c @@ -61,6 +61,7 @@ static irqreturn_t stdma_int (int irq, void *dummy); /** * stdma_try_lock - attempt to acquire ST DMA interrupt "lock" * @handler: interrupt handler to use after acquisition + * @data: cookie passed to the interrupt handler function * * Returns !0 if lock was acquired; otherwise 0. */ diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c index ce79b322a9..922e53bcb8 100644 --- a/arch/m68k/atari/stram.c +++ b/arch/m68k/atari/stram.c @@ -115,7 +115,7 @@ void __init atari_stram_reserve_pages(void *start_mem) * This function is called as arch initcall to reserve the pages needed for * ST-RAM management, if the kernel does not reside in ST-RAM. */ -int __init atari_stram_map_pages(void) +static int __init atari_stram_map_pages(void) { if (!kernel_in_stram) { /* diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index 7e44d0e9d0..3453c6dc6b 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c @@ -23,6 +23,8 @@ #include <asm/atariints.h> #include <asm/machdep.h> +#include "atari.h" + DEFINE_SPINLOCK(rtc_lock); EXPORT_SYMBOL_GPL(rtc_lock); diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index 3a1d90e399..8a2ee69a09 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/bvme6000/config.c * @@ -8,10 +9,6 @@ * linux/amiga/config.c * * Copyright (C) 1993 Hamish Macdonald - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include <linux/types.h> @@ -130,7 +127,7 @@ void __init config_bvme6000(void) } -irqreturn_t bvme6000_abort_int (int irq, void *dev_id) +static irqreturn_t bvme6000_abort_int(int irq, void *dev_id) { unsigned long *new = (unsigned long *)vectors; unsigned long *old = (unsigned long *)0xf8000000; diff --git a/arch/m68k/coldfire/entry.S b/arch/m68k/coldfire/entry.S index 35104c5417..4ea08336e2 100644 --- a/arch/m68k/coldfire/entry.S +++ b/arch/m68k/coldfire/entry.S @@ -1,4 +1,5 @@ -/* +/* SPDX-License-Identifier: GPL-2.0-or-later + * * entry.S -- interrupt and exception processing for ColdFire * * Copyright (C) 1999-2007, Greg Ungerer (gerg@snapgear.com) @@ -13,10 +14,6 @@ * * Copyright (C) 1991, 1992 Linus Torvalds * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. - * * Linux/m68k support by Hamish Macdonald * * 68060 fixes by Jesper Skov diff --git a/arch/m68k/coldfire/intc.c b/arch/m68k/coldfire/intc.c index 20c084e932..b434371e2b 100644 --- a/arch/m68k/coldfire/intc.c +++ b/arch/m68k/coldfire/intc.c @@ -56,7 +56,7 @@ void mcf_clrimr(int index) __raw_writew(imr & ~(0x1 << index), MCFSIM_IMR); } -void mcf_maskimr(unsigned int mask) +static void mcf_maskimr(unsigned int mask) { u16 imr; imr = __raw_readw(MCFSIM_IMR); @@ -80,7 +80,7 @@ void mcf_clrimr(int index) __raw_writel(imr & ~(0x1 << index), MCFSIM_IMR); } -void mcf_maskimr(unsigned int mask) +static void mcf_maskimr(unsigned int mask) { u32 imr; imr = __raw_readl(MCFSIM_IMR); diff --git a/arch/m68k/coldfire/vectors.c b/arch/m68k/coldfire/vectors.c index 3bf0d69eec..c26c255b53 100644 --- a/arch/m68k/coldfire/vectors.c +++ b/arch/m68k/coldfire/vectors.c @@ -18,6 +18,8 @@ #include <asm/mcfsim.h> #include <asm/mcfwdebug.h> +#include "vectors.h" + /***************************************************************************/ #ifdef TRAP_DBG_INTERRUPT diff --git a/arch/m68k/coldfire/vectors.h b/arch/m68k/coldfire/vectors.h new file mode 100644 index 0000000000..0b01450a43 --- /dev/null +++ b/arch/m68k/coldfire/vectors.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +void trap_init(void); diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 6deb8faa56..7e6b74b6ee 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig @@ -299,6 +299,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_AMIGA=m diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index 802c161827..0b403e2efc 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig @@ -295,6 +295,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -568,6 +569,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 2cb3d75587..57aac3f4b0 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig @@ -302,6 +302,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_ATARI=m diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index b13552caa6..3c160636a2 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig @@ -292,6 +292,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -560,6 +561,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index f88356c454..23cf07c49d 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig @@ -294,6 +294,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -570,6 +571,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 7c2ebb616f..619a0d93ce 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig @@ -296,6 +296,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_BLK_DEV_SWIM=m CONFIG_ZRAM=m diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index d3b272910b..d9430bc2b2 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig @@ -316,6 +316,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_PC=m diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index 4529bc4b84..eb6132f29b 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig @@ -291,6 +291,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -559,6 +560,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 30824032e4..d0bad674cb 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig @@ -292,6 +292,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -560,6 +561,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 3911211410..dad6bcfcae 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig @@ -293,6 +293,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_PC=m diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 991730c509..eb1b489b31 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig @@ -288,6 +288,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -558,6 +559,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index e80d7509ab..9395898265 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig @@ -289,6 +289,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -558,6 +559,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/virt_defconfig b/arch/m68k/configs/virt_defconfig index 311b57e733..ce725d39e4 100644 --- a/arch/m68k/configs/virt_defconfig +++ b/arch/m68k/configs/virt_defconfig @@ -45,8 +45,9 @@ CONFIG_INPUT_EVDEV=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_DRM=y +CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_VIRTIO_GPU=y -CONFIG_FB=y +CONFIG_FB_DEVICE=y CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_VIRTIO=y diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c index b19dc00026..777c7b42a5 100644 --- a/arch/m68k/emu/natfeat.c +++ b/arch/m68k/emu/natfeat.c @@ -42,10 +42,10 @@ long nf_get_id(const char *feature_name) { /* feature_name may be in vmalloc()ed memory, so make a copy */ char name_copy[32]; - size_t n; + ssize_t n; - n = strlcpy(name_copy, feature_name, sizeof(name_copy)); - if (n >= sizeof(name_copy)) + n = strscpy(name_copy, feature_name, sizeof(name_copy)); + if (n < 0) return 0; return nf_get_id_phys(virt_to_phys(name_copy)); @@ -56,10 +56,9 @@ void nfprint(const char *fmt, ...) { static char buf[256]; va_list ap; - int n; va_start(ap, fmt); - n = vsnprintf(buf, 256, fmt, ap); + vsnprintf(buf, 256, fmt, ap); nf_call(nf_get_id("NF_STDERR"), virt_to_phys(buf)); va_end(ap); } diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c index 1a5d1e8eb4..26e68813f3 100644 --- a/arch/m68k/emu/nfeth.c +++ b/arch/m68k/emu/nfeth.c @@ -39,7 +39,7 @@ enum { #define MAX_UNIT 8 /* These identify the driver base version and may not be removed. */ -static const char version[] = +static const char version[] __maybe_unused = KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE " S.Opichal, M.Jurik, P.Stehlik\n" KERN_INFO " http://aranym.org/\n"; diff --git a/arch/m68k/fpsp040/slogn.S b/arch/m68k/fpsp040/slogn.S index d98eaf641e..5f3da4aa7e 100644 --- a/arch/m68k/fpsp040/slogn.S +++ b/arch/m68k/fpsp040/slogn.S @@ -261,56 +261,56 @@ slognd: |----the value TWOTO100 is no longer needed. |----Note that this code assumes the denormalized input is NON-ZERO. - moveml %d2-%d7,-(%a7) | ...save some registers - movel #0x00000000,%d3 | ...D3 is exponent of smallest norm. # - movel 4(%a0),%d4 - movel 8(%a0),%d5 | ...(D4,D5) is (Hi_X,Lo_X) - clrl %d2 | ...D2 used for holding K + moveml %d2-%d7,-(%a7) | ...save some registers + movel #0x00000000,%d3 | ...D3 is exponent of smallest norm. # + movel 4(%a0),%d4 + movel 8(%a0),%d5 | ...(D4,D5) is (Hi_X,Lo_X) + clrl %d2 | ...D2 used for holding K - tstl %d4 - bnes HiX_not0 + tstl %d4 + bnes HiX_not0 HiX_0: - movel %d5,%d4 - clrl %d5 - movel #32,%d2 - clrl %d6 - bfffo %d4{#0:#32},%d6 - lsll %d6,%d4 - addl %d6,%d2 | ...(D3,D4,D5) is normalized - - movel %d3,X(%a6) - movel %d4,XFRAC(%a6) - movel %d5,XFRAC+4(%a6) - negl %d2 - movel %d2,ADJK(%a6) - fmovex X(%a6),%fp0 - moveml (%a7)+,%d2-%d7 | ...restore registers - lea X(%a6),%a0 - bras LOGBGN | ...begin regular log(X) + movel %d5,%d4 + clrl %d5 + movel #32,%d2 + clrl %d6 + bfffo %d4{#0:#32},%d6 + lsll %d6,%d4 + addl %d6,%d2 | ...(D3,D4,D5) is normalized + + movel %d3,X(%a6) + movel %d4,XFRAC(%a6) + movel %d5,XFRAC+4(%a6) + negl %d2 + movel %d2,ADJK(%a6) + fmovex X(%a6),%fp0 + moveml (%a7)+,%d2-%d7 | ...restore registers + lea X(%a6),%a0 + bras LOGBGN | ...begin regular log(X) HiX_not0: - clrl %d6 - bfffo %d4{#0:#32},%d6 | ...find first 1 - movel %d6,%d2 | ...get k - lsll %d6,%d4 - movel %d5,%d7 | ...a copy of D5 - lsll %d6,%d5 - negl %d6 - addil #32,%d6 - lsrl %d6,%d7 - orl %d7,%d4 | ...(D3,D4,D5) normalized - - movel %d3,X(%a6) - movel %d4,XFRAC(%a6) - movel %d5,XFRAC+4(%a6) - negl %d2 - movel %d2,ADJK(%a6) - fmovex X(%a6),%fp0 - moveml (%a7)+,%d2-%d7 | ...restore registers - lea X(%a6),%a0 - bras LOGBGN | ...begin regular log(X) + clrl %d6 + bfffo %d4{#0:#32},%d6 | ...find first 1 + movel %d6,%d2 | ...get k + lsll %d6,%d4 + movel %d5,%d7 | ...a copy of D5 + lsll %d6,%d5 + negl %d6 + addil #32,%d6 + lsrl %d6,%d7 + orl %d7,%d4 | ...(D3,D4,D5) normalized + + movel %d3,X(%a6) + movel %d4,XFRAC(%a6) + movel %d5,XFRAC+4(%a6) + negl %d2 + movel %d2,ADJK(%a6) + fmovex X(%a6),%fp0 + moveml (%a7)+,%d2-%d7 | ...restore registers + lea X(%a6),%a0 + bras LOGBGN | ...begin regular log(X) .global slogn diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 1d1b7b3b5d..72621fb9f3 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -20,6 +20,8 @@ #include <asm/traps.h> #include <asm/blinken.h> +#include "time.h" + static u64 hp300_read_clk(struct clocksource *cs); static struct clocksource hp300_clk = { diff --git a/arch/m68k/ifpsp060/Makefile b/arch/m68k/ifpsp060/Makefile index 56b530a96c..00d0621f54 100644 --- a/arch/m68k/ifpsp060/Makefile +++ b/arch/m68k/ifpsp060/Makefile @@ -1,7 +1,5 @@ -# Makefile for 680x0 Linux 68060 integer/floating point support package +# SPDX-License-Identifier: GPL-2.0-or-later # -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "README.legal" in the main directory of this archive -# for more details. +# Makefile for 680x0 Linux 68060 integer/floating point support package obj-y := fskeleton.o iskeleton.o os.o diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h index e984af71df..14c64a6f12 100644 --- a/arch/m68k/include/asm/bitops.h +++ b/arch/m68k/include/asm/bitops.h @@ -319,6 +319,27 @@ arch___test_and_change_bit(unsigned long nr, volatile unsigned long *addr) return test_and_change_bit(nr, addr); } +static inline bool xor_unlock_is_negative_byte(unsigned long mask, + volatile unsigned long *p) +{ +#ifdef CONFIG_COLDFIRE + __asm__ __volatile__ ("eorl %1, %0" + : "+m" (*p) + : "d" (mask) + : "memory"); + return *p & (1 << 7); +#else + char result; + char *cp = (char *)p + 3; /* m68k is big-endian */ + + __asm__ __volatile__ ("eor.b %1, %2; smi %0" + : "=d" (result) + : "di" (mask), "o" (*cp) + : "memory"); + return result; +#endif +} + /* * The true 68020 and more advanced processors support the "bfffo" * instruction for finding bits. ColdFire and simple 68000 parts diff --git a/arch/m68k/include/asm/cacheflush_mm.h b/arch/m68k/include/asm/cacheflush_mm.h index ed12358c47..9a71b01484 100644 --- a/arch/m68k/include/asm/cacheflush_mm.h +++ b/arch/m68k/include/asm/cacheflush_mm.h @@ -191,6 +191,7 @@ extern void cache_push_v(unsigned long vaddr, int len); #define flush_cache_all() __flush_cache_all() #define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) flush_cache_all() static inline void flush_cache_mm(struct mm_struct *mm) diff --git a/arch/m68k/include/asm/dvma.h b/arch/m68k/include/asm/dvma.h index f609ec1de3..d1d66d0484 100644 --- a/arch/m68k/include/asm/dvma.h +++ b/arch/m68k/include/asm/dvma.h @@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr); #define dvma_vtob(x) dvma_vtop(x) #define dvma_btov(x) dvma_ptov(x) +void sun3_dvma_init(void); + static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len) { return 0; } +static inline void dvma_unmap_iommu(unsigned long baddr, int len) { } + #else /* Sun3x */ /* sun3x dvma page support */ @@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, #define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff) #define dvma_btov(x) ((unsigned long)(x) | 0xff000000) -extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); +static inline void sun3_dvma_init(void) { } +int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); +void dvma_unmap_iommu(unsigned long baddr, int len); /* everything below this line is specific to dma used for the onboard ESP scsi on sun3x */ diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/fb.h index 24273fc7ad..9941b7434b 100644 --- a/arch/m68k/include/asm/fb.h +++ b/arch/m68k/include/asm/fb.h @@ -5,26 +5,27 @@ #include <asm/page.h> #include <asm/setup.h> -struct file; - -static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, - unsigned long off) +static inline pgprot_t pgprot_framebuffer(pgprot_t prot, + unsigned long vm_start, unsigned long vm_end, + unsigned long offset) { #ifdef CONFIG_MMU #ifdef CONFIG_SUN3 - pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; + pgprot_val(prot) |= SUN3_PAGE_NOCACHE; #else if (CPU_IS_020_OR_030) - pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; + pgprot_val(prot) |= _PAGE_NOCACHE030; if (CPU_IS_040_OR_060) { - pgprot_val(vma->vm_page_prot) &= _CACHEMASK040; + pgprot_val(prot) &= _CACHEMASK040; /* Use no-cache mode, serialized */ - pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; + pgprot_val(prot) |= _PAGE_NOCACHE_S; } #endif /* CONFIG_SUN3 */ #endif /* CONFIG_MMU */ + + return prot; } -#define fb_pgprotect fb_pgprotect +#define pgprot_framebuffer pgprot_framebuffer #include <asm-generic/fb.h> diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h index 6a0abd4846..47525f2a57 100644 --- a/arch/m68k/include/asm/io_mm.h +++ b/arch/m68k/include/asm/io_mm.h @@ -272,20 +272,20 @@ static inline void isa_delay(void) #define isa_outsb(port, buf, nr) raw_outsb(isa_itb(port), (u8 *)(buf), (nr)) #define isa_insw(port, buf, nr) \ - (ISA_SEX ? raw_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #define isa_outsw(port, buf, nr) \ - (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #define isa_insl(port, buf, nr) \ - (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \ - raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) + (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \ + raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) #define isa_outsl(port, buf, nr) \ - (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ - raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) + (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ + raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) #ifdef CONFIG_ATARI_ROM_ISA @@ -297,14 +297,14 @@ static inline void isa_delay(void) #define isa_rom_insb(port, buf, nr) raw_rom_insb(isa_itb(port), (u8 *)(buf), (nr)) #define isa_rom_insw(port, buf, nr) \ - (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr)) #define isa_rom_outsw(port, buf, nr) \ - (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #endif /* CONFIG_ATARI_ROM_ISA */ #endif /* CONFIG_ISA || CONFIG_ATARI_ROM_ISA */ diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h index 7829e955ca..14992fde73 100644 --- a/arch/m68k/include/asm/irq.h +++ b/arch/m68k/include/asm/irq.h @@ -2,6 +2,9 @@ #ifndef _M68K_IRQ_H_ #define _M68K_IRQ_H_ +#include <linux/atomic.h> +#include <linux/linkage.h> + /* * This should be the same as the max(NUM_X_SOURCES) for all the * different m68k hosts compiled into the kernel. @@ -59,6 +62,8 @@ struct irq_data; struct irq_chip; struct irq_desc; +struct pt_regs; + extern unsigned int m68k_irq_startup(struct irq_data *data); extern unsigned int m68k_irq_startup_irq(unsigned int irq); extern void m68k_irq_shutdown(struct irq_data *data); diff --git a/arch/m68k/include/asm/kexec.h b/arch/m68k/include/asm/kexec.h index f5a8b2defa..3b0b64f0a3 100644 --- a/arch/m68k/include/asm/kexec.h +++ b/arch/m68k/include/asm/kexec.h @@ -2,7 +2,7 @@ #ifndef _ASM_M68K_KEXEC_H #define _ASM_M68K_KEXEC_H -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE /* Maximum physical address we can use pages from */ #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) @@ -25,6 +25,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs, #endif /* __ASSEMBLY__ */ -#endif /* CONFIG_KEXEC */ +#endif /* CONFIG_KEXEC_CORE */ #endif /* _ASM_M68K_KEXEC_H */ diff --git a/arch/m68k/include/asm/mcfgpio.h b/arch/m68k/include/asm/mcfgpio.h index 7abd322c01..019f244395 100644 --- a/arch/m68k/include/asm/mcfgpio.h +++ b/arch/m68k/include/asm/mcfgpio.h @@ -8,10 +8,6 @@ #ifndef mcfgpio_h #define mcfgpio_h -#ifdef CONFIG_GPIOLIB -#include <linux/gpio.h> -#else - int __mcfgpio_get_value(unsigned gpio); void __mcfgpio_set_value(unsigned gpio, int value); int __mcfgpio_direction_input(unsigned gpio); @@ -19,6 +15,10 @@ int __mcfgpio_direction_output(unsigned gpio, int value); int __mcfgpio_request(unsigned gpio); void __mcfgpio_free(unsigned gpio); +#ifdef CONFIG_GPIOLIB +#include <linux/gpio.h> +#else + /* our alternate 'gpiolib' functions */ static inline int __gpio_get_value(unsigned gpio) { diff --git a/arch/m68k/include/asm/nettel.h b/arch/m68k/include/asm/nettel.h index 45716ead7b..3bd4b7a461 100644 --- a/arch/m68k/include/asm/nettel.h +++ b/arch/m68k/include/asm/nettel.h @@ -14,9 +14,8 @@ #define nettel_h /****************************************************************************/ - /****************************************************************************/ -#ifdef CONFIG_NETtel +#if defined(CONFIG_NETtel) || defined(CONFIG_CLEOPATRA) /****************************************************************************/ #ifdef CONFIG_COLDFIRE @@ -26,7 +25,7 @@ #endif /*---------------------------------------------------------------------------*/ -#if defined(CONFIG_M5307) +#if defined(CONFIG_M5307) || defined(CONFIG_M5407) /* * NETtel/5307 based hardware first. DTR/DCD lines are wired to * GPIO lines. Most of the LED's are driver through a latch diff --git a/arch/m68k/include/asm/oplib.h b/arch/m68k/include/asm/oplib.h index 48cb4fd09f..6d5ea67c65 100644 --- a/arch/m68k/include/asm/oplib.h +++ b/arch/m68k/include/asm/oplib.h @@ -9,6 +9,8 @@ #ifndef __SPARC_OPLIB_H #define __SPARC_OPLIB_H +#include <linux/compiler.h> + #include <asm/openprom.h> /* The master romvec pointer... */ @@ -149,7 +151,7 @@ extern char prom_getchar(void); extern void prom_putchar(char character); /* Prom's internal printf routine, don't use in kernel/boot code. */ -void prom_printf(char *fmt, ...); +__printf(1, 2) void prom_printf(char *fmt, ...); /* Query for input device type */ diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index 363aa0f9ba..e0ae4d5fc9 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -13,17 +13,16 @@ #ifdef CPU_M68040_OR_M68060_ONLY static inline void copy_page(void *to, void *from) { - unsigned long tmp; - - __asm__ __volatile__("1:\t" - ".chip 68040\n\t" - "move16 %1@+,%0@+\n\t" - "move16 %1@+,%0@+\n\t" - ".chip 68k\n\t" - "dbra %2,1b\n\t" - : "=a" (to), "=a" (from), "=d" (tmp) - : "0" (to), "1" (from) , "2" (PAGE_SIZE / 32 - 1) - ); + unsigned long tmp; + + __asm__ __volatile__("1:\t" + ".chip 68040\n\t" + "move16 %1@+,%0@+\n\t" + "move16 %1@+,%0@+\n\t" + ".chip 68k\n\t" + "dbra %2,1b\n\t" + : "=a" (to), "=a" (from), "=d" (tmp) + : "0" (to), "1" (from), "2" (PAGE_SIZE / 32 - 1)); } static inline void clear_page(void *page) @@ -95,23 +94,23 @@ static inline void *__va(unsigned long paddr) #define __pa(x) ___pa((unsigned long)(x)) static inline unsigned long ___pa(unsigned long x) { - if(x == 0) - return 0; - if(x >= PAGE_OFFSET) - return (x-PAGE_OFFSET); - else - return (x+0x2000000); + if (x == 0) + return 0; + if (x >= PAGE_OFFSET) + return (x - PAGE_OFFSET); + else + return (x + 0x2000000); } static inline void *__va(unsigned long x) { - if(x == 0) - return (void *)0; + if (x == 0) + return (void *)0; - if(x < 0x2000000) - return (void *)(x+PAGE_OFFSET); - else - return (void *)(x-0x2000000); + if (x < 0x2000000) + return (void *)(x + PAGE_OFFSET); + else + return (void *)(x - 0x2000000); } #endif /* CONFIG_SUN3 */ diff --git a/arch/m68k/include/asm/pgtable.h b/arch/m68k/include/asm/pgtable.h index ad15d655a9..27525c6a12 100644 --- a/arch/m68k/include/asm/pgtable.h +++ b/arch/m68k/include/asm/pgtable.h @@ -1,6 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __M68K_PGTABLE_H +#define __M68K_PGTABLE_H + #ifdef __uClinux__ #include <asm/pgtable_no.h> #else #include <asm/pgtable_mm.h> #endif + +#ifndef __ASSEMBLY__ +extern void paging_init(void); +#endif + +#endif /* __M68K_PGTABLE_H */ diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h index fc044df52b..1a86c15b90 100644 --- a/arch/m68k/include/asm/pgtable_no.h +++ b/arch/m68k/include/asm/pgtable_no.h @@ -28,7 +28,6 @@ #define PAGE_READONLY __pgprot(0) #define PAGE_KERNEL __pgprot(0) -extern void paging_init(void); #define swapper_pg_dir ((pgd_t *) 0) /* diff --git a/arch/m68k/include/asm/raw_io.h b/arch/m68k/include/asm/raw_io.h index 3ba40bc1df..95a6ff694a 100644 --- a/arch/m68k/include/asm/raw_io.h +++ b/arch/m68k/include/asm/raw_io.h @@ -17,15 +17,15 @@ * two accesses to memory, which may be undesirable for some devices. */ #define in_8(addr) \ - ({ u8 __v = (*(__force volatile u8 *) (unsigned long)(addr)); __v; }) + ({ u8 __v = (*(__force const volatile u8 *) (unsigned long)(addr)); __v; }) #define in_be16(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (unsigned long)(addr)); __v; }) + ({ u16 __v = (*(__force const volatile u16 *) (unsigned long)(addr)); __v; }) #define in_be32(addr) \ - ({ u32 __v = (*(__force volatile u32 *) (unsigned long)(addr)); __v; }) + ({ u32 __v = (*(__force const volatile u32 *) (unsigned long)(addr)); __v; }) #define in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (unsigned long)(addr)); __v; }) + ({ u16 __v = le16_to_cpu(*(__force const volatile __le16 *) (unsigned long)(addr)); __v; }) #define in_le32(addr) \ - ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (unsigned long)(addr)); __v; }) + ({ u32 __v = le32_to_cpu(*(__force const volatile __le32 *) (unsigned long)(addr)); __v; }) #define out_8(addr,b) (void)((*(__force volatile u8 *) (unsigned long)(addr)) = (b)) #define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w)) @@ -73,11 +73,11 @@ #if defined(CONFIG_ATARI_ROM_ISA) #define rom_in_8(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (addr)); __v >>= 8; __v; }) + ({ u16 __v = (*(__force const volatile u16 *) (addr)); __v >>= 8; __v; }) #define rom_in_be16(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) + ({ u16 __v = (*(__force const volatile u16 *) (addr)); __v; }) #define rom_in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) + ({ u16 __v = le16_to_cpu(*(__force const volatile u16 *) (addr)); __v; }) #define rom_out_8(addr, b) \ (void)({u8 __maybe_unused __w, __v = (b); u32 _addr = ((u32) (addr)); \ @@ -98,7 +98,8 @@ #define raw_rom_outw(val, port) rom_out_be16((port), (val)) #endif /* CONFIG_ATARI_ROM_ISA */ -static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) +static inline void raw_insb(const volatile u8 __iomem *port, u8 *buf, + unsigned int len) { unsigned int i; @@ -146,7 +147,7 @@ static inline void raw_outsb(volatile u8 __iomem *port, const u8 *buf, } } -static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) +static inline void raw_insw(volatile const u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int tmp; @@ -225,7 +226,7 @@ static inline void raw_outsw(volatile u16 __iomem *port, const u16 *buf, } } -static inline void raw_insl(volatile u32 __iomem *port, u32 *buf, unsigned int nr) +static inline void raw_insl(const volatile u32 __iomem *port, u32 *buf, unsigned int nr) { unsigned int tmp; @@ -305,7 +306,7 @@ static inline void raw_outsl(volatile u32 __iomem *port, const u32 *buf, } -static inline void raw_insw_swapw(volatile u16 __iomem *port, u16 *buf, +static inline void raw_insw_swapw(const volatile u16 __iomem *port, u16 *buf, unsigned int nr) { if ((nr) % 8) @@ -413,7 +414,8 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, #if defined(CONFIG_ATARI_ROM_ISA) -static inline void raw_rom_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) +static inline void raw_rom_insb(const volatile u8 __iomem *port, u8 *buf, + unsigned int len) { unsigned int i; @@ -430,7 +432,7 @@ static inline void raw_rom_outsb(volatile u8 __iomem *port, const u8 *buf, rom_out_8(port, *buf++); } -static inline void raw_rom_insw(volatile u16 __iomem *port, u16 *buf, +static inline void raw_rom_insw(const volatile u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int i; @@ -448,7 +450,7 @@ static inline void raw_rom_outsw(volatile u16 __iomem *port, const u16 *buf, rom_out_be16(port, *buf++); } -static inline void raw_rom_insw_swapw(volatile u16 __iomem *port, u16 *buf, +static inline void raw_rom_insw_swapw(const volatile u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int i; diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index ff48573db2..4a137eecb6 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h @@ -41,12 +41,12 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page static inline pgd_t * pgd_alloc(struct mm_struct *mm) { - pgd_t *new_pgd; + pgd_t *new_pgd; - new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); - memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); - memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); - return new_pgd; + new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); + memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); + memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); + return new_pgd; } #endif /* SUN3_PGALLOC_H */ diff --git a/arch/m68k/include/asm/syscalls.h b/arch/m68k/include/asm/syscalls.h new file mode 100644 index 0000000000..fb3639acd0 --- /dev/null +++ b/arch/m68k/include/asm/syscalls.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _ASM_M68K_SYSCALLS_H +#define _ASM_M68K_SYSCALLS_H + +#include <linux/compiler_types.h> +#include <linux/linkage.h> + +asmlinkage int sys_cacheflush(unsigned long addr, int scope, int cache, + unsigned long len); +asmlinkage int sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, + int d4, int d5, unsigned long __user *mem); +asmlinkage int sys_getpagesize(void); +asmlinkage unsigned long sys_get_thread_area(void); +asmlinkage int sys_set_thread_area(unsigned long tp); +asmlinkage int sys_atomic_barrier(void); + +#include <asm-generic/syscalls.h> + +#endif /* _ASM_M68K_SYSCALLS_H */ diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h index b882e2f4f5..6d42e29068 100644 --- a/arch/m68k/include/asm/tlbflush.h +++ b/arch/m68k/include/asm/tlbflush.h @@ -112,53 +112,51 @@ extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM]; sun?) */ static inline void flush_tlb_all(void) { - unsigned long addr; - unsigned char ctx, oldctx; - - oldctx = sun3_get_context(); - for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { - for(ctx = 0; ctx < 8; ctx++) { - sun3_put_context(ctx); - sun3_put_segmap(addr, SUN3_INVALID_PMEG); - } - } - - sun3_put_context(oldctx); - /* erase all of the userspace pmeg maps, we've clobbered them - all anyway */ - for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) { - if(pmeg_alloc[addr] == 1) { - pmeg_alloc[addr] = 0; - pmeg_ctx[addr] = 0; - pmeg_vaddr[addr] = 0; - } - } + unsigned long addr; + unsigned char ctx, oldctx; + oldctx = sun3_get_context(); + for (addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { + for (ctx = 0; ctx < 8; ctx++) { + sun3_put_context(ctx); + sun3_put_segmap(addr, SUN3_INVALID_PMEG); + } + } + + sun3_put_context(oldctx); + /* erase all of the userspace pmeg maps, we've clobbered them + all anyway */ + for (addr = 0; addr < SUN3_INVALID_PMEG; addr++) { + if (pmeg_alloc[addr] == 1) { + pmeg_alloc[addr] = 0; + pmeg_ctx[addr] = 0; + pmeg_vaddr[addr] = 0; + } + } } /* Clear user TLB entries within the context named in mm */ static inline void flush_tlb_mm (struct mm_struct *mm) { - unsigned char oldctx; - unsigned char seg; - unsigned long i; - - oldctx = sun3_get_context(); - sun3_put_context(mm->context); + unsigned char oldctx; + unsigned char seg; + unsigned long i; - for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { - seg = sun3_get_segmap(i); - if(seg == SUN3_INVALID_PMEG) - continue; + oldctx = sun3_get_context(); + sun3_put_context(mm->context); - sun3_put_segmap(i, SUN3_INVALID_PMEG); - pmeg_alloc[seg] = 0; - pmeg_ctx[seg] = 0; - pmeg_vaddr[seg] = 0; - } + for (i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { + seg = sun3_get_segmap(i); + if (seg == SUN3_INVALID_PMEG) + continue; - sun3_put_context(oldctx); + sun3_put_segmap(i, SUN3_INVALID_PMEG); + pmeg_alloc[seg] = 0; + pmeg_ctx[seg] = 0; + pmeg_vaddr[seg] = 0; + } + sun3_put_context(oldctx); } /* Flush a single TLB page. In this case, we're limited to flushing a @@ -208,6 +206,7 @@ static inline void flush_tlb_range (struct vm_area_struct *vma, next: start += SUN3_PMEG_SIZE; } + sun3_put_context(oldctx); } static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index af015447df..f335bf3268 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -23,9 +23,9 @@ obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o obj-$(CONFIG_MMU_SUN3) += ints.o vectors.o obj-$(CONFIG_PCI) += pcibios.o -obj-$(CONFIG_HAS_DMA) += dma.o +obj-$(CONFIG_M68K_NONCOHERENT_DMA) += dma.o -obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o +obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o obj-$(CONFIG_BOOTINFO_PROC) += bootinfo_proc.o obj-$(CONFIG_UBOOT) += uboot.o diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index 2e192a5df9..16063783aa 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c @@ -4,20 +4,11 @@ * for more details. */ -#undef DEBUG - #include <linux/dma-map-ops.h> -#include <linux/device.h> #include <linux/kernel.h> -#include <linux/platform_device.h> -#include <linux/scatterlist.h> -#include <linux/slab.h> -#include <linux/vmalloc.h> -#include <linux/export.h> - #include <asm/cacheflush.h> -#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE) +#ifndef CONFIG_COLDFIRE void arch_dma_prep_coherent(struct page *page, size_t size) { cache_push(page_to_phys(page), size); @@ -33,29 +24,6 @@ pgprot_t pgprot_dmacoherent(pgprot_t prot) } return prot; } -#else -void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, - gfp_t gfp, unsigned long attrs) -{ - void *ret; - - if (dev == NULL || (*dev->dma_mask < 0xffffffff)) - gfp |= GFP_DMA; - ret = (void *)__get_free_pages(gfp, get_order(size)); - - if (ret != NULL) { - memset(ret, 0, size); - *dma_handle = virt_to_phys(ret); - } - return ret; -} - -void arch_dma_free(struct device *dev, size_t size, void *vaddr, - dma_addr_t dma_handle, unsigned long attrs) -{ - free_pages((unsigned long)vaddr, get_order(size)); -} - #endif /* CONFIG_MMU && !CONFIG_COLDFIRE */ void arch_sync_dma_for_device(phys_addr_t handle, size_t size, diff --git a/arch/m68k/kernel/early_printk.c b/arch/m68k/kernel/early_printk.c index 7d3fe08a48..3cc944df04 100644 --- a/arch/m68k/kernel/early_printk.c +++ b/arch/m68k/kernel/early_printk.c @@ -12,8 +12,8 @@ #include <linux/string.h> #include <asm/setup.h> -extern void mvme16x_cons_write(struct console *co, - const char *str, unsigned count); + +#include "../mvme16x/mvme16x.h" asmlinkage void __init debug_cons_nputs(const char *s, unsigned n); diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 4dd2fd7acb..3bcdd32a6b 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -1,13 +1,10 @@ -/* -*- mode: asm -*- +/* SPDX-License-Identifier: GPL-2.0-or-later + * -*- mode: asm -*- * * linux/arch/m68k/kernel/entry.S * * Copyright (C) 1991, 1992 Linus Torvalds * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. - * * Linux/m68k support by Hamish Macdonald * * 68060 fixes by Jesper Skov diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 9e812d8606..852255cf60 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -1,4 +1,5 @@ -/* -*- mode: asm -*- +/* SPDX-License-Identifier: GPL-2.0-or-later +** -*- mode: asm -*- ** ** head.S -- This file contains the initial boot code for the ** Linux/68k kernel. @@ -25,11 +26,6 @@ ** for linux-2.1.115 ** 1999/02/11 Richard Zidlicky: added Q40 support (initial version 99/01/01) ** 2004/05/13 Kars de Jong: Finalised HP300 support -** -** This file is subject to the terms and conditions of the GNU General Public -** License. See the file README.legal in the main directory of this archive -** for more details. -** */ /* diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 5b8d66fbf3..cf2b134884 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c @@ -26,6 +26,8 @@ #include <asm/q40ints.h> #endif +#include "ints.h" + extern u32 auto_irqhandler_fixup[]; extern u16 user_irqvec_fixup[]; diff --git a/arch/m68k/kernel/ints.h b/arch/m68k/kernel/ints.h new file mode 100644 index 0000000000..ecac6011c1 --- /dev/null +++ b/arch/m68k/kernel/ints.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> + +struct pt_regs; + +asmlinkage void handle_badint(struct pt_regs *regs); diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index e06ce147c0..2584e94e21 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -38,6 +38,7 @@ #include <asm/machdep.h> #include <asm/setup.h> +#include "process.h" asmlinkage void ret_from_fork(void); asmlinkage void ret_from_kernel_thread(void); diff --git a/arch/m68k/kernel/process.h b/arch/m68k/kernel/process.h new file mode 100644 index 0000000000..d31745f2e6 --- /dev/null +++ b/arch/m68k/kernel/process.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <linux/linkage.h> + +struct pt_regs; + +asmlinkage int m68k_clone(struct pt_regs *regs); +asmlinkage int m68k_clone3(struct pt_regs *regs); diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index cd0172d294..c20d590e42 100644 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c @@ -26,6 +26,8 @@ #include <asm/page.h> #include <asm/processor.h> +#include "ptrace.h" + /* * does not yet catch signals sent when the child dies. * in exit.c or in signal.c. diff --git a/arch/m68k/kernel/ptrace.h b/arch/m68k/kernel/ptrace.h new file mode 100644 index 0000000000..77018037f1 --- /dev/null +++ b/arch/m68k/kernel/ptrace.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> + +asmlinkage int syscall_trace_enter(void); +asmlinkage void syscall_trace_leave(void); diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index 6f1ae01f32..10310b04f7 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -107,8 +107,6 @@ EXPORT_SYMBOL(isa_sex); #define MASK_256K 0xfffc0000 -extern void paging_init(void); - static void __init m68k_parse_bootinfo(const struct bi_record *record) { const struct bi_record *first_record = record; diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index ba468b5f3f..e628b859ef 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -51,6 +51,8 @@ #include <asm/ucontext.h> #include <asm/cacheflush.h> +#include "signal.h" + #ifdef CONFIG_MMU /* @@ -1109,7 +1111,7 @@ static void do_signal(struct pt_regs *regs) restore_saved_sigmask(); } -void do_notify_resume(struct pt_regs *regs) +asmlinkage void do_notify_resume(struct pt_regs *regs) { if (test_thread_flag(TIF_NOTIFY_SIGNAL) || test_thread_flag(TIF_SIGPENDING)) diff --git a/arch/m68k/kernel/signal.h b/arch/m68k/kernel/signal.h new file mode 100644 index 0000000000..498d84f828 --- /dev/null +++ b/arch/m68k/kernel/signal.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> + +asmlinkage void do_notify_resume(struct pt_regs *regs); +asmlinkage void *do_sigreturn(struct pt_regs *regs, struct switch_stack *sw); +asmlinkage void *do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw); diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index c586034d2a..1af5e60824 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -27,6 +27,7 @@ #include <asm/cachectl.h> #include <asm/traps.h> #include <asm/page.h> +#include <asm/syscalls.h> #include <asm/unistd.h> #include <asm/cacheflush.h> @@ -34,8 +35,7 @@ #include <asm/tlb.h> -asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, - unsigned long error_code); +#include "../mm/fault.h" asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 259ceb1253..7a4b780e82 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -255,7 +255,7 @@ 245 common io_cancel sys_io_cancel 246 common fadvise64 sys_fadvise64 247 common exit_group sys_exit_group -248 common lookup_dcookie sys_lookup_dcookie +248 common lookup_dcookie sys_ni_syscall 249 common epoll_create sys_epoll_create 250 common epoll_ctl sys_epoll_ctl 251 common epoll_wait sys_epoll_wait @@ -452,3 +452,7 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index a700807c9b..53d0cf343d 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -41,6 +41,9 @@ #include <asm/siginfo.h> #include <asm/tlbflush.h> +#include "traps.h" +#include "../mm/fault.h" + static const char *vec_names[] = { [VEC_RESETSP] = "RESET SP", [VEC_RESETPC] = "RESET PC", @@ -124,10 +127,6 @@ static const char *space_names[] = { }; void die_if_kernel(char *,struct pt_regs *,int); -asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, - unsigned long error_code); -int send_fault_sig(struct pt_regs *regs); - asmlinkage void trap_c(struct frame *fp); #if defined (CONFIG_M68060) @@ -365,7 +364,7 @@ disable_wb: #if defined(CONFIG_SUN3) #include <asm/sun3mmu.h> -extern int mmu_emu_handle_fault (unsigned long, int, int); +#include "../sun3/sun3.h" /* sun3 version of bus_error030 */ @@ -487,10 +486,10 @@ static inline void bus_error030 (struct frame *fp) if (buserr_type & SUN3_BUSERR_INVALID) { if (!mmu_emu_handle_fault(addr, 1, 0)) do_page_fault (&fp->ptregs, addr, 0); - } else { + } else { pr_debug("protection fault on insn access (segv).\n"); force_sig (SIGSEGV); - } + } } #else #if defined(CPU_M68020_OR_M68030) @@ -851,9 +850,9 @@ void show_registers(struct pt_regs *regs) pr_info("PC: [<%08lx>] %pS\n", regs->pc, (void *)regs->pc); pr_info("SR: %04x SP: %p a2: %08lx\n", regs->sr, regs, regs->a2); pr_info("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", - regs->d0, regs->d1, regs->d2, regs->d3); + regs->d0, regs->d1, regs->d2, regs->d3); pr_info("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", - regs->d4, regs->d5, regs->a0, regs->a1); + regs->d4, regs->d5, regs->a0, regs->a1); pr_info("Process %s (pid: %d, task=%p)\n", current->comm, task_pid_nr(current), current); @@ -965,7 +964,7 @@ void show_stack(struct task_struct *task, unsigned long *stack, * real 68k parts, but it won't hurt either. */ -void bad_super_trap (struct frame *fp) +static void bad_super_trap(struct frame *fp) { int vector = (fp->ptregs.vector >> 2) & 0xff; diff --git a/arch/m68k/kernel/traps.h b/arch/m68k/kernel/traps.h new file mode 100644 index 0000000000..6414b4a0e5 --- /dev/null +++ b/arch/m68k/kernel/traps.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> + +struct frame; + +asmlinkage void buserr_c(struct frame *fp); +asmlinkage void fpemu_signal(int signal, int code, void *addr); +asmlinkage void fpsp040_die(void); +asmlinkage void set_esp0(unsigned long ssp); diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c index 928dbd33fc..8bb1cb3a74 100644 --- a/arch/m68k/kernel/uboot.c +++ b/arch/m68k/kernel/uboot.c @@ -27,6 +27,7 @@ #include <asm/irq.h> #include <asm/machdep.h> #include <asm/sections.h> +#include <asm/bootinfo.h> /* * parse_uboot_commandline @@ -63,20 +64,22 @@ static void __init parse_uboot_commandline(char *commandp, int size) { extern unsigned long _init_sp; unsigned long *sp; - unsigned long uboot_kbd; - unsigned long uboot_initrd_start, uboot_initrd_end; unsigned long uboot_cmd_start, uboot_cmd_end; +#if defined(CONFIG_BLK_DEV_INITRD) + unsigned long uboot_initrd_start, uboot_initrd_end; +#endif /* if defined(CONFIG_BLK_DEV_INITRD) */ sp = (unsigned long *)_init_sp; - uboot_kbd = sp[1]; - uboot_initrd_start = sp[2]; - uboot_initrd_end = sp[3]; uboot_cmd_start = sp[4]; uboot_cmd_end = sp[5]; if (uboot_cmd_start && uboot_cmd_end) strncpy(commandp, (const char *)uboot_cmd_start, size); + #if defined(CONFIG_BLK_DEV_INITRD) + uboot_initrd_start = sp[2]; + uboot_initrd_end = sp[3]; + if (uboot_initrd_start && uboot_initrd_end && (uboot_initrd_end > uboot_initrd_start)) { initrd_start = uboot_initrd_start; diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c index 322c977bb9..667e848070 100644 --- a/arch/m68k/kernel/vectors.c +++ b/arch/m68k/kernel/vectors.c @@ -17,6 +17,7 @@ /* * Sets up all exception vectors */ +#include <linux/cpu.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/linkage.h> @@ -27,6 +28,8 @@ #include <asm/fpu.h> #include <asm/traps.h> +#include "vectors.h" + /* assembler routines */ asmlinkage void system_call(void); asmlinkage void buserr(void); diff --git a/arch/m68k/kernel/vectors.h b/arch/m68k/kernel/vectors.h new file mode 100644 index 0000000000..897330737e --- /dev/null +++ b/arch/m68k/kernel/vectors.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +void base_trap_init(void); diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile index eca17f14b4..9158688e6c 100644 --- a/arch/m68k/lib/Makefile +++ b/arch/m68k/lib/Makefile @@ -4,8 +4,7 @@ # Makefile for m68k-specific library files.. # -lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ - memcpy.o memset.o memmove.o +lib-y := muldi3.o memcpy.o memset.o memmove.o lib-$(CONFIG_MMU) += uaccess.o lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += mulsi3.o divsi3.o udivsi3.o diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c deleted file mode 100644 index ac08f81413..0000000000 --- a/arch/m68k/lib/ashldi3.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ashrdi3.c extracted from gcc-2.95.2/libgcc2.c which is: */ -/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. */ - -#include <linux/compiler.h> -#include <linux/export.h> - -#define BITS_PER_UNIT 8 - -typedef int SItype __mode(SI); -typedef unsigned int USItype __mode(SI); -typedef int DItype __mode(DI); -typedef int word_type __mode(__word__); - -struct DIstruct {SItype high, low;}; - -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; - -DItype -__ashldi3 (DItype u, word_type b) -{ - DIunion w; - word_type bm; - DIunion uu; - - if (b == 0) - return u; - - uu.ll = u; - - bm = (sizeof (SItype) * BITS_PER_UNIT) - b; - if (bm <= 0) - { - w.s.low = 0; - w.s.high = (USItype)uu.s.low << -bm; - } - else - { - USItype carries = (USItype)uu.s.low >> bm; - w.s.low = (USItype)uu.s.low << b; - w.s.high = ((USItype)uu.s.high << b) | carries; - } - - return w.ll; -} -EXPORT_SYMBOL(__ashldi3); diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c deleted file mode 100644 index 5837b1dd33..0000000000 --- a/arch/m68k/lib/ashrdi3.c +++ /dev/null @@ -1,62 +0,0 @@ -/* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */ -/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. */ - -#include <linux/compiler.h> -#include <linux/export.h> - -#define BITS_PER_UNIT 8 - -typedef int SItype __mode(SI); -typedef unsigned int USItype __mode(SI); -typedef int DItype __mode(DI); -typedef int word_type __mode(__word__); - -struct DIstruct {SItype high, low;}; - -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; - -DItype -__ashrdi3 (DItype u, word_type b) -{ - DIunion w; - word_type bm; - DIunion uu; - - if (b == 0) - return u; - - uu.ll = u; - - bm = (sizeof (SItype) * BITS_PER_UNIT) - b; - if (bm <= 0) - { - /* w.s.high = 1..1 or 0..0 */ - w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1); - w.s.low = uu.s.high >> -bm; - } - else - { - USItype carries = (USItype)uu.s.high << bm; - w.s.high = uu.s.high >> b; - w.s.low = ((USItype)uu.s.low >> b) | carries; - } - - return w.ll; -} -EXPORT_SYMBOL(__ashrdi3); diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c deleted file mode 100644 index 7f40566be6..0000000000 --- a/arch/m68k/lib/lshrdi3.c +++ /dev/null @@ -1,61 +0,0 @@ -/* lshrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */ -/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. */ - -#include <linux/compiler.h> -#include <linux/export.h> - -#define BITS_PER_UNIT 8 - -typedef int SItype __mode(SI); -typedef unsigned int USItype __mode(SI); -typedef int DItype __mode(DI); -typedef int word_type __mode(__word__); - -struct DIstruct {SItype high, low;}; - -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; - -DItype -__lshrdi3 (DItype u, word_type b) -{ - DIunion w; - word_type bm; - DIunion uu; - - if (b == 0) - return u; - - uu.ll = u; - - bm = (sizeof (SItype) * BITS_PER_UNIT) - b; - if (bm <= 0) - { - w.s.high = 0; - w.s.low = (USItype)uu.s.high >> -bm; - } - else - { - USItype carries = (USItype)uu.s.high << bm; - w.s.high = (USItype)uu.s.high >> b; - w.s.low = ((USItype)uu.s.low >> b) | carries; - } - - return w.ll; -} -EXPORT_SYMBOL(__lshrdi3); diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c index eb7d9d86ff..5012a9b218 100644 --- a/arch/m68k/lib/muldi3.c +++ b/arch/m68k/lib/muldi3.c @@ -16,6 +16,7 @@ GNU General Public License for more details. */ #include <linux/compiler.h> #include <linux/export.h> +#include <linux/libgcc.h> #ifdef CONFIG_CPU_HAS_NO_MULDIV64 diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index a7d2802206..5c97a7058b 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -15,6 +15,8 @@ #include <asm/macints.h> #include <asm/mac_baboon.h> +#include "mac.h" + int baboon_present; static volatile struct baboon *baboon; diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 382f656c29..e324410ef2 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -50,22 +50,14 @@ #include <asm/mac_psc.h> #include <asm/config.h> +#include "mac.h" + /* Mac bootinfo struct */ struct mac_booter_data mac_bi_data; /* The phys. video addr. - might be bogus on some machines */ static unsigned long mac_orig_videoaddr; -extern int mac_hwclk(int, struct rtc_time *); -extern void iop_init(void); -extern void via_init(void); -extern void via_init_clock(void); -extern void oss_init(void); -extern void psc_init(void); -extern void baboon_init(void); - -extern void mac_mksound(unsigned int, unsigned int); - static void mac_get_model(char *str); static void mac_identify(void); static void mac_report_hardware(void); @@ -958,7 +950,7 @@ static const struct pata_platform_info mac_pata_data __initconst = { .ioport_shift = 2, }; -int __init mac_platform_init(void) +static int __init mac_platform_init(void) { phys_addr_t swim_base = 0; diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 010b3b5ae8..a92740d530 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -119,6 +119,8 @@ #include <asm/macints.h> #include <asm/mac_iop.h> +#include "mac.h" + #ifdef DEBUG #define iop_pr_debug(fmt, ...) \ printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__) diff --git a/arch/m68k/mac/mac.h b/arch/m68k/mac/mac.h new file mode 100644 index 0000000000..d3d142cea3 --- /dev/null +++ b/arch/m68k/mac/mac.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +struct rtc_time; + +/* baboon.c */ +void baboon_init(void); + +/* iop.c */ +void iop_init(void); + +/* misc.c */ +int mac_hwclk(int op, struct rtc_time *t); + +/* macboing.c */ +void mac_mksound(unsigned int freq, unsigned int length); + +/* oss.c */ +void oss_init(void); + +/* psc.c */ +void psc_init(void); + +/* via.c */ +void via_init(void); +void via_init_clock(void); diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 4de6229c7b..faea2265a5 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c @@ -16,6 +16,8 @@ #include <asm/macintosh.h> #include <asm/mac_asc.h> +#include "mac.h" + static int mac_asc_inited; /* * dumb triangular wave table @@ -23,15 +25,6 @@ static int mac_asc_inited; static __u8 mac_asc_wave_tab[ 0x800 ]; /* - * Alan's original sine table; needs interpolating to 0x800 - * (hint: interpolate or hardwire [0 -> Pi/2[, it's symmetric) - */ -static const signed char sine_data[] = { - 0, 39, 75, 103, 121, 127, 121, 103, 75, 39, - 0, -39, -75, -103, -121, -127, -121, -103, -75, -39 -}; - -/* * where the ASC hides ... */ static volatile __u8* mac_asc_regs = ( void* )0x50F14000; diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index c7cb29f0ff..4c8f8cbfa0 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -25,6 +25,8 @@ #include <asm/machdep.h> +#include "mac.h" + /* * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU * times wrap in 2040. If we need to handle later times, the read_time functions @@ -554,7 +556,7 @@ static void unmktime(time64_t time, long offset, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; - int days, rem, y, wday, yday; + int days, rem, y, wday; const unsigned short int *ip; days = div_u64_rem(time, SECS_PER_DAY, &rem); @@ -592,7 +594,6 @@ static void unmktime(time64_t time, long offset, y = yg; } *yearp = y - 1900; - yday = days; /* day in the year. Not currently used. */ ip = __mon_yday[__isleap(y)]; for (y = 11; days < (long int) ip[y]; --y) continue; diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 921e6c092f..1641607f30 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -27,6 +27,8 @@ #include <asm/mac_via.h> #include <asm/mac_oss.h> +#include "mac.h" + int oss_present; volatile struct mac_oss *oss; diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 0d0965b19c..b4183cf66e 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -26,6 +26,8 @@ #include <asm/macints.h> #include <asm/mac_psc.h> +#include "mac.h" + #define DEBUG_PSC volatile __u8 *psc; diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 3d11d6219c..01e6b0e37f 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -38,6 +38,8 @@ #include <asm/mac_psc.h> #include <asm/mac_oss.h> +#include "mac.h" + volatile __u8 *via1, *via2; int rbv_present; int via_alt_mapping; diff --git a/arch/m68k/math-emu/fp_arith.c b/arch/m68k/math-emu/fp_arith.c index f4a06492cd..799c450fe3 100644 --- a/arch/m68k/math-emu/fp_arith.c +++ b/arch/m68k/math-emu/fp_arith.c @@ -28,8 +28,7 @@ const struct fp_ext fp_Inf = /* let's start with the easy ones */ -struct fp_ext * -fp_fabs(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fabs(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fabs\n"); @@ -40,8 +39,7 @@ fp_fabs(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fneg(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fneg(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fneg\n"); @@ -57,8 +55,7 @@ fp_fneg(struct fp_ext *dest, struct fp_ext *src) /* fp_fadd: Implements the kernel of the FADD, FSADD, FDADD, FSUB, FDSUB, and FCMP instructions. */ -struct fp_ext * -fp_fadd(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fadd(struct fp_ext *dest, struct fp_ext *src) { int diff; @@ -117,8 +114,7 @@ fp_fadd(struct fp_ext *dest, struct fp_ext *src) Remember that the arguments are in assembler-syntax order! */ -struct fp_ext * -fp_fsub(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsub(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fsub "); @@ -127,8 +123,7 @@ fp_fsub(struct fp_ext *dest, struct fp_ext *src) } -struct fp_ext * -fp_fcmp(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fcmp "); @@ -137,8 +132,7 @@ fp_fcmp(struct fp_ext *dest, struct fp_ext *src) return fp_fadd(&FPDATA->temp[1], src); } -struct fp_ext * -fp_ftst(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "ftst\n"); @@ -147,8 +141,7 @@ fp_ftst(struct fp_ext *dest, struct fp_ext *src) return src; } -struct fp_ext * -fp_fmul(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src) { union fp_mant128 temp; int exp; @@ -225,8 +218,7 @@ fp_fmul(struct fp_ext *dest, struct fp_ext *src) Note that the order of the operands is counter-intuitive: instead of src / dest, the result is actually dest / src. */ -struct fp_ext * -fp_fdiv(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src) { union fp_mant128 temp; int exp; @@ -306,8 +298,7 @@ fp_fdiv(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) { int exp; @@ -363,8 +354,7 @@ fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) { int exp; unsigned long quot, rem; @@ -573,8 +563,8 @@ static void fp_roundint(struct fp_ext *dest, int mode) (which are exactly the same, except for the rounding used on the intermediate value) */ -static struct fp_ext * -modrem_kernel(struct fp_ext *dest, struct fp_ext *src, int mode) +static struct fp_ext *modrem_kernel(struct fp_ext *dest, struct fp_ext *src, + int mode) { struct fp_ext tmp; @@ -607,8 +597,7 @@ modrem_kernel(struct fp_ext *dest, struct fp_ext *src, int mode) fmod(src,dest) = (dest - (src * floor(dest / src))) */ -struct fp_ext * -fp_fmod(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fmod\n"); return modrem_kernel(dest, src, FPCR_ROUND_RZ); @@ -619,15 +608,13 @@ fp_fmod(struct fp_ext *dest, struct fp_ext *src) frem(src,dest) = (dest - (src * round(dest / src))) */ -struct fp_ext * -fp_frem(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_frem(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "frem\n"); return modrem_kernel(dest, src, FPCR_ROUND_RN); } -struct fp_ext * -fp_fint(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fint(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fint\n"); @@ -638,8 +625,7 @@ fp_fint(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fintrz(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fintrz(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fintrz\n"); @@ -650,8 +636,7 @@ fp_fintrz(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fscale(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fscale(struct fp_ext *dest, struct fp_ext *src) { int scale, oldround; diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 0fd3ed217f..3f9c58b6d5 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -12,39 +12,28 @@ */ -#ifndef FP_ARITH_H -#define FP_ARITH_H +#ifndef _FP_ARITH_H +#define _FP_ARITH_H /* easy ones */ -struct fp_ext * -fp_fabs(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fneg(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fabs(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fneg(struct fp_ext *dest, struct fp_ext *src); /* straightforward arithmetic */ -struct fp_ext * -fp_fadd(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fsub(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fcmp(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_ftst(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fmul(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fdiv(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fadd(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsub(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src); /* ones that do rounding and integer conversions */ -struct fp_ext * -fp_fmod(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_frem(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fint(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fintrz(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fscale(struct fp_ext *dest, struct fp_ext *src); - -#endif /* FP_ARITH__H */ +struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_frem(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fint(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fintrz(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fscale(struct fp_ext *dest, struct fp_ext *src); + +#endif /* _FP_ARITH_H */ diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 0663067870..71a8fc2557 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -1,6 +1,6 @@ /* - fp_trig.c: floating-point math routines for the Linux-m68k + fp_log.c: floating-point math routines for the Linux-m68k floating point emulator. Copyright (c) 1998-1999 David Huggins-Daines / Roman Zippel. @@ -15,18 +15,15 @@ */ +#include "fp_arith.h" #include "fp_emu.h" +#include "fp_log.h" -static const struct fp_ext fp_one = -{ +static const struct fp_ext fp_one = { .exp = 0x3fff, }; -extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); -extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); - -struct fp_ext * -fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) { struct fp_ext tmp, src2; int i, exp; @@ -70,7 +67,8 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) * sqrt(x) = 1 + 1/2*(x-1) * = 1/2*(1+x) */ - fp_fadd(dest, &fp_one); + /* It is safe to cast away the constness, as fp_one is normalized */ + fp_fadd(dest, (struct fp_ext *)&fp_one); dest->exp--; /* * 1/2 */ /* @@ -98,8 +96,7 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) { uprint("fetoxm1\n"); @@ -108,8 +105,7 @@ fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fetox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fetox(struct fp_ext *dest, struct fp_ext *src) { uprint("fetox\n"); @@ -118,8 +114,7 @@ fp_fetox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) { uprint("ftwotox\n"); @@ -128,8 +123,7 @@ fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftentox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftentox(struct fp_ext *dest, struct fp_ext *src) { uprint("ftentox\n"); @@ -138,8 +132,7 @@ fp_ftentox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flogn(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flogn(struct fp_ext *dest, struct fp_ext *src) { uprint("flogn\n"); @@ -148,8 +141,7 @@ fp_flogn(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flognp1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flognp1(struct fp_ext *dest, struct fp_ext *src) { uprint("flognp1\n"); @@ -158,8 +150,7 @@ fp_flognp1(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flog10(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flog10(struct fp_ext *dest, struct fp_ext *src) { uprint("flog10\n"); @@ -168,8 +159,7 @@ fp_flog10(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flog2(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flog2(struct fp_ext *dest, struct fp_ext *src) { uprint("flog2\n"); @@ -178,8 +168,7 @@ fp_flog2(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fgetexp\n"); @@ -199,8 +188,7 @@ fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fgetman(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fgetman(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fgetman\n"); diff --git a/arch/m68k/math-emu/fp_log.h b/arch/m68k/math-emu/fp_log.h new file mode 100644 index 0000000000..c2bcfff119 --- /dev/null +++ b/arch/m68k/math-emu/fp_log.h @@ -0,0 +1,44 @@ +/* + + fp_log.h: floating-point math routines for the Linux-m68k + floating point emulator. + + Copyright (c) 1998-1999 David Huggins-Daines / Roman Zippel. + + I hereby give permission, free of charge, to copy, modify, and + redistribute this software, in source or binary form, provided that + the above copyright notice and the following disclaimer are included + in all such copies. + + THIS SOFTWARE IS PROVIDED "AS IS", WITH ABSOLUTELY NO WARRANTY, REAL + OR IMPLIED. + +*/ + +#ifndef _FP_LOG_H +#define _FP_LOG_H + +#include "fp_emu.h" + +/* floating point logarithmic instructions: + + the arguments to these are in the "internal" extended format, that + is, an "exploded" version of the 96-bit extended fp format used by + the 68881. + + they return a status code, which should end up in %d0, if all goes + well. */ + +struct fp_ext *fp_fsqrt(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fetox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftwotox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftentox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flogn(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flognp1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flog10(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flog2(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fgetexp(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fgetman(struct fp_ext *dest, struct fp_ext *src); + +#endif /* _FP_LOG_H */ diff --git a/arch/m68k/math-emu/fp_trig.c b/arch/m68k/math-emu/fp_trig.c index 6361d0784d..5f49de3737 100644 --- a/arch/m68k/math-emu/fp_trig.c +++ b/arch/m68k/math-emu/fp_trig.c @@ -18,8 +18,7 @@ #include "fp_emu.h" #include "fp_trig.h" -struct fp_ext * -fp_fsin(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsin(struct fp_ext *dest, struct fp_ext *src) { uprint("fsin\n"); @@ -28,8 +27,7 @@ fp_fsin(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fcos(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcos(struct fp_ext *dest, struct fp_ext *src) { uprint("fcos\n"); @@ -38,8 +36,7 @@ fp_fcos(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftan(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftan(struct fp_ext *dest, struct fp_ext *src) { uprint("ftan\n"); @@ -48,8 +45,7 @@ fp_ftan(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fasin(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fasin(struct fp_ext *dest, struct fp_ext *src) { uprint("fasin\n"); @@ -58,8 +54,7 @@ fp_fasin(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_facos(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_facos(struct fp_ext *dest, struct fp_ext *src) { uprint("facos\n"); @@ -68,8 +63,7 @@ fp_facos(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fatan(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fatan(struct fp_ext *dest, struct fp_ext *src) { uprint("fatan\n"); @@ -78,8 +72,7 @@ fp_fatan(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsinh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsinh(struct fp_ext *dest, struct fp_ext *src) { uprint("fsinh\n"); @@ -88,8 +81,7 @@ fp_fsinh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fcosh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcosh(struct fp_ext *dest, struct fp_ext *src) { uprint("fcosh\n"); @@ -98,8 +90,7 @@ fp_fcosh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftanh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftanh(struct fp_ext *dest, struct fp_ext *src) { uprint("ftanh\n"); @@ -108,8 +99,7 @@ fp_ftanh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fatanh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fatanh(struct fp_ext *dest, struct fp_ext *src) { uprint("fatanh\n"); @@ -118,64 +108,56 @@ fp_fatanh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsincos0(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos0(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos0\n"); return dest; } -struct fp_ext * -fp_fsincos1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos1(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos1\n"); return dest; } -struct fp_ext * -fp_fsincos2(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos2(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos2\n"); return dest; } -struct fp_ext * -fp_fsincos3(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos3(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos3\n"); return dest; } -struct fp_ext * -fp_fsincos4(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos4(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos4\n"); return dest; } -struct fp_ext * -fp_fsincos5(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos5(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos5\n"); return dest; } -struct fp_ext * -fp_fsincos6(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos6(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos6\n"); return dest; } -struct fp_ext * -fp_fsincos7(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos7(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos7\n"); diff --git a/arch/m68k/math-emu/fp_trig.h b/arch/m68k/math-emu/fp_trig.h index af8b247e9c..1aae8ab1d4 100644 --- a/arch/m68k/math-emu/fp_trig.h +++ b/arch/m68k/math-emu/fp_trig.h @@ -15,8 +15,8 @@ */ -#ifndef FP_TRIG_H -#define FP_TRIG_H +#ifndef _FP_TRIG_H +#define _FP_TRIG_H #include "fp_emu.h" @@ -29,4 +29,23 @@ they return a status code, which should end up in %d0, if all goes well. */ -#endif /* FP_TRIG__H */ +struct fp_ext *fp_fsin(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcos(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftan(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fasin(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_facos(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fatan(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsinh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcosh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftanh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fatanh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos0(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos2(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos3(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos4(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos5(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos6(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos7(struct fp_ext *dest, struct fp_ext *src); + +#endif /* _FP_TRIG_H */ diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index 232f58fe34..f7d9e49fe2 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -15,8 +15,10 @@ implement the subset of integer arithmetic that we need in order to multiply, divide, and normalize 128-bit unsigned mantissae. */ -#ifndef MULTI_ARITH_H -#define MULTI_ARITH_H +#ifndef _MULTI_ARITH_H +#define _MULTI_ARITH_H + +#include "fp_emu.h" static inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt) { @@ -285,4 +287,4 @@ static inline void fp_putmant128(struct fp_ext *dest, union fp_mant128 *src, } } -#endif /* MULTI_ARITH_H */ +#endif /* _MULTI_ARITH_H */ diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index c290c5c0cf..fa3c5f38d9 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c @@ -17,6 +17,8 @@ #include <asm/setup.h> #include <asm/traps.h> +#include "fault.h" + extern void die_if_kernel(char *, struct pt_regs *, long); int send_fault_sig(struct pt_regs *regs) diff --git a/arch/m68k/mm/fault.h b/arch/m68k/mm/fault.h new file mode 100644 index 0000000000..dab14ef7d4 --- /dev/null +++ b/arch/m68k/mm/fault.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +struct pt_regs; + +int do_page_fault(struct pt_regs *regs, unsigned long address, + unsigned long error_code); +int send_fault_sig(struct pt_regs *regs); diff --git a/arch/m68k/mm/hwtest.c b/arch/m68k/mm/hwtest.c index fe99aa9998..8ee7a33686 100644 --- a/arch/m68k/mm/hwtest.c +++ b/arch/m68k/mm/hwtest.c @@ -26,6 +26,8 @@ #include <linux/module.h> +#include <asm/hwtest.h> + int hwreg_present(volatile void *regp) { int ret = 0; diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c index a6efaa7cac..9a6fa342e8 100644 --- a/arch/m68k/mm/mcfmmu.c +++ b/arch/m68k/mm/mcfmmu.c @@ -38,7 +38,7 @@ void __init paging_init(void) pgd_t *pg_dir; pte_t *pg_table; unsigned long address, size; - unsigned long next_pgtable, bootmem_end; + unsigned long next_pgtable; unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 }; int i; @@ -57,7 +57,6 @@ void __init paging_init(void) panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, PAGE_SIZE); - bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK; pg_dir += PAGE_OFFSET >> PGDIR_SHIFT; address = PAGE_OFFSET; diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c index 4f2a7ef834..ac091892d8 100644 --- a/arch/m68k/mm/sun3kmap.c +++ b/arch/m68k/mm/sun3kmap.c @@ -18,11 +18,9 @@ #include <asm/io.h> #include <asm/sun3mmu.h> -#undef SUN3_KMAP_DEBUG +#include "../sun3/sun3.h" -#ifdef SUN3_KMAP_DEBUG -extern void print_pte_vaddr(unsigned long vaddr); -#endif +#undef SUN3_KMAP_DEBUG extern void mmu_emu_map_pmeg (int context, int vaddr); diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c index c5e6a23e02..494739c178 100644 --- a/arch/m68k/mm/sun3mmu.c +++ b/arch/m68k/mm/sun3mmu.c @@ -24,7 +24,7 @@ #include <asm/machdep.h> #include <asm/io.h> -extern void mmu_emu_init (unsigned long bootmem_end); +#include "../sun3/sun3.h" const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n"; diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 4e6218115f..8b5dc07f08 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/mvme147/config.c * @@ -7,10 +8,6 @@ * Based on: * * Copyright (C) 1993 Hamish Macdonald - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include <linux/types.h> @@ -73,7 +70,7 @@ static void mvme147_get_model(char *model) * the mvme147 IRQ handling routines. */ -void __init mvme147_init_IRQ(void) +static void __init mvme147_init_IRQ(void) { m68k_setup_user_interrupt(VEC_USER, 192); } diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index f00c7aa058..d1fbd1704d 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/mvme16x/config.c * @@ -8,10 +9,6 @@ * linux/amiga/config.c * * Copyright (C) 1993 Hamish Macdonald - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include <linux/types.h> @@ -38,6 +35,8 @@ #include <asm/mvme16xhw.h> #include <asm/config.h> +#include "mvme16x.h" + extern t_bdid mvme_bdid; static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; @@ -208,7 +207,6 @@ static void __init mvme16x_init_IRQ (void) void mvme16x_cons_write(struct console *co, const char *str, unsigned count) { volatile unsigned char *base_addr = (u_char *)CD2401_ADDR; - volatile u_char sink; u_char ier; int port; u_char do_lf = 0; @@ -229,7 +227,7 @@ void mvme16x_cons_write(struct console *co, const char *str, unsigned count) if (in_8(PCCSCCTICR) & 0x20) { /* We have a Tx int. Acknowledge it */ - sink = in_8(PCCTPIACKR); + in_8(PCCTPIACKR); if ((base_addr[CyLICR] >> 2) == port) { if (i == count) { /* Last char of string is now output */ diff --git a/arch/m68k/mvme16x/mvme16x.h b/arch/m68k/mvme16x/mvme16x.h new file mode 100644 index 0000000000..159c34b700 --- /dev/null +++ b/arch/m68k/mvme16x/mvme16x.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct console; + +/* config.c */ +void mvme16x_cons_write(struct console *co, const char *str, unsigned count); diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index c78ee709b4..de7870ad2a 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/q40/config.c * @@ -6,10 +7,6 @@ * originally based on: * * linux/bvme/config.c - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include <linux/errno.h> @@ -36,16 +33,14 @@ #include <asm/q40_master.h> #include <asm/config.h> -extern void q40_init_IRQ(void); +#include "q40.h" + static void q40_get_model(char *model); -extern void q40_sched_init(void); static int q40_hwclk(int, struct rtc_time *); static int q40_get_rtc_pll(struct rtc_pll_info *pll); static int q40_set_rtc_pll(struct rtc_pll_info *pll); -extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); - static void q40_mem_console_write(struct console *co, const char *b, unsigned int count); diff --git a/arch/m68k/q40/q40.h b/arch/m68k/q40/q40.h new file mode 100644 index 0000000000..3146679bde --- /dev/null +++ b/arch/m68k/q40/q40.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* q40ints.c */ +void q40_init_IRQ(void); +void q40_mksound(unsigned int hz, unsigned int ticks); +void q40_sched_init(void); diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 127d7ecdbd..10f1f294e9 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c @@ -24,6 +24,8 @@ #include <asm/q40_master.h> #include <asm/q40ints.h> +#include "q40.h" + /* * Q40 IRQs are defined as follows: * 3,4,5,6,7,10,11,14,15 : ISA dev IRQs diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 203f428a03..cd8af809e0 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/memblock.h> #include <linux/platform_device.h> +#include <linux/linkage.h> #include <asm/oplib.h> #include <asm/setup.h> @@ -32,12 +33,13 @@ #include <asm/irq.h> #include <asm/sections.h> #include <asm/sun3ints.h> +#include <asm/config.h> + +#include "sun3.h" char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; static void sun3_sched_init(void); -extern void sun3_get_model (char* model); -extern int sun3_hwclk(int set, struct rtc_time *t); volatile char* clock_va; extern unsigned long availmem; @@ -48,7 +50,7 @@ static void sun3_get_hardware_list(struct seq_file *m) seq_printf(m, "PROM Revision:\t%s\n", romvec->pv_monid); } -void __init sun3_init(void) +asmlinkage void __init sun3_init(void) { unsigned char enable_register; int i; @@ -107,13 +109,10 @@ static void sun3_halt (void) static void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_end) { - unsigned long start_page; - /* align start/end to page boundaries */ memory_start = ((memory_start + (PAGE_SIZE-1)) & PAGE_MASK); memory_end = memory_end & PAGE_MASK; - start_page = __pa(memory_start) >> PAGE_SHIFT; max_pfn = num_pages = __pa(memory_end) >> PAGE_SHIFT; high_memory = (void *)memory_end; @@ -200,7 +199,7 @@ static const struct resource sun3_scsi_rsrc[] __initconst = { }, }; -int __init sun3_platform_init(void) +static int __init sun3_platform_init(void) { switch (idprom->id_machtype) { case SM_SUN3 | SM_3_160: diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c index 1ace5353d7..ca633a5f5e 100644 --- a/arch/m68k/sun3/idprom.c +++ b/arch/m68k/sun3/idprom.c @@ -17,6 +17,8 @@ #include <asm/idprom.h> #include <asm/machines.h> /* Fun with Sun released architectures. */ +#include "sun3.h" + struct idprom *idprom; EXPORT_SYMBOL(idprom); @@ -83,7 +85,7 @@ static void __init display_system_type(unsigned char machtype) prom_halt(); } -void sun3_get_model(unsigned char* model) +void sun3_get_model(char *model) { register int i; diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c index 8fc74864de..29674cfa9b 100644 --- a/arch/m68k/sun3/intersil.c +++ b/arch/m68k/sun3/intersil.c @@ -17,6 +17,7 @@ #include <asm/intersil.h> #include <asm/machdep.h> +#include "sun3.h" /* bits to set for start/run of the intersil */ #define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) diff --git a/arch/m68k/sun3/leds.c b/arch/m68k/sun3/leds.c index 7c67b58ebf..4bb95318fd 100644 --- a/arch/m68k/sun3/leds.c +++ b/arch/m68k/sun3/leds.c @@ -3,6 +3,8 @@ #include <asm/sun3mmu.h> #include <asm/io.h> +#include "sun3.h" + void sun3_leds(unsigned char byte) { unsigned char dfc; diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index 7321b3b762..119bd32efc 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c @@ -27,6 +27,7 @@ #include <asm/mmu_context.h> #include <asm/dvma.h> +#include "sun3.h" #undef DEBUG_MMU_EMU #define DEBUG_PROM_MAPS @@ -67,7 +68,7 @@ static unsigned char ctx_avail = CONTEXTS_NUM-1; unsigned long rom_pages[256]; /* Print a PTE value in symbolic form. For debugging. */ -void print_pte (pte_t pte) +static void print_pte(pte_t pte) { #if 0 /* Verbose version. */ @@ -206,32 +207,32 @@ void __init mmu_emu_init(unsigned long bootmem_end) context for when they're cleared */ void clear_context(unsigned long context) { - unsigned char oldctx; - unsigned long i; + unsigned char oldctx; + unsigned long i; - if(context) { - if(!ctx_alloc[context]) - panic("%s: context not allocated\n", __func__); + if (context) { + if (!ctx_alloc[context]) + panic("%s: context not allocated\n", __func__); - ctx_alloc[context]->context = SUN3_INVALID_CONTEXT; - ctx_alloc[context] = (struct mm_struct *)0; - ctx_avail++; - } + ctx_alloc[context]->context = SUN3_INVALID_CONTEXT; + ctx_alloc[context] = (struct mm_struct *)0; + ctx_avail++; + } - oldctx = sun3_get_context(); + oldctx = sun3_get_context(); - sun3_put_context(context); + sun3_put_context(context); - for(i = 0; i < SUN3_INVALID_PMEG; i++) { - if((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) { - sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG); - pmeg_ctx[i] = 0; - pmeg_alloc[i] = 0; - pmeg_vaddr[i] = 0; - } - } + for (i = 0; i < SUN3_INVALID_PMEG; i++) { + if ((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) { + sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG); + pmeg_ctx[i] = 0; + pmeg_alloc[i] = 0; + pmeg_vaddr[i] = 0; + } + } - sun3_put_context(oldctx); + sun3_put_context(oldctx); } /* gets an empty context. if full, kills the next context listed to diff --git a/arch/m68k/sun3/prom/printf.c b/arch/m68k/sun3/prom/printf.c index b6724cc667..db5537ef12 100644 --- a/arch/m68k/sun3/prom/printf.c +++ b/arch/m68k/sun3/prom/printf.c @@ -25,15 +25,14 @@ prom_printf(char *fmt, ...) { va_list args; char ch, *bptr; - int i; va_start(args, fmt); #ifdef CONFIG_KGDB ppbuf[0] = 'O'; - i = vsprintf(ppbuf + 1, fmt, args) + 1; + vsprintf(ppbuf + 1, fmt, args) + 1; #else - i = vsprintf(ppbuf, fmt, args); + vsprintf(ppbuf, fmt, args); #endif bptr = ppbuf; diff --git a/arch/m68k/sun3/sun3.h b/arch/m68k/sun3/sun3.h new file mode 100644 index 0000000000..8d98c0aaed --- /dev/null +++ b/arch/m68k/sun3/sun3.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <linux/linkage.h> + +struct rtc_time; + +/* config.c */ +asmlinkage void sun3_init(void); + +/* idprom.c */ +void sun3_get_model(char *model); + +/* intersil.c */ +int sun3_hwclk(int set, struct rtc_time *t); + +/* leds.c */ +void sun3_leds(unsigned char byte); + +/* mmu_emu.c */ +void mmu_emu_init(unsigned long bootmem_end); +int mmu_emu_handle_fault(unsigned long vaddr, int read_flag, int kernel_fault); +void print_pte_vaddr(unsigned long vaddr); diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c index 4b560f4d39..6ebf52740a 100644 --- a/arch/m68k/sun3/sun3dvma.c +++ b/arch/m68k/sun3/sun3dvma.c @@ -20,18 +20,6 @@ #undef DVMA_DEBUG -#ifdef CONFIG_SUN3X -extern void dvma_unmap_iommu(unsigned long baddr, int len); -#else -static inline void dvma_unmap_iommu(unsigned long a, int b) -{ -} -#endif - -#ifdef CONFIG_SUN3 -extern void sun3_dvma_init(void); -#endif - static unsigned long *iommu_use; #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) @@ -205,9 +193,7 @@ static inline int free_baddr(unsigned long baddr) unsigned long len; struct hole *hole; struct list_head *cur; - unsigned long orig_baddr; - orig_baddr = baddr; len = dvma_entry_use(baddr); dvma_entry_use(baddr) = 0; baddr &= DVMA_PAGE_MASK; @@ -274,10 +260,7 @@ void __init dvma_init(void) dvma_unmap_iommu(DVMA_START, DVMA_SIZE); -#ifdef CONFIG_SUN3 sun3_dvma_init(); -#endif - } unsigned long dvma_map_align(unsigned long kaddr, int len, int align) diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 36cc280a45..32eaf55f87 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -17,7 +17,7 @@ #include <asm/irq_regs.h> #include <linux/seq_file.h> -extern void sun3_leds (unsigned char); +#include "sun3.h" void sun3_disable_interrupts(void) { @@ -29,11 +29,11 @@ void sun3_enable_interrupts(void) sun3_enable_irq(0); } -static int led_pattern[8] = { - ~(0x80), ~(0x01), - ~(0x40), ~(0x02), - ~(0x20), ~(0x04), - ~(0x10), ~(0x08) +static unsigned char led_pattern[8] = { + (u8)~(0x80), (u8)~(0x01), + (u8)~(0x40), (u8)~(0x02), + (u8)~(0x20), (u8)~(0x04), + (u8)~(0x10), (u8)~(0x08) }; volatile unsigned char* sun3_intreg; diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 37121a0f12..798ea72a0e 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -19,14 +19,14 @@ #include <asm/sun3ints.h> #include <asm/setup.h> #include <asm/oplib.h> +#include <asm/config.h> #include "time.h" +#include "../sun3/sun3.h" volatile char *clock_va; -extern void sun3_get_model(char *model); - -void sun3_leds(unsigned int i) +void sun3_leds(unsigned char byte) { } diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index a6034ba058..5185b4818d 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c @@ -60,7 +60,7 @@ static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU; #ifdef DEBUG /* code to print out a dvma mapping for debugging purposes */ -void dvma_print (unsigned long dvma_addr) +static void dvma_print (unsigned long dvma_addr) { unsigned long index; @@ -143,8 +143,7 @@ inline int dvma_map_cpu(unsigned long kaddr, } -inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, - int len) +int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, int len) { unsigned long end, index; diff --git a/arch/m68k/sun3x/prom.c b/arch/m68k/sun3x/prom.c index 64c23bfaa9..8ac87d3dc6 100644 --- a/arch/m68k/sun3x/prom.c +++ b/arch/m68k/sun3x/prom.c @@ -30,7 +30,7 @@ struct linux_romvec *romvec; e_vector *sun3x_prom_vbr; /* Handle returning to the prom */ -void sun3x_halt(void) +static void sun3x_halt(void) { unsigned long flags; |