machvec.c 1.8 KB

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