root/arch/sparc/mm/s4cflush.S

/* [previous][next][first][last][top][bottom][index][help] */
   1 /* $Id: s4cflush.S,v 1.8 1995/11/25 00:59:29 davem Exp $
   2  * s4cflush.S: Inline management of the sun4c cache.
   3  *
   4  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
   5  */
   6 
   7 #include <asm/head.h>
   8 #include <asm/cprefix.h>
   9 #include <asm/asi.h>
  10 #include <asm/page.h>
  11 
  12 /* We need to be able to call a routine which will in low-level
  13  * assembly flush an entire segment from the virtual cache using
  14  * a base virtual address and that will use as few registers as
  15  * possible.  The address of that function is stored here.
  16  * The register usage for this routine is defined as
  17  * %l2 -- Address of Segment to flush
  18  * %l4 -- Return address
  19  * %l6 -- scratch
  20  * %l7 -- scratch
  21  */
  22         .align  4
  23         .globl  C_LABEL(sun4c_ctxflush), C_LABEL(sun4c_segflush)
  24         .globl  C_LABEL(sun4c_pgflush)
  25 C_LABEL(sun4c_ctxflush):        .word   C_LABEL(sun4c_ctxflush_sw64KB16B)
  26 C_LABEL(sun4c_segflush):        .word   C_LABEL(sun4c_segflush_sw64KB16B)
  27 C_LABEL(sun4c_pgflush):         .word   C_LABEL(sun4c_pgflush_sw64KB16B)
  28 
  29         .text
  30 
  31         /* Here are the assembly in-line virtual cache flushing
  32          * routines on the sun4c.
  33          */
  34 
  35         .align 4
  36         .globl C_LABEL(sun4c_ctxflush_hw64KB16B)
  37 
  38         /* Flush an entire context using hardware assisted flushes
  39          * for a cache of size 64KB with 16B lines.
  40          */
  41 C_LABEL(sun4c_ctxflush_hw64KB16B):
  42         sethi   %hi(PAGE_SIZE), %l6
  43         /* Now flush 16 pages starting at virtual address zero */
  44         or      %g0, %g0, %l7   
  45         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* One */
  46         add     %l7, %l6, %l7
  47         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Two */
  48         add     %l7, %l6, %l7
  49         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Three */
  50         add     %l7, %l6, %l7
  51         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Four */
  52         add     %l7, %l6, %l7
  53         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Five */
  54         add     %l7, %l6, %l7
  55         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Six */
  56         add     %l7, %l6, %l7
  57         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Seven */
  58         add     %l7, %l6, %l7
  59         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Eight */
  60         add     %l7, %l6, %l7
  61         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Nine */
  62         add     %l7, %l6, %l7
  63         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Ten */
  64         add     %l7, %l6, %l7
  65         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Eleven */
  66         add     %l7, %l6, %l7
  67         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Twelve */
  68         add     %l7, %l6, %l7
  69         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Thirteen */
  70         add     %l7, %l6, %l7
  71         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Fourteen */
  72         add     %l7, %l6, %l7
  73         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Fifteen */
  74         add     %l7, %l6, %l7
  75 
  76         /* Return to caller and flush the last page */
  77         jmpl    %l4 + 0x8, %g0
  78         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Sixteen */
  79 
  80 
  81         .globl C_LABEL(sun4c_ctxflush_sw64KB16B)
  82 
  83         /* Flush an entire context using software flushes
  84          * for a cache of size 64KB with 16B lines.
  85          */
  86 C_LABEL(sun4c_ctxflush_sw64KB16B):
  87         /* Starting at virtual address zero, software flush
  88          * 4096 lines at 16 byte intervals.
  89          */
  90 #define SWFLUSHCTX16_2LINES \
  91         sta     %g0, [%l7] ASI_FLUSHCTX; \
  92         add     %l7, 0x10, %l7; \
  93         sta     %g0, [%l7] ASI_FLUSHCTX; \
  94         add     %l7, 0x10, %l7; \
  95 
  96 #define SWFLUSHCTX16_4LINES \
  97         SWFLUSHCTX16_2LINES \
  98         SWFLUSHCTX16_2LINES \
  99         
 100 #define SWFLUSHCTX16_8LINES \
 101         SWFLUSHCTX16_4LINES \
 102         SWFLUSHCTX16_4LINES \
 103         
 104 #define SWFLUSHCTX16_16LINES \
 105         SWFLUSHCTX16_8LINES \
 106         SWFLUSHCTX16_8LINES \
 107         
 108 #define SWFLUSHCTX16_32LINES \
 109         SWFLUSHCTX16_16LINES \
 110         SWFLUSHCTX16_16LINES \
 111         
 112 #define SWFLUSHCTX16_64LINES \
 113         SWFLUSHCTX16_32LINES \
 114         SWFLUSHCTX16_32LINES \
 115         
 116 #define SWFLUSHCTX16_128LINES \
 117         SWFLUSHCTX16_64LINES \
 118         SWFLUSHCTX16_64LINES \
 119         
 120 #define SWFLUSHCTX16_256LINES \
 121         SWFLUSHCTX16_128LINES \
 122         SWFLUSHCTX16_128LINES \
 123         
 124         /* WHEE! */
 125         or      %g0, %g0, %l7           /* Base register */
 126         SWFLUSHCTX16_256LINES
 127         SWFLUSHCTX16_256LINES
 128         SWFLUSHCTX16_256LINES
 129         SWFLUSHCTX16_256LINES
 130         SWFLUSHCTX16_256LINES
 131         SWFLUSHCTX16_256LINES
 132         SWFLUSHCTX16_256LINES
 133         SWFLUSHCTX16_256LINES
 134         SWFLUSHCTX16_256LINES
 135         SWFLUSHCTX16_256LINES
 136         SWFLUSHCTX16_256LINES
 137         SWFLUSHCTX16_256LINES
 138         SWFLUSHCTX16_256LINES
 139         SWFLUSHCTX16_256LINES
 140         SWFLUSHCTX16_256LINES
 141         SWFLUSHCTX16_256LINES
 142 
 143         /* Done, return to caller */
 144         jmpl    %l4 + 0x8, %g0
 145         nop
 146 
 147         .globl C_LABEL(sun4c_ctxflush_hw64KB32B)
 148         /* Flush an entire context using hardware assisted flushes
 149          * for a cache of size 64KB with 32B lines.
 150          */
 151 C_LABEL(sun4c_ctxflush_hw64KB32B):
 152         sethi   %hi(PAGE_SIZE), %l6
 153         /* Now flush 16 pages starting at virtual address zero */
 154         or      %g0, %g0, %l7   
 155         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* One */
 156         add     %l7, %l6, %l7
 157         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Two */
 158         add     %l7, %l6, %l7
 159         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Three */
 160         add     %l7, %l6, %l7
 161         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Four */
 162         add     %l7, %l6, %l7
 163         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Five */
 164         add     %l7, %l6, %l7
 165         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Six */
 166         add     %l7, %l6, %l7
 167         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Seven */
 168         add     %l7, %l6, %l7
 169         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Eight */
 170         add     %l7, %l6, %l7
 171         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Nine */
 172         add     %l7, %l6, %l7
 173         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Ten */
 174         add     %l7, %l6, %l7
 175         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Eleven */
 176         add     %l7, %l6, %l7
 177         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Twelve */
 178         add     %l7, %l6, %l7
 179         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Thirteen */
 180         add     %l7, %l6, %l7
 181         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Fourteen */
 182         add     %l7, %l6, %l7
 183         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Fifteen */
 184         add     %l7, %l6, %l7
 185 
 186         /* Return to caller and flush the last page */
 187         jmpl    %l4 + 0x8, %g0
 188         sta     %g0, [%l7] ASI_HWFLUSHCONTEXT   /* Sixteen */
 189 
 190         .globl C_LABEL(sun4c_ctxflush_sw64KB32B)
 191 
 192         /* Flush an entire context using software flushes
 193          * for a cache of size 64KB with 32B lines.
 194          */
 195 C_LABEL(sun4c_ctxflush_sw64KB32B):
 196         /* Starting at virtual address zero, software flush
 197          * 2048 lines at 32 byte intervals.
 198          */
 199 #define SWFLUSHCTX32_2LINES \
 200         sta     %g0, [%l7] ASI_FLUSHCTX; \
 201         add     %l7, 0x20, %l7; \
 202         sta     %g0, [%l7] ASI_FLUSHCTX; \
 203         add     %l7, 0x20, %l7; \
 204         
 205 #define SWFLUSHCTX32_4LINES \
 206         SWFLUSHCTX32_2LINES \
 207         SWFLUSHCTX32_2LINES \
 208 
 209 #define SWFLUSHCTX32_8LINES \
 210         SWFLUSHCTX32_4LINES \
 211         SWFLUSHCTX32_4LINES \
 212 
 213 #define SWFLUSHCTX32_16LINES \
 214         SWFLUSHCTX32_8LINES \
 215         SWFLUSHCTX32_8LINES \
 216 
 217 #define SWFLUSHCTX32_32LINES \
 218         SWFLUSHCTX32_16LINES \
 219         SWFLUSHCTX32_16LINES \
 220 
 221 #define SWFLUSHCTX32_64LINES \
 222         SWFLUSHCTX32_32LINES \
 223         SWFLUSHCTX32_32LINES \
 224 
 225 #define SWFLUSHCTX32_128LINES \
 226         SWFLUSHCTX32_64LINES \
 227         SWFLUSHCTX32_64LINES \
 228 
 229         /* WHEE! */
 230         or      %g0, %g0, %l7           /* Base register */
 231         SWFLUSHCTX32_128LINES
 232         SWFLUSHCTX32_128LINES
 233         SWFLUSHCTX32_128LINES
 234         SWFLUSHCTX32_128LINES
 235         SWFLUSHCTX32_128LINES
 236         SWFLUSHCTX32_128LINES
 237         SWFLUSHCTX32_128LINES
 238         SWFLUSHCTX32_128LINES
 239         SWFLUSHCTX32_128LINES
 240         SWFLUSHCTX32_128LINES
 241         SWFLUSHCTX32_128LINES
 242         SWFLUSHCTX32_128LINES
 243         SWFLUSHCTX32_128LINES
 244         SWFLUSHCTX32_128LINES
 245         SWFLUSHCTX16_256LINES
 246         SWFLUSHCTX16_256LINES
 247 
 248         jmpl    %l4 + 0x8, %g0
 249         nop
 250 
 251         .align 4
 252         .globl C_LABEL(sun4c_segflush_hw64KB16B)
 253 
 254         /* Flush an entire segment using hardware assisted flushes
 255          * for a cache of size 64KB with 16B lines.
 256          */
 257 C_LABEL(sun4c_segflush_hw64KB16B):
 258         sethi   %hi(PAGE_SIZE), %l6     /* Increment */
 259         sethi   %hi(0xfffc0000), %l7
 260         and     %l2, %l7, %l7           /* Base address */
 261 
 262         /* Now flush 16 pages starting at beginning of vseg */
 263         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* One */
 264         add     %l7, %l6, %l7
 265         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Two */
 266         add     %l7, %l6, %l7
 267         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Three */
 268         add     %l7, %l6, %l7
 269         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Four */
 270         add     %l7, %l6, %l7
 271         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Five */
 272         add     %l7, %l6, %l7
 273         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Six */
 274         add     %l7, %l6, %l7
 275         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Seven */
 276         add     %l7, %l6, %l7
 277         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Eight */
 278         add     %l7, %l6, %l7
 279         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Nine */
 280         add     %l7, %l6, %l7
 281         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Ten */
 282         add     %l7, %l6, %l7
 283         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Eleven */
 284         add     %l7, %l6, %l7
 285         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Twelve */
 286         add     %l7, %l6, %l7
 287         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Thirteen */
 288         add     %l7, %l6, %l7
 289         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Fourteen */
 290         add     %l7, %l6, %l7
 291         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Fifteen */
 292         add     %l7, %l6, %l7
 293 
 294         /* Return to caller and flush the last page */
 295         jmpl    %l4 + 0x8, %g0
 296         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Sixteen */
 297 
 298         .globl C_LABEL(sun4c_segflush_sw64KB16B)
 299 
 300         /* Flush an entire segment using software flushes
 301          * for a cache of size 64KB with 16B lines.
 302          */
 303 C_LABEL(sun4c_segflush_sw64KB16B):
 304         /* Starting at virtual address in %l2, software flush
 305          * 4096 lines at 16 byte intervals.
 306          */
 307 #define SWFLUSHSEG16_2LINES \
 308         sta     %g0, [%l7] ASI_FLUSHSEG; \
 309         add     %l7, 0x10, %l7; \
 310         sta     %g0, [%l7] ASI_FLUSHSEG; \
 311         add     %l7, 0x10, %l7; \
 312 
 313 #define SWFLUSHSEG16_4LINES \
 314         SWFLUSHSEG16_2LINES \
 315         SWFLUSHSEG16_2LINES \
 316 
 317 #define SWFLUSHSEG16_8LINES \
 318         SWFLUSHSEG16_4LINES \
 319         SWFLUSHSEG16_4LINES \
 320 
 321 #define SWFLUSHSEG16_16LINES \
 322         SWFLUSHSEG16_8LINES \
 323         SWFLUSHSEG16_8LINES \
 324 
 325 #define SWFLUSHSEG16_32LINES \
 326         SWFLUSHSEG16_16LINES \
 327         SWFLUSHSEG16_16LINES \
 328 
 329 #define SWFLUSHSEG16_64LINES \
 330         SWFLUSHSEG16_32LINES \
 331         SWFLUSHSEG16_32LINES \
 332 
 333 #define SWFLUSHSEG16_128LINES \
 334         SWFLUSHSEG16_64LINES \
 335         SWFLUSHSEG16_64LINES \
 336 
 337 #define SWFLUSHSEG16_256LINES \
 338         SWFLUSHSEG16_128LINES \
 339         SWFLUSHSEG16_128LINES \
 340 
 341         sethi   %hi(0xfffc0000), %l7
 342         and     %l2, %l7, %l7           /* Base register */
 343         SWFLUSHSEG16_256LINES
 344         SWFLUSHSEG16_256LINES
 345         SWFLUSHSEG16_256LINES
 346         SWFLUSHSEG16_256LINES
 347         SWFLUSHSEG16_256LINES
 348         SWFLUSHSEG16_256LINES
 349         SWFLUSHSEG16_256LINES
 350         SWFLUSHSEG16_256LINES
 351         SWFLUSHSEG16_256LINES
 352         SWFLUSHSEG16_256LINES
 353         SWFLUSHSEG16_256LINES
 354         SWFLUSHSEG16_256LINES
 355         SWFLUSHSEG16_256LINES
 356         SWFLUSHSEG16_256LINES
 357         SWFLUSHSEG16_256LINES
 358         SWFLUSHSEG16_256LINES
 359 
 360         /* Done, return to caller */
 361         jmpl    %l4 + 0x8, %g0
 362         nop
 363 
 364         .globl C_LABEL(sun4c_segflush_hw64KB32B)
 365 
 366         /* Flush an entire segment using hardware assisted flushes
 367          * for a cache of size 64KB with 32B lines.
 368          */
 369 C_LABEL(sun4c_segflush_hw64KB32B):
 370         sethi   %hi(PAGE_SIZE), %l6     /* Increment */
 371         sethi   %hi(0xfffc0000), %l7
 372         and     %l2, %l7, %l7           /* Base register */
 373 
 374         /* Now flush 16 pages starting at virtual address in %l7 */
 375         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* One */
 376         add     %l7, %l6, %l7
 377         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Two */
 378         add     %l7, %l6, %l7
 379         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Three */
 380         add     %l7, %l6, %l7
 381         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Four */
 382         add     %l7, %l6, %l7
 383         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Five */
 384         add     %l7, %l6, %l7
 385         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Six */
 386         add     %l7, %l6, %l7
 387         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Seven */
 388         add     %l7, %l6, %l7
 389         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Eight */
 390         add     %l7, %l6, %l7
 391         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Nine */
 392         add     %l7, %l6, %l7
 393         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Ten */
 394         add     %l7, %l6, %l7
 395         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Eleven */
 396         add     %l7, %l6, %l7
 397         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Twelve */
 398         add     %l7, %l6, %l7
 399         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Thirteen */
 400         add     %l7, %l6, %l7
 401         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Fourteen */
 402         add     %l7, %l6, %l7
 403         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Fifteen */
 404         add     %l7, %l6, %l7
 405 
 406         /* Return to caller and flush the last page */
 407         jmpl    %l4 + 0x8, %g0
 408         sta     %g0, [%l7] ASI_HWFLUSHSEG   /* Sixteen */
 409         
 410         .globl C_LABEL(sun4c_segflush_sw64KB32B)
 411 
 412         /* Flush an entire segment using software flushes
 413          * for a cache of size 64KB with 32B lines.
 414          */
 415 C_LABEL(sun4c_segflush_sw64KB32B):
 416         /* Starting at virtual address passed in %l2, software
 417          * flush 2048 lines at 32 byte intervals.
 418          */
 419 #define SWFLUSHSEG32_2LINES \
 420         sta     %g0, [%l7] ASI_FLUSHSEG; \
 421         add     %l7, 0x20, %l7; \
 422         sta     %g0, [%l7] ASI_FLUSHSEG; \
 423         add     %l7, 0x20, %l7; \
 424 
 425 #define SWFLUSHSEG32_4LINES \
 426         SWFLUSHSEG32_2LINES \
 427         SWFLUSHSEG32_2LINES \
 428 
 429 #define SWFLUSHSEG32_8LINES \
 430         SWFLUSHSEG32_4LINES \
 431         SWFLUSHSEG32_4LINES \
 432 
 433 #define SWFLUSHSEG32_16LINES \
 434         SWFLUSHSEG32_8LINES \
 435         SWFLUSHSEG32_8LINES \
 436 
 437 #define SWFLUSHSEG32_32LINES \
 438         SWFLUSHSEG32_16LINES \
 439         SWFLUSHSEG32_16LINES \
 440 
 441 #define SWFLUSHSEG32_64LINES \
 442         SWFLUSHSEG32_32LINES \
 443         SWFLUSHSEG32_32LINES \
 444 
 445 #define SWFLUSHSEG32_128LINES \
 446         SWFLUSHSEG32_64LINES \
 447         SWFLUSHSEG32_64LINES \
 448 
 449         /* WHEE! */
 450         sethi   %hi(0xfffc0000), %l7
 451         and     %l2, %l7, %l7           /* Base register */
 452         SWFLUSHSEG32_128LINES
 453         SWFLUSHSEG32_128LINES
 454         SWFLUSHSEG32_128LINES
 455         SWFLUSHSEG32_128LINES
 456         SWFLUSHSEG32_128LINES
 457         SWFLUSHSEG32_128LINES
 458         SWFLUSHSEG32_128LINES
 459         SWFLUSHSEG32_128LINES
 460         SWFLUSHSEG32_128LINES
 461         SWFLUSHSEG32_128LINES
 462         SWFLUSHSEG32_128LINES
 463         SWFLUSHSEG32_128LINES
 464         SWFLUSHSEG32_128LINES
 465         SWFLUSHSEG32_128LINES
 466         SWFLUSHSEG32_128LINES
 467         SWFLUSHSEG32_128LINES
 468 
 469         jmpl    %l4 + 0x8, %g0
 470         nop
 471 
 472         .align 4
 473         .globl C_LABEL(sun4c_pgflush_hw64KB16B)
 474         .globl C_LABEL(sun4c_pgflush_hw64KB32B)
 475 
 476         /* Flush a page using hardware assisted flushes
 477          * for a cache of size 64KB with 16B or 32B lines.
 478          */
 479 C_LABEL(sun4c_pgflush_hw64KB16B):
 480 C_LABEL(sun4c_pgflush_hw64KB32B):
 481         /* Easiest flush possible on sun4c */
 482         jmpl    %l4 + 0x8, %g0
 483         sta     %g0, [%l2] ASI_HWFLUSHPAGE
 484 
 485         .globl  C_LABEL(sun4c_pgflush_sw64KB16B)
 486         /* Flush a page using software flushes for a cache
 487          * of size 64KB with 16B lines.
 488          */
 489 C_LABEL(sun4c_pgflush_sw64KB16B):
 490         /* Flush every line within the page */
 491 #define SWFLUSHPG16_2LINES \
 492         sta     %g0, [%l7] ASI_FLUSHPG; \
 493         add     %l7, 0x10, %l7; \
 494         sta     %g0, [%l7] ASI_FLUSHPG; \
 495         add     %l7, 0x10, %l7; \
 496 
 497 #define SWFLUSHPG16_4LINES \
 498         SWFLUSHPG16_2LINES \
 499         SWFLUSHPG16_2LINES \
 500 
 501 #define SWFLUSHPG16_8LINES \
 502         SWFLUSHPG16_4LINES \
 503         SWFLUSHPG16_4LINES \
 504 
 505 #define SWFLUSHPG16_16LINES \
 506         SWFLUSHPG16_8LINES \
 507         SWFLUSHPG16_8LINES \
 508 
 509 #define SWFLUSHPG16_32LINES \
 510         SWFLUSHPG16_16LINES \
 511         SWFLUSHPG16_16LINES \
 512 
 513 #define SWFLUSHPG16_64LINES \
 514         SWFLUSHPG16_32LINES \
 515         SWFLUSHPG16_32LINES \
 516 
 517 #define SWFLUSHPG16_128LINES \
 518         SWFLUSHPG16_64LINES \
 519         SWFLUSHPG16_64LINES \
 520 
 521 #define SWFLUSHPG16_256LINES \
 522         SWFLUSHPG16_128LINES \
 523         SWFLUSHPG16_128LINES \
 524 
 525         or      %l2, %g0, %l7           /* Base address of page */
 526         SWFLUSHPG16_256LINES
 527 
 528         /* Return to caller and flush last line */
 529         jmpl    %l4 + 0x8, %g0
 530         nop
 531 
 532         .globl  C_LABEL(sun4c_pgflush_sw64KB32B)
 533         /* Flush a page using software flushes for a cache
 534          * of size 64KB with 32B lines.
 535          */
 536 C_LABEL(sun4c_pgflush_sw64KB32B):
 537         /* Flush every line within the page */
 538 #define SWFLUSHPG32_2LINES \
 539         sta     %g0, [%l7] ASI_FLUSHPG; \
 540         add     %l7, 0x20, %l7; \
 541         sta     %g0, [%l7] ASI_FLUSHPG; \
 542         add     %l7, 0x20, %l7; \
 543 
 544 #define SWFLUSHPG32_4LINES \
 545         SWFLUSHPG32_2LINES \
 546         SWFLUSHPG32_2LINES \
 547 
 548 #define SWFLUSHPG32_8LINES \
 549         SWFLUSHPG32_4LINES \
 550         SWFLUSHPG32_4LINES \
 551 
 552 #define SWFLUSHPG32_16LINES \
 553         SWFLUSHPG32_8LINES \
 554         SWFLUSHPG32_8LINES \
 555 
 556 #define SWFLUSHPG32_32LINES \
 557         SWFLUSHPG32_16LINES \
 558         SWFLUSHPG32_16LINES \
 559 
 560 #define SWFLUSHPG32_64LINES \
 561         SWFLUSHPG32_32LINES \
 562         SWFLUSHPG32_32LINES \
 563 
 564 #define SWFLUSHPG32_128LINES \
 565         SWFLUSHPG32_64LINES \
 566         SWFLUSHPG32_64LINES \
 567 
 568         or      %l2, %g0, %l7           /* Base address of page */
 569         SWFLUSHPG32_128LINES
 570 
 571         /* Return to caller and flush last line */
 572         jmpl    %l4 + 0x8, %g0
 573         nop
 574 
 575 /* All that crap just to flush a fucking virtual cache, sheesh... */

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