diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/alpha/kernel/console.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/alpha/kernel/console.c')
-rw-r--r-- | arch/alpha/kernel/console.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/arch/alpha/kernel/console.c b/arch/alpha/kernel/console.c new file mode 100644 index 000000000000..cb3e739fbad8 --- /dev/null +++ b/arch/alpha/kernel/console.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * linux/arch/alpha/kernel/console.c | ||
3 | * | ||
4 | * Architecture-specific specific support for VGA device on | ||
5 | * non-0 I/O hose | ||
6 | */ | ||
7 | |||
8 | #include <linux/config.h> | ||
9 | #include <linux/pci.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/tty.h> | ||
12 | #include <linux/console.h> | ||
13 | #include <asm/vga.h> | ||
14 | #include <asm/machvec.h> | ||
15 | |||
16 | #ifdef CONFIG_VGA_HOSE | ||
17 | |||
18 | /* | ||
19 | * Externally-visible vga hose bases | ||
20 | */ | ||
21 | unsigned long __vga_hose_io_base = 0; /* base for default hose */ | ||
22 | unsigned long __vga_hose_mem_base = 0; /* base for default hose */ | ||
23 | |||
24 | static struct pci_controller * __init | ||
25 | default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) | ||
26 | { | ||
27 | if (h2->index < h1->index) | ||
28 | return h2; | ||
29 | |||
30 | return h1; | ||
31 | } | ||
32 | |||
33 | void __init | ||
34 | set_vga_hose(struct pci_controller *hose) | ||
35 | { | ||
36 | if (hose) { | ||
37 | __vga_hose_io_base = hose->io_space->start; | ||
38 | __vga_hose_mem_base = hose->mem_space->start; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | void __init | ||
43 | locate_and_init_vga(void *(*sel_func)(void *, void *)) | ||
44 | { | ||
45 | struct pci_controller *hose = NULL; | ||
46 | struct pci_dev *dev = NULL; | ||
47 | |||
48 | if (!sel_func) sel_func = (void *)default_vga_hose_select; | ||
49 | |||
50 | for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { | ||
51 | if (!hose) hose = dev->sysdata; | ||
52 | else hose = sel_func(hose, dev->sysdata); | ||
53 | } | ||
54 | |||
55 | /* Did we already inititialize the correct one? */ | ||
56 | if (conswitchp == &vga_con && | ||
57 | __vga_hose_io_base == hose->io_space->start && | ||
58 | __vga_hose_mem_base == hose->mem_space->start) | ||
59 | return; | ||
60 | |||
61 | /* Set the VGA hose and init the new console */ | ||
62 | set_vga_hose(hose); | ||
63 | take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1); | ||
64 | } | ||
65 | |||
66 | #endif | ||