1129198Scognet/*	$NetBSD: cpufunc_asm_armv4.S,v 1.1 2001/11/10 23:14:09 thorpej Exp $	*/
2129198Scognet
3139735Simp/*-
4129198Scognet * Copyright (c) 2001 ARM Limited
5129198Scognet * Copyright (c) 1997,1998 Mark Brinicombe.
6129198Scognet * Copyright (c) 1997 Causality Limited
7129198Scognet * All rights reserved.
8129198Scognet *
9129198Scognet * Redistribution and use in source and binary forms, with or without
10129198Scognet * modification, are permitted provided that the following conditions
11129198Scognet * are met:
12129198Scognet * 1. Redistributions of source code must retain the above copyright
13129198Scognet *    notice, this list of conditions and the following disclaimer.
14129198Scognet * 2. Redistributions in binary form must reproduce the above copyright
15129198Scognet *    notice, this list of conditions and the following disclaimer in the
16129198Scognet *    documentation and/or other materials provided with the distribution.
17129198Scognet * 3. All advertising materials mentioning features or use of this software
18129198Scognet *    must display the following acknowledgement:
19129198Scognet *	This product includes software developed by Causality Limited.
20129198Scognet * 4. The name of Causality Limited may not be used to endorse or promote
21129198Scognet *    products derived from this software without specific prior written
22129198Scognet *    permission.
23129198Scognet *
24129198Scognet * THIS SOFTWARE IS PROVIDED BY CAUSALITY LIMITED ``AS IS'' AND ANY EXPRESS
25129198Scognet * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26129198Scognet * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27129198Scognet * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED BE LIABLE FOR ANY DIRECT,
28129198Scognet * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29129198Scognet * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30129198Scognet * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34129198Scognet * SUCH DAMAGE.
35129198Scognet *
36129198Scognet * ARM9 assembly functions for CPU / MMU / TLB specific operations
37129198Scognet *
38129198Scognet */
39236991Simp
40129198Scognet#include <machine/asm.h>
41129198Scognet__FBSDID("$FreeBSD$");
42129198Scognet
43129198Scognet/*
44129198Scognet * TLB functions
45129198Scognet */
46129198ScognetENTRY(armv4_tlb_flushID)
47129198Scognet	mcr	p15, 0, r0, c8, c7, 0	/* flush I+D tlb */
48137463Scognet	RET
49248361SandrewEND(armv4_tlb_flushID)
50129198Scognet
51129198ScognetENTRY(armv4_tlb_flushD)
52129198Scognet	mcr	p15, 0, r0, c8, c6, 0	/* flush D tlb */
53137463Scognet	RET
54248361SandrewEND(armv4_tlb_flushD)
55129198Scognet
56129198ScognetENTRY(armv4_tlb_flushD_SE)
57129198Scognet	mcr	p15, 0, r0, c8, c6, 1	/* flush D tlb single entry */
58137463Scognet	RET
59248361SandrewEND(armv4_tlb_flushD_SE)
60129198Scognet
61129198Scognet/*
62129198Scognet * Other functions
63129198Scognet */
64129198ScognetENTRY(armv4_drain_writebuf)
65129198Scognet	mcr	p15, 0, r0, c7, c10, 4	/* drain write buffer */
66137463Scognet	RET
67248361SandrewEND(armv4_drain_writebuf)
68248361Sandrew
69262420SianENTRY(armv4_idcache_inv_all)
70262420Sian	mov	r0, #0
71262420Sian	mcr	p15, 0, r0, c7, c7, 0	/* invalidate all I+D cache */
72262420Sian	RET
73262420SianEND(armv4_drain_writebuf)
74262420Sian
75