root/include/asm-sparc/vac-ops.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. enable_vac
  2. disable_vac
  3. hw_flush_vac_context_entry
  4. sw_flush_vac_context_entry
  5. hw_flush_vac_segment_entry
  6. sw_flush_vac_segment_entry
  7. hw_flush_vac_page_entry
  8. sw_flush_vac_page_entry

   1 /* vac-ops.h: Inline assembly routines to do operations on the Sparc
   2               VAC (virtual address cache).
   3 
   4    Copyright (C) 1994, David S. Miller (davem@caip.rutgers.edu)
   5 */
   6 
   7 /* enable_vac() enables the virtual address cache. It returns 0 on
   8    success, 1 on failure.
   9 */
  10 
  11 extern __inline__ int enable_vac()
     /* [previous][next][first][last][top][bottom][index][help] */
  12 {
  13   int success;
  14 
  15   &success;
  16   
  17   __asm__ __volatile__("lduba [%1] 2, %0\n\t"
  18                        "or    %0, 0x10, %0\n\t"
  19                        "stba  %0, [%1] 2\n\t"
  20                        "or    %%g0, %%g0, %0" :
  21                        "=r" (success) :
  22                        "r" ((unsigned int) 0x40000000),
  23                        "0" (success));
  24   return success;
  25 }
  26 
  27 /* disable_vac() disables the virtual address cache. It returns 0 on
  28    success, 1 on failure.
  29 */
  30 
  31 extern __inline__ int disable_vac()
     /* [previous][next][first][last][top][bottom][index][help] */
  32 {
  33   int success;
  34 
  35   __asm__ __volatile__("lduba [%1] 0x2, %0\n\t"
  36                         "xor   %0, 0x10, %0\n\t"
  37                         "stba  %0, [%1] 0x2\n\t"
  38                         "or    %%g0, %%g0, %0" : 
  39                        "=r" (success) : 
  40                        "r" (0x40000000),
  41                        "0" (success));
  42   return success;
  43 }
  44 
  45 /* Various one-shot VAC entry flushes on the Sparc */
  46 
  47 extern __inline__ void hw_flush_vac_context_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  48 {
  49   __asm__ __volatile__("sta %%g0, [%0] 0x7" : : "r" (addr));
  50 }
  51 
  52 extern __inline__ void sw_flush_vac_context_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  53 {
  54   __asm__ __volatile__("sta %%g0, [%0] 0xe" : : "r" (addr));
  55 }
  56 
  57 extern __inline__ void hw_flush_vac_segment_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  58 {
  59   __asm__ __volatile__("sta %%g0, [%0] 0x5" : : "r" (addr));
  60 }
  61 
  62 extern __inline__ void sw_flush_vac_segment_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  63 {
  64   __asm__ __volatile__("sta %%g0, [%0] 0xc" : : "r" (addr));
  65 }
  66 
  67 extern __inline__ void hw_flush_vac_page_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  68 {
  69   __asm__ __volatile__("sta %%g0, [%0] 0x6" : : "r" (addr));
  70 }
  71 
  72 extern __inline__ void sw_flush_vac_page_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  73 {
  74   __asm__ __volatile__("sta %%g0, [%0] 0xd" : : "r" (addr));
  75 }
  76  

/* [previous][next][first][last][top][bottom][index][help] */