blob: f5a1e5246b3e02e3f1039c848c894407b6e273b2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/module.h>
FUJITA Tomonori160c1d82009-01-05 23:59:02 +09002#include <linux/dma-mapping.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07003#include <asm/machvec.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5#ifdef CONFIG_IA64_GENERIC
6
7#include <linux/kernel.h>
8#include <linux/string.h>
9
10#include <asm/page.h>
11
12struct ia64_machine_vector ia64_mv;
13EXPORT_SYMBOL(ia64_mv);
14
Hormsa5b00bb2006-03-23 14:27:12 -080015static struct ia64_machine_vector * __init
Linus Torvalds1da177e2005-04-16 15:20:36 -070016lookup_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 Luck9a86bbb2007-05-10 11:57:58 -070029void __init
Linus Torvalds1da177e2005-04-16 15:20:36 -070030machvec_init (const char *name)
31{
32 struct ia64_machine_vector *mv;
33
Hormsa5b00bb2006-03-23 14:27:12 -080034 if (!name)
Hormsa07ee862007-07-25 16:06:25 +090035 name = acpi_get_sysname();
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 mv = lookup_machvec(name);
Hormsa5b00bb2006-03-23 14:27:12 -080037 if (!mv)
38 panic("generic kernel failed to find machine vector for"
39 " platform %s!", name);
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 ia64_mv = *mv;
42 printk(KERN_INFO "booting generic kernel on platform %s\n", name);
43}
44
Hormsa07ee862007-07-25 16:06:25 +090045void __init
46machvec_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 Torvalds1da177e2005-04-16 15:20:36 -070062#endif /* CONFIG_IA64_GENERIC */
63
64void
65machvec_setup (char **arg)
66{
67}
68EXPORT_SYMBOL(machvec_setup);
69
70void
David Howells7d12e782006-10-05 14:55:46 +010071machvec_timer_interrupt (int irq, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -070072{
73}
74EXPORT_SYMBOL(machvec_timer_interrupt);
75
76void
FUJITA Tomonori160c1d82009-01-05 23:59:02 +090077machvec_dma_sync_single(struct device *hwdev, dma_addr_t dma_handle, size_t size,
78 enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -070079{
80 mb();
81}
82EXPORT_SYMBOL(machvec_dma_sync_single);
83
84void
FUJITA Tomonori160c1d82009-01-05 23:59:02 +090085machvec_dma_sync_sg(struct device *hwdev, struct scatterlist *sg, int n,
86 enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -070087{
88 mb();
89}
90EXPORT_SYMBOL(machvec_dma_sync_sg);