Skip to contentSkip to conversation

UML - Move SIGIO startup code to os-Linux/start_up.c

PATCH In review Jeff Dike 1 participant 1 message Mar 24, 2006 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 6/16 UML - Move SIGIO startup code to os-Linux/start_up.c

The serial UML OS-abstraction layer patch (um/kernel dir).

This moves all startup code from sigio_user.c file under os-Linux dir

arch/um/include/os.h +1 -0
Index: linux-2.6.16/arch/um/include/os.h
===================================================================
@@ -161,6 +161,7 @@ extern int os_lock_file(int fd, int excl
 /* start_up.c */
 extern void os_early_checks(void);
 extern int can_do_skas(void);
+extern void os_check_bugs(void);
 
 /* Make sure they are clear when running in TT mode. Required by
  * SEGV_MAYBE_FIXABLE */
arch/um/include/sigio.h +0 -1
Index: linux-2.6.16/arch/um/include/sigio.h
===================================================================
@@ -8,7 +8,6 @@
 
 extern int write_sigio_irq(int fd);
 extern int register_sigio_fd(int fd);
-extern int read_sigio_fd(int fd);
 extern int add_sigio_fd(int fd, int read);
 extern int ignore_sigio_fd(int fd);
 extern void sigio_lock(void);
arch/um/kernel/sigio_kern.c +8 -2
Index: linux-2.6.16/arch/um/kernel/sigio_kern.c
===================================================================
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2002 - 2003 Jeff Dike ([email protected])
  * Licensed under the GPL
  */
@@ -12,13 +12,16 @@
 #include "sigio.h"
 #include "irq_user.h"
 #include "irq_kern.h"
+#include "os.h"
 
 /* Protected by sigio_lock() called from write_sigio_workaround */
 static int sigio_irq_fd = -1;
 
 static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused)
 {
-	read_sigio_fd(sigio_irq_fd);
+	char c;
+
+	os_read_file(sigio_irq_fd, &c, sizeof(c));
 	reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
 	return(IRQ_HANDLED);
 }
@@ -51,6 +54,9 @@ void sigio_unlock(void)
 	spin_unlock(&sigio_spinlock);
 }
 
+extern void sigio_cleanup(void);
+__uml_exitcall(sigio_cleanup);
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
arch/um/kernel/sigio_user.c +10 -152

190 lines not on this page · raw message

arch/um/kernel/um_arch.c +1 -2
Index: linux-2.6.16/arch/um/kernel/um_arch.c
===================================================================
@@ -487,8 +487,7 @@ void __init setup_arch(char **cmdline_p)
 void __init check_bugs(void)
 {
 	arch_check_bugs();
-	check_sigio();
-	check_devanon();
+ 	os_check_bugs();
 }
 
 void apply_alternatives(void *start, void *end)
arch/um/os-Linux/start_up.c +128 -0

137 lines not on this page · raw message

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel