m68k updates for v6.7

- Miscellaneous esthetical improvements for the floating point
     emulator,
   - Remove the last user of strlcpy(),
   - Use kernel's generic libgcc functions,
   - Miscellaneous fixes for W=1 builds,
   - Miscellaneous indentation fixes,
   - Miscellaneous fixes and improvements,
   - Defconfig updates.
 -----BEGIN PGP SIGNATURE-----
 
 iIsEABYIADMWIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZT+BKBUcZ2VlcnRAbGlu
 dXgtbTY4ay5vcmcACgkQisJQ/WRJ8XAeSQD/XxThBNV/Q+qUHoB0Zq2vmuhNVEQ0
 iEbwS1fIg8JCknEA/RUOyeDhXPbQYfd9uAyPyYMQ2dFHNdKq4zYY+AKYWwIG
 =/G+X
 -----END PGP SIGNATURE-----

Merge tag 'm68k-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k

Pull m68k updates from Geert Uytterhoeven:

 - misc aesthetical improvements for the floating point emulator

 - remove the last user of strlcpy()

 - use kernel's generic libgcc functions

 - misc fixes for W=1 builds

 - misc indentation fixes

 - misc fixes and improvements

 - defconfig updates

* tag 'm68k-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (72 commits)
  m68k: lib: Include <linux/libgcc.h> for __muldi3()
  m68k: fpsp040: Fix indentation by 5 spaces
  m68k: Fix indentation by 2 or 5 spaces in <asm/page_mm.h>
  m68k: kernel: Fix indentation by 7 spaces in traps.c
  m68k: sun3: Fix indentation by 5 or 7 spaces
  m68k: Fix indentation by 7 spaces in <asm/io_mm.h>
  m68k: defconfig: Update virt_defconfig for v6.6-rc3
  m68k: defconfig: Update defconfigs for v6.6-rc1
  m68k: io: Mark mmio read addresses as const
  m68k: Replace GPL 2.0+ README.legal boilerplate with SPDX
  m68k: sun3: Change led_pattern[] to unsigned char
  m68k: Add missing types to asm/irq.h
  m68k: sun3/3x: Add and use "sun3.h"
  m68k: sun3x: Make dvma_print() static
  m68k: sun3x: Make sun3x_halt() static
  m68k: sun3x: Do not mark dvma_map_iommu() inline
  m68k: sun3x: Fix signature of sun3_leds()
  m68k: sun3: Make sun3_platform_init() static
  m68k: sun3: Make print_pte() static
  m68k: sun3: Annotate prom_printf() with __printf()
  ...
This commit is contained in:
Linus Torvalds 2023-11-01 10:13:07 -10:00
commit 979ff1e5af
109 changed files with 629 additions and 672 deletions

View File

@ -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
*/

View File

@ -19,6 +19,9 @@ config M68K
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

5
arch/m68k/amiga/amiga.h Normal file
View File

@ -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);

View File

@ -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,

View File

@ -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

View File

@ -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);

View File

@ -0,0 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* dn_ints.c */
void dn_init_IRQ(void);

View File

@ -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 ");

View File

@ -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;

View File

@ -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;

View File

@ -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 };

15
arch/m68k/atari/atari.h Normal file
View File

@ -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);

View File

@ -28,6 +28,7 @@
#include <asm/irq.h>
#include <asm/atariints.h>
#include "atari.h"
/*
* stuff from the old atasound.c

View File

@ -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;

View File

@ -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.
*/

View File

@ -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) {
/*

View File

@ -23,6 +23,8 @@
#include <asm/atariints.h>
#include <asm/machdep.h>
#include "atari.h"
DEFINE_SPINLOCK(rtc_lock);
EXPORT_SYMBOL_GPL(rtc_lock);

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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";

View File

@ -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 %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 %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
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)
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

View File

@ -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 = {

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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);

View File

@ -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 */

View File

@ -13,17 +13,16 @@
#ifdef CPU_M68040_OR_M68060_ONLY
static inline void copy_page(void *to, void *from)
{
unsigned long tmp;
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)
);
__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 */

View File

@ -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 */

View File

@ -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)
/*

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

View File

@ -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;
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;
}
}
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;
unsigned char oldctx;
unsigned char seg;
unsigned long i;
oldctx = sun3_get_context();
sun3_put_context(mm->context);
oldctx = sun3_get_context();
sun3_put_context(mm->context);
for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) {
seg = sun3_get_segmap(i);
if(seg == SUN3_INVALID_PMEG)
continue;
for (i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) {
seg = sun3_get_segmap(i);
if (seg == SUN3_INVALID_PMEG)
continue;
sun3_put_segmap(i, SUN3_INVALID_PMEG);
pmeg_alloc[seg] = 0;
pmeg_ctx[seg] = 0;
pmeg_vaddr[seg] = 0;
}
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)

View File

@ -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);

View File

@ -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

View File

@ -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.
**
*/
/*

View File

@ -26,6 +26,8 @@
#include <asm/q40ints.h>
#endif
#include "ints.h"
extern u32 auto_irqhandler_fixup[];
extern u16 user_irqvec_fixup[];

7
arch/m68k/kernel/ints.h Normal file
View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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;

View File

@ -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))

View File

@ -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);

View File

@ -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,

View File

@ -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;

10
arch/m68k/kernel/traps.h Normal file
View File

@ -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);

View File

@ -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);

View File

@ -0,0 +1,3 @@
/* SPDX-License-Identifier: GPL-2.0-only */
void base_trap_init(void);

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -15,6 +15,8 @@
#include <asm/macints.h>
#include <asm/mac_baboon.h>
#include "mac.h"
int baboon_present;
static volatile struct baboon *baboon;

View File

@ -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;

View File

@ -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__)

25
arch/m68k/mac/mac.h Normal file
View File

@ -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);

View File

@ -16,21 +16,14 @@
#include <asm/macintosh.h>
#include <asm/mac_asc.h>
#include "mac.h"
static int mac_asc_inited;
/*
* dumb triangular wave table
*/
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 ...
*/

View File

@ -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;

View File

@ -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;

View File

@ -26,6 +26,8 @@
#include <asm/macints.h>
#include <asm/mac_psc.h>
#include "mac.h"
#define DEBUG_PSC
volatile __u8 *psc;

View File

@ -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;

View File

@ -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;

View File

@ -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);
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 */
#endif /* _FP_ARITH_H */

View File

@ -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");

View File

@ -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 */

View File

@ -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");

View File

@ -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 */

View File

@ -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 */

View File

@ -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)

7
arch/m68k/mm/fault.h Normal file
View File

@ -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);

View File

@ -26,6 +26,8 @@
#include <linux/module.h>
#include <asm/hwtest.h>
int hwreg_present(volatile void *regp)
{
int ret = 0;

View File

@ -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);

View File

@ -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";

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);

View File

@ -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);

6
arch/m68k/q40/q40.h Normal file
View File

@ -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);

View File

@ -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

View File

@ -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:

View File

@ -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;

View File

@ -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)

Some files were not shown because too many files have changed in this diff Show More