xref: /openbsd/sys/arch/mips64/mips64/mips64r2.S (revision cb79e5ce)
1/*	$OpenBSD: mips64r2.S,v 1.4 2017/06/11 03:35:30 visa Exp $	*/
2
3/*
4 * Copyright (c) 2011 Miodrag Vallat.
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19/*
20 * Routines to access extra coprocessor 0 registers
21 */
22
23#include <machine/asm.h>
24#include <mips64/mips_cpu.h>
25
26	.set	noreorder
27	.set	mips64r2
28
29LEAF(cp0_get_config_1, 0)
30	j	ra
31	mfc0	v0, COP_0_CONFIG, 1
32END(cp0_get_config_1)
33
34LEAF(cp0_get_config_2, 0)
35	j	ra
36	mfc0	v0, COP_0_CONFIG, 2
37END(cp0_get_config_2)
38
39LEAF(cp0_get_config_3, 0)
40	j	ra
41	mfc0	v0, COP_0_CONFIG, 3
42END(cp0_get_config_3)
43
44LEAF(cp0_get_config_4, 0)
45	j	ra
46	mfc0	v0, COP_0_CONFIG, 4
47END(cp0_get_config_4)
48
49LEAF(cp0_get_pagegrain, 0)
50	j	ra
51	 mfc0	v0, COP_0_TLB_PG_GRAIN
52END(cp0_get_pagegrain)
53
54LEAF(cp0_set_pagegrain, 0)
55	mtc0	a0, COP_0_TLB_PG_GRAIN
56	jr.hb	ra
57	 nop
58END(cp0_set_pagegrain)
59