4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #include <sys/promif.h>
27 #include <sys/promimpl.h>
30 * prom_itlb_load, prom_dtlb_load:
32 * Manage the Spitfire TLB. Returns 0 if successful, -1 otherwise.
33 * Flush the address in context zero mapped by tte_data and virt,
34 * and load the {i,d} tlb entry index with tte_data and virt.
38 prom_itlb_load(int index
, unsigned long long tte_data
, caddr_t virt
)
42 ihandle_t immu
= prom_mmu_ihandle();
44 if ((immu
== (ihandle_t
)-1))
47 ci
[0] = p1275_ptr2cell("call-method"); /* Service name */
48 ci
[1] = (cell_t
)5; /* #argument cells */
49 ci
[2] = (cell_t
)1; /* #result cells */
50 ci
[3] = p1275_ptr2cell("SUNW,itlb-load"); /* Arg1: method name */
51 ci
[4] = p1275_ihandle2cell(immu
); /* Arg2: mmu ihandle */
52 ci
[5] = p1275_ptr2cell(virt
); /* Arg3: SA1: virt */
53 ci
[6] = (cell_t
)tte_data
; /* Arg4: SA2: tte_data */
54 ci
[7] = p1275_int2cell(index
); /* Arg5: SA3: index */
57 rv
= p1275_cif_handler(&ci
);
62 if (ci
[8] != 0) /* Res1: Catch result */
68 prom_dtlb_load(int index
, unsigned long long tte_data
, caddr_t virt
)
72 ihandle_t immu
= prom_mmu_ihandle();
74 if ((immu
== (ihandle_t
)-1))
77 ci
[0] = p1275_ptr2cell("call-method"); /* Service name */
78 ci
[1] = (cell_t
)5; /* #argument cells */
79 ci
[2] = (cell_t
)1; /* #result cells */
80 ci
[3] = p1275_ptr2cell("SUNW,dtlb-load"); /* Arg1: method name */
81 ci
[4] = p1275_ihandle2cell(immu
); /* Arg2: mmu ihandle */
82 ci
[5] = p1275_ptr2cell(virt
); /* Arg3: SA1: virt */
83 ci
[6] = (cell_t
)tte_data
; /* Arg4: SA2: tte_data */
84 ci
[7] = p1275_int2cell(index
); /* Arg5: SA3: index */
87 rv
= p1275_cif_handler(&ci
);
92 if (ci
[8] != 0) /* Res1: Catch result */