segment.c 753 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * segment.c: Prom routine to map segments in other contexts before
  3. * a standalone is completely mapped. This is for sun4 and
  4. * sun4c architectures only.
  5. *
  6. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  7. */
  8. #include <linux/types.h>
  9. #include <linux/kernel.h>
  10. #include <linux/sched.h>
  11. #include <asm/openprom.h>
  12. #include <asm/oplib.h>
  13. extern void restore_current(void);
  14. /* Set physical segment 'segment' at virtual address 'vaddr' in
  15. * context 'ctx'.
  16. */
  17. void
  18. prom_putsegment(int ctx, unsigned long vaddr, int segment)
  19. {
  20. unsigned long flags;
  21. spin_lock_irqsave(&prom_lock, flags);
  22. (*(romvec->pv_setctxt))(ctx, (char *) vaddr, segment);
  23. restore_current();
  24. spin_unlock_irqrestore(&prom_lock, flags);
  25. }