Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #include <linux/module.h> |
FUJITA Tomonori | 160c1d8 | 2009-01-05 23:59:02 +0900 | [diff] [blame] | 3 | #include <linux/dma-mapping.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <asm/machvec.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
| 6 | #ifdef CONFIG_IA64_GENERIC |
| 7 | |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/string.h> |
| 10 | |
| 11 | #include <asm/page.h> |
| 12 | |
Tony Luck | 8a635ff | 2019-05-15 18:04:14 -0700 | [diff] [blame] | 13 | struct ia64_machine_vector ia64_mv = { |
| 14 | .mmiowb = ___ia64_mmiowb |
| 15 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | EXPORT_SYMBOL(ia64_mv); |
| 17 | |
Horms | a5b00bb | 2006-03-23 14:27:12 -0800 | [diff] [blame] | 18 | static struct ia64_machine_vector * __init |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | lookup_machvec (const char *name) |
| 20 | { |
| 21 | extern struct ia64_machine_vector machvec_start[]; |
| 22 | extern struct ia64_machine_vector machvec_end[]; |
| 23 | struct ia64_machine_vector *mv; |
| 24 | |
| 25 | for (mv = machvec_start; mv < machvec_end; ++mv) |
| 26 | if (strcmp (mv->name, name) == 0) |
| 27 | return mv; |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |
Tony Luck | 9a86bbb | 2007-05-10 11:57:58 -0700 | [diff] [blame] | 32 | void __init |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | machvec_init (const char *name) |
| 34 | { |
| 35 | struct ia64_machine_vector *mv; |
| 36 | |
Horms | a5b00bb | 2006-03-23 14:27:12 -0800 | [diff] [blame] | 37 | if (!name) |
Horms | a07ee86 | 2007-07-25 16:06:25 +0900 | [diff] [blame] | 38 | name = acpi_get_sysname(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | mv = lookup_machvec(name); |
Horms | a5b00bb | 2006-03-23 14:27:12 -0800 | [diff] [blame] | 40 | if (!mv) |
| 41 | panic("generic kernel failed to find machine vector for" |
| 42 | " platform %s!", name); |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | ia64_mv = *mv; |
| 45 | printk(KERN_INFO "booting generic kernel on platform %s\n", name); |
| 46 | } |
| 47 | |
Horms | a07ee86 | 2007-07-25 16:06:25 +0900 | [diff] [blame] | 48 | void __init |
| 49 | machvec_init_from_cmdline(const char *cmdline) |
| 50 | { |
| 51 | char str[64]; |
| 52 | const char *start; |
| 53 | char *end; |
| 54 | |
| 55 | if (! (start = strstr(cmdline, "machvec=")) ) |
| 56 | return machvec_init(NULL); |
| 57 | |
| 58 | strlcpy(str, start + strlen("machvec="), sizeof(str)); |
| 59 | if ( (end = strchr(str, ' ')) ) |
| 60 | *end = '\0'; |
| 61 | |
| 62 | return machvec_init(str); |
| 63 | } |
| 64 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | #endif /* CONFIG_IA64_GENERIC */ |
| 66 | |
| 67 | void |
| 68 | machvec_setup (char **arg) |
| 69 | { |
| 70 | } |
| 71 | EXPORT_SYMBOL(machvec_setup); |
| 72 | |
| 73 | void |
David Howells | 7d12e78 | 2006-10-05 14:55:46 +0100 | [diff] [blame] | 74 | machvec_timer_interrupt (int irq, void *dev_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | { |
| 76 | } |
| 77 | EXPORT_SYMBOL(machvec_timer_interrupt); |