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

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