Skip to content

Commit fa4fe8c

Browse files
committed
Merge tag 'uml-for-linus-6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull UML fix from Richard Weinberger: - Fix modular build for UML watchdog * tag 'uml-for-linus-6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: um: harddog: fix modular build
2 parents a35747c + 73a23d7 commit fa4fe8c

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

arch/um/drivers/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ mconsole-objs := mconsole_kern.o mconsole_user.o
1616
hostaudio-objs := hostaudio_kern.o
1717
ubd-objs := ubd_kern.o ubd_user.o
1818
port-objs := port_kern.o port_user.o
19-
harddog-objs := harddog_kern.o harddog_user.o
19+
harddog-objs := harddog_kern.o
20+
harddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o
2021
rtc-objs := rtc_kern.o rtc_user.o
2122

2223
LDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a)
@@ -60,6 +61,7 @@ obj-$(CONFIG_PTY_CHAN) += pty.o
6061
obj-$(CONFIG_TTY_CHAN) += tty.o
6162
obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o
6263
obj-$(CONFIG_UML_WATCHDOG) += harddog.o
64+
obj-y += $(harddog-builtin-y) $(harddog-builtin-m)
6365
obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
6466
obj-$(CONFIG_UML_RANDOM) += random.o
6567
obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o

arch/um/drivers/harddog.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef UM_WATCHDOG_H
3+
#define UM_WATCHDOG_H
4+
5+
int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock);
6+
void stop_watchdog(int in_fd, int out_fd);
7+
int ping_watchdog(int fd);
8+
9+
#endif /* UM_WATCHDOG_H */

arch/um/drivers/harddog_kern.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <linux/spinlock.h>
4848
#include <linux/uaccess.h>
4949
#include "mconsole.h"
50+
#include "harddog.h"
5051

5152
MODULE_LICENSE("GPL");
5253

@@ -60,8 +61,6 @@ static int harddog_out_fd = -1;
6061
* Allow only one person to hold it open
6162
*/
6263

63-
extern int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock);
64-
6564
static int harddog_open(struct inode *inode, struct file *file)
6665
{
6766
int err = -EBUSY;
@@ -92,8 +91,6 @@ static int harddog_open(struct inode *inode, struct file *file)
9291
return err;
9392
}
9493

95-
extern void stop_watchdog(int in_fd, int out_fd);
96-
9794
static int harddog_release(struct inode *inode, struct file *file)
9895
{
9996
/*
@@ -112,8 +109,6 @@ static int harddog_release(struct inode *inode, struct file *file)
112109
return 0;
113110
}
114111

115-
extern int ping_watchdog(int fd);
116-
117112
static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
118113
loff_t *ppos)
119114
{

arch/um/drivers/harddog_user.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <unistd.h>
88
#include <errno.h>
99
#include <os.h>
10+
#include "harddog.h"
1011

1112
struct dog_data {
1213
int stdin_fd;

arch/um/drivers/harddog_user_exp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <linux/export.h>
3+
#include "harddog.h"
4+
5+
#if IS_MODULE(CONFIG_UML_WATCHDOG)
6+
EXPORT_SYMBOL(start_watchdog);
7+
EXPORT_SYMBOL(stop_watchdog);
8+
EXPORT_SYMBOL(ping_watchdog);
9+
#endif

0 commit comments

Comments
 (0)