Skip to content

Commit e7244cc

Browse files
committed
Merge tag 'm68k-for-v6.14-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k updates from Geert Uytterhoeven: - Use the generic muldi3 libgcc function - Miscellaneous fixes and improvements * tag 'm68k-for-v6.14-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: libgcc: Fix lvalue abuse in umul_ppmm() m68k: vga: Fix I/O defines zorro: Constify 'struct bin_attribute' m68k: atari: Use str_on_off() helper in atari_nvram_proc_read() m68k: Use kernel's generic muldi3 libgcc function
2 parents 4f42d0b + bb2e0fb commit e7244cc

File tree

9 files changed

+55
-109
lines changed

9 files changed

+55
-109
lines changed

arch/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,14 @@ config HAVE_ARCH_COMPILER_H
15261526
linux/compiler-*.h in order to override macro definitions that those
15271527
headers generally provide.
15281528

1529+
config HAVE_ARCH_LIBGCC_H
1530+
bool
1531+
help
1532+
An architecture can select this if it provides an
1533+
asm/libgcc.h header that should be included after
1534+
linux/libgcc.h in order to override macro definitions that
1535+
header generally provides.
1536+
15291537
config HAVE_ARCH_PREL32_RELOCATIONS
15301538
bool
15311539
help

arch/m68k/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ config M68K
2323
select GENERIC_LIB_ASHLDI3
2424
select GENERIC_LIB_ASHRDI3
2525
select GENERIC_LIB_LSHRDI3
26+
select GENERIC_LIB_MULDI3
2627
select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA
28+
select HAVE_ARCH_LIBGCC_H
2729
select HAVE_ARCH_SECCOMP
2830
select HAVE_ARCH_SECCOMP_FILTER
2931
select HAVE_ASM_MODVERSIONS

arch/m68k/atari/nvram.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
#include <linux/proc_fs.h>
1717
#include <linux/seq_file.h>
1818
#include <linux/spinlock.h>
19+
#include <linux/string_choices.h>
1920
#include <linux/types.h>
21+
2022
#include <asm/atarihw.h>
2123
#include <asm/atariints.h>
2224

@@ -198,7 +200,7 @@ static void atari_nvram_proc_read(unsigned char *nvram, struct seq_file *seq,
198200
seq_printf(seq, "0x%02x (undefined)\n", nvram[1]);
199201

200202
seq_printf(seq, "SCSI arbitration : %s\n",
201-
(nvram[16] & 0x80) ? "on" : "off");
203+
str_on_off(nvram[16] & 0x80));
202204
seq_puts(seq, "SCSI host ID : ");
203205
if (nvram[16] & 0x80)
204206
seq_printf(seq, "%d\n", nvram[16] & 7);
@@ -236,7 +238,7 @@ static void atari_nvram_proc_read(unsigned char *nvram, struct seq_file *seq,
236238
vmode & 16 ? "VGA" : "TV", vmode & 32 ? "PAL" : "NTSC");
237239
seq_printf(seq,
238240
" %soverscan, compat. mode %s%s\n",
239-
vmode & 64 ? "" : "no ", vmode & 128 ? "on" : "off",
241+
vmode & 64 ? "" : "no ", str_on_off(vmode & 128),
240242
vmode & 256 ?
241243
(vmode & 16 ? ", line doubling" : ", half screen") : "");
242244
}

