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(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  12 {
  13   int success=0;
  14 
  15   __asm__ __volatile__("lduba [%1] 2, %0\n\t"
  16                        "or    %0, 0x10, %0\n\t"
  17                        "stba  %0, [%1] 2\n\t"
  18                        "or    %%g0, %%g0, %0" :
  19                        "=r" (success) :
  20                        "r" ((unsigned int) 0x40000000),
  21                        "0" (success));
  22   return success;
  23 }
  24 
  25 /* disable_vac() disables the virtual address cache. It returns 0 on
  26    success, 1 on failure.
  27 */
  28 
  29 extern __inline__ int disable_vac(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  30 {
  31   int success=0;
  32 
  33   __asm__ __volatile__("lduba [%1] 0x2, %0\n\t"
  34                         "xor   %0, 0x10, %0\n\t"
  35                         "stba  %0, [%1] 0x2\n\t"
  36                         "or    %%g0, %%g0, %0" : 
  37                        "=r" (success) : 
  38                        "r" (0x40000000),
  39                        "0" (success));
  40   return success;
  41 }
  42 
  43 /* Various one-shot VAC entry flushes on the Sparc */
  44 
  45 extern __inline__ void hw_flush_vac_context_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  46 {
  47   __asm__ __volatile__("sta %%g0, [%0] 0x7" : : "r" (addr));
  48 }
  49 
  50 extern __inline__ void sw_flush_vac_context_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  51 {
  52   __asm__ __volatile__("sta %%g0, [%0] 0xe" : : "r" (addr));
  53 }
  54 
  55 extern __inline__ void hw_flush_vac_segment_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  56 {
  57   __asm__ __volatile__("sta %%g0, [%0] 0x5" : : "r" (addr));
  58 }
  59 
  60 extern __inline__ void sw_flush_vac_segment_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  61 {
  62   __asm__ __volatile__("sta %%g0, [%0] 0xc" : : "r" (addr));
  63 }
  64 
  65 extern __inline__ void hw_flush_vac_page_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  66 {
  67   __asm__ __volatile__("sta %%g0, [%0] 0x6" : : "r" (addr));
  68 }
  69 
  70 extern __inline__ void sw_flush_vac_page_entry(char* addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  71 {
  72   __asm__ __volatile__("sta %%g0, [%0] 0xd" : : "r" (addr));
  73 }
  74  

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