cache.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* cache.S - Flush the processor cache for a specific region. */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <grub/symbol.h>
  20. .file "cache.S"
  21. .text
  22. /*
  23. * void grub_arch_sync_caches (void *address, grub_size_t len)
  24. */
  25. FUNCTION(grub_arch_sync_caches)
  26. brz,pn %o1, 2f
  27. add %o0, %o1, %o1
  28. add %o1, 7, %o1
  29. andn %o1, 7, %o1
  30. andn %o0, 7, %o0
  31. sub %o1, %o0, %o1
  32. 1: subcc %o1, 8, %o1
  33. bne,pt %icc, 1b
  34. flush %o0 + %o1
  35. 2: retl
  36. nop