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