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