David, I was getting annoyed at having to mess around with the HP Simulator stuff when trying to compile generic kernels. Here's the fix that I came up with. It basically makes the HP Sim console another config option that depends on the HP sim serial code. It also sticks a couple of run-time checks in the init functions to only setup and run the code on hpsim machines. mh -- Wild Open Source Inc. mort@wildopensource.com # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1102 -> 1.1103 # arch/ia64/hp/sim/Kconfig 1.2 -> 1.3 # arch/ia64/hp/sim/simserial.c 1.16 -> 1.17 # arch/ia64/hp/sim/Makefile 1.6 -> 1.7 # arch/ia64/hp/sim/hpsim_setup.c 1.5 -> 1.6 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/06/03 mort@green.i.bork.org 1.1103 # Make the HP Simulator serial and console code compile # correctly for CONFIG_IA64_GENERIC kernels. # -------------------------------------------- # diff -Nru a/arch/ia64/hp/sim/Kconfig b/arch/ia64/hp/sim/Kconfig --- a/arch/ia64/hp/sim/Kconfig Tue Jun 3 11:24:27 2003 +++ b/arch/ia64/hp/sim/Kconfig Tue Jun 3 11:24:27 2003 @@ -7,7 +7,10 @@ config HP_SIMSERIAL bool "Simulated serial driver support" - default y if IA64_GENERIC + +config HP_SIMSERIAL_CONSOLE + bool "Console for HP simulator" + depends on HP_SIMSERIAL config HP_SIMSCSI bool "Simulated SCSI disk" diff -Nru a/arch/ia64/hp/sim/Makefile b/arch/ia64/hp/sim/Makefile --- a/arch/ia64/hp/sim/Makefile Tue Jun 3 11:24:27 2003 +++ b/arch/ia64/hp/sim/Makefile Tue Jun 3 11:24:27 2003 @@ -7,9 +7,10 @@ # Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) # -obj-y := hpsim_console.o hpsim_irq.o hpsim_setup.o +obj-y := hpsim_irq.o hpsim_setup.o obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o obj-$(CONFIG_HP_SIMETH) += simeth.o obj-$(CONFIG_HP_SIMSERIAL) += simserial.o +obj-$(CONFIG_HP_SIMSERIAL_CONSOLE) += hpsim_console.o obj-$(CONFIG_HP_SIMSCSI) += simscsi.o diff -Nru a/arch/ia64/hp/sim/hpsim_setup.c b/arch/ia64/hp/sim/hpsim_setup.c --- a/arch/ia64/hp/sim/hpsim_setup.c Tue Jun 3 11:24:27 2003 +++ b/arch/ia64/hp/sim/hpsim_setup.c Tue Jun 3 11:24:27 2003 @@ -5,6 +5,7 @@ * David Mosberger-Tang <davidm@hpl.hp.com> * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com> */ +#include <linux/config.h> #include <linux/console.h> #include <linux/init.h> #include <linux/kdev_t.h> @@ -24,8 +25,6 @@ #include "hpsim_ssc.h" -extern struct console hpsim_cons; - /* * Simulator system call. */ @@ -56,5 +55,11 @@ { ROOT_DEV = Root_SDA1; /* default to first SCSI drive */ - register_console(&hpsim_cons); +#ifdef CONFIG_HP_SIMSERIAL_CONSOLE + { + extern struct console hpsim_cons; + if (ia64_platform_is("hpsim")) + register_console(&hpsim_cons); + } +#endif } diff -Nru a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c --- a/arch/ia64/hp/sim/simserial.c Tue Jun 3 11:24:27 2003 +++ b/arch/ia64/hp/sim/simserial.c Tue Jun 3 11:24:27 2003 @@ -1025,6 +1025,9 @@ int i; struct serial_state *state; + if (!ia64_platform_is("hpsim")) + return -ENODEV; + show_serial_version(); /* Initialize the tty_driver structure */Received on Tue Jun 03 09:26:43 2003
This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:15 EST