arch/m68k/include/asm/libgcc.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __ASM_M68K_LIBGCC_H
3+
#define __ASM_M68K_LIBGCC_H
4+
5+
#ifndef CONFIG_CPU_HAS_NO_MULDIV64
6+
/*
7+
* For those 68K CPUs that support 64bit multiply define umul_ppm()
8+
* for the common muldi3 libgcc helper function (in lib/muldi3.c).
9+
* CPUs that don't have it (like the original 68000 and ColdFire)
10+
* will fallback to using the C-coded version of umul_ppmm().
11+
*/
12+
#define umul_ppmm(w1, w0, u, v) \
13+
do { \
14+
unsigned long __u = (u), __v = (v); \
15+
unsigned long __w0, __w1; \
16+
\
17+
__asm__ ("mulu%.l %3,%1:%0" \
18+
: "=d" (__w0), \
19+
"=d" (__w1) \
20+
: "%0" (__u), \
21+
"dmi" (__v)); \
22+
\
23+
(w0) = __w0; (w1) = __w1; \
24+
} while (0)
25+
#endif /* !CONFIG_CPU_HAS_NO_MULDIV64 */
26+
27+
#endif /* __ASM_M68K_LIBGCC_H */

arch/m68k/include/asm/vga.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
#ifndef CONFIG_PCI
1111

12-
#include <asm/raw_io.h>
12+
#include <asm/io.h>
1313
#include <asm/kmap.h>
1414

1515
/*
@@ -29,9 +29,9 @@
2929
#define inw_p(port) 0
3030
#define outb_p(port, val) do { } while (0)
3131
#define outw(port, val) do { } while (0)
32-
#define readb raw_inb
33-
#define writeb raw_outb
34-
#define writew raw_outw
32+
#define readb __raw_readb
33+
#define writeb __raw_writeb
34+
#define writew __raw_writew
3535

3636
#endif /* CONFIG_PCI */
3737
#endif /* _ASM_M68K_VGA_H */

arch/m68k/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for m68k-specific library files..
55
#
66

7-
lib-y := muldi3.o memcpy.o memset.o memmove.o
7+
lib-y := memcpy.o memset.o memmove.o
88

99
lib-$(CONFIG_MMU) += uaccess.o
1010
lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += mulsi3.o divsi3.o udivsi3.o

arch/m68k/lib/muldi3.c

Lines changed: 0 additions & 97 deletions
This file was deleted.

drivers/zorro/zorro-sysfs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static struct attribute *zorro_device_attrs[] = {
8181
};
8282

8383
static ssize_t zorro_read_config(struct file *filp, struct kobject *kobj,
84-
struct bin_attribute *bin_attr,
84+
const struct bin_attribute *bin_attr,
8585
char *buf, loff_t off, size_t count)
8686
{
8787
struct zorro_dev *z = to_zorro_dev(kobj_to_dev(kobj));
@@ -98,23 +98,23 @@ static ssize_t zorro_read_config(struct file *filp, struct kobject *kobj,
9898
return memory_read_from_buffer(buf, count, &off, &cd, sizeof(cd));
9999
}
100100

101-
static struct bin_attribute zorro_config_attr = {
101+
static const struct bin_attribute zorro_config_attr = {
102102
.attr = {
103103
.name = "config",
104104
.mode = S_IRUGO,
105105
},
106106
.size = sizeof(struct ConfigDev),
107-
.read = zorro_read_config,
107+
.read_new = zorro_read_config,
108108
};
109109

110-
static struct bin_attribute *zorro_device_bin_attrs[] = {
110+
static const struct bin_attribute *const zorro_device_bin_attrs[] = {
111111
&zorro_config_attr,
112112
NULL
113113
};
114114

115115
static const struct attribute_group zorro_device_attr_group = {
116116
.attrs = zorro_device_attrs,
117-
.bin_attrs = zorro_device_bin_attrs,
117+
.bin_attrs_new = zorro_device_bin_attrs,
118118
};
119119

120120
const struct attribute_group *zorro_device_attribute_groups[] = {

include/linux/libgcc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ long long notrace __lshrdi3(long long u, word_type b);
3434
long long notrace __muldi3(long long u, long long v);
3535
word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b);
3636

37+
#ifdef CONFIG_HAVE_ARCH_LIBGCC_H
38+
#include <asm/libgcc.h>
39+
#endif
40+
3741
#endif /* __ASM_LIBGCC_H */

0 commit comments

Comments
 (0)