machvec.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include <linux/module.h>
  2. #include <linux/dma-mapping.h>
  3. #include <asm/machvec.h>
  4. #ifdef CONFIG_IA64_GENERIC
  5. #include <linux/kernel.h>
  6. #include <linux/string.h>
  7. #include <asm/page.h>
  8. struct ia64_machine_vector ia64_mv;
  9. EXPORT_SYMBOL(ia64_mv);
  10. static struct ia64_machine_vector * __init
  11. lookup_machvec (const char *name)
  12. {
  13. extern struct ia64_machine_vector machvec_start[];
  14. extern struct ia64_machine_vector machvec_end[];
  15. struct ia64_machine_vector *mv;
  16. for (mv = machvec_start; mv < machvec_end; ++mv)
  17. if (strcmp (mv->name, name) == 0)
  18. return mv;
  19. return 0;
  20. }
  21. void __init
  22. machvec_init (const char *name)
  23. {
  24. struct ia64_machine_vector *mv;
  25. if (!name)
  26. name = acpi_get_sysname();
  27. mv = lookup_machvec(name);
  28. if (!mv)
  29. panic("generic kernel failed to find machine vector for"
  30. " platform %s!", name);
  31. ia64_mv = *mv;
  32. printk(KERN_INFO "booting generic kernel on platform %s\n", name);
  33. }
  34. void __init
  35. machvec_init_from_cmdline(const char *cmdline)
  36. {
  37. char str[64];
  38. const char *start;
  39. char *end;
  40. if (! (start = strstr(cmdline, "machvec=")) )
  41. return machvec_init(NULL);
  42. strlcpy(str, start + strlen("machvec="), sizeof(str));
  43. if ( (end = strchr(str, ' ')) )
  44. *end = '\0';
  45. return machvec_init(str);
  46. }
  47. #endif /* CONFIG_IA64_GENERIC */
  48. void
  49. machvec_setup (char **arg)
  50. {
  51. }
  52. EXPORT_SYMBOL(machvec_setup);
  53. void
  54. machvec_timer_interrupt (int irq, void *dev_id)
  55. {
  56. }
  57. EXPORT_SYMBOL(machvec_timer_interrupt);
  58. void
  59. machvec_dma_sync_single(struct device *hwdev, dma_addr_t dma_handle, size_t size,
  60. enum dma_data_direction dir)
  61. {
  62. mb();
  63. }
  64. EXPORT_SYMBOL(machvec_dma_sync_single);
  65. void
  66. machvec_dma_sync_sg(struct device *hwdev, struct scatterlist *sg, int n,
  67. enum dma_data_direction dir)
  68. {
  69. mb();
  70. }
  71. EXPORT_SYMBOL(machvec_dma_sync_sg);