1/* $Id: swift.S,v 1.1.1.1 2008/10/15 03:26:19 james26_jang Exp $
2 * swift.S: MicroSparc-II mmu/cache operations.
3 *
4 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
5 */
6
7#include <linux/config.h>
8#include <asm/psr.h>
9#include <asm/asi.h>
10#include <asm/page.h>
11#include <asm/pgtsrmmu.h>
12#include <asm/asm_offsets.h>
13
14	.text
15	.align	4
16
17	.globl	swift_flush_cache_all, swift_flush_cache_mm
18	.globl	swift_flush_cache_range, swift_flush_cache_page
19	.globl	swift_flush_page_for_dma
20	.globl	swift_flush_page_to_ram
21
22swift_flush_cache_all:
23swift_flush_cache_mm:
24swift_flush_cache_range:
25swift_flush_cache_page:
26swift_flush_page_for_dma:
27swift_flush_page_to_ram:
28	sethi	%hi(0x2000), %o0
291:	subcc	%o0, 0x10, %o0
30	add	%o0, %o0, %o1
31	sta	%g0, [%o0] ASI_M_DATAC_TAG
32	bne	1b
33	 sta	%g0, [%o1] ASI_M_TXTC_TAG
34	retl
35	 nop
36
37	.globl	swift_flush_sig_insns
38swift_flush_sig_insns:
39	flush	%o1
40	retl
41	 flush	%o1 + 4
42
43	.globl	swift_flush_tlb_mm
44	.globl	swift_flush_tlb_range
45	.globl	swift_flush_tlb_all
46swift_flush_tlb_mm:
47swift_flush_tlb_range:
48	ld	[%o0 + AOFF_mm_context], %g2
49	cmp	%g2, -1
50	be	swift_flush_tlb_all_out
51swift_flush_tlb_all:
52	mov	0x400, %o1
53	sta	%g0, [%o1] ASI_M_FLUSH_PROBE
54swift_flush_tlb_all_out:
55	retl
56	 nop
57
58	.globl	swift_flush_tlb_page
59swift_flush_tlb_page:
60	ld	[%o0 + 0x00], %o0
61	mov	SRMMU_CTX_REG, %g1
62	ld	[%o0 + AOFF_mm_context], %o3
63	andn	%o1, (PAGE_SIZE - 1), %o1
64	cmp	%o3, -1
65	be	swift_flush_tlb_page_out
66	 nop
67	mov	0x400, %o1
68	sta	%g0, [%o1] ASI_M_FLUSH_PROBE
69swift_flush_tlb_page_out:
70	retl
71	 nop
72