Deleted Added
full compact
slb.c (234652) slb.c (234745)
1/*-
2 * Copyright (c) 2010 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2010 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/powerpc/aim/slb.c 234652 2012-04-24 13:36:41Z nwhitehorn $
26 * $FreeBSD: head/sys/powerpc/aim/slb.c 234745 2012-04-28 00:12:23Z nwhitehorn $
27 */
28
29#include <sys/param.h>
30#include <sys/kernel.h>
31#include <sys/lock.h>
32#include <sys/mutex.h>
33#include <sys/proc.h>
34#include <sys/systm.h>

--- 99 unchanged lines hidden (view full) ---

134
135 retval = &child->u.slb_entries[idx];
136
137 /*
138 * The above stores must be visible before the next one, so
139 * that a lockless searcher always sees a valid path through
140 * the tree.
141 */
27 */
28
29#include <sys/param.h>
30#include <sys/kernel.h>
31#include <sys/lock.h>
32#include <sys/mutex.h>
33#include <sys/proc.h>
34#include <sys/systm.h>

--- 99 unchanged lines hidden (view full) ---

134
135 retval = &child->u.slb_entries[idx];
136
137 /*
138 * The above stores must be visible before the next one, so
139 * that a lockless searcher always sees a valid path through
140 * the tree.
141 */
142 powerpc_sync();
142 mb();
143
144 idx = esid2idx(esid, parent->ua_level);
145 parent->u.ua_child[idx] = child;
146 setbit(&parent->ua_alloc, idx);
147
148 return (retval);
149}
150

--- 31 unchanged lines hidden (view full) ---

182 KASSERT(inter != NULL, ("unhandled NULL case"));
183
184 /* Set up intermediate node to point to child ... */
185 inter->ua_level = level;
186 inter->ua_base = esid2base(esid, inter->ua_level);
187 idx = esid2idx(child->ua_base, inter->ua_level);
188 inter->u.ua_child[idx] = child;
189 setbit(&inter->ua_alloc, idx);
143
144 idx = esid2idx(esid, parent->ua_level);
145 parent->u.ua_child[idx] = child;
146 setbit(&parent->ua_alloc, idx);
147
148 return (retval);
149}
150

--- 31 unchanged lines hidden (view full) ---

182 KASSERT(inter != NULL, ("unhandled NULL case"));
183
184 /* Set up intermediate node to point to child ... */
185 inter->ua_level = level;
186 inter->ua_base = esid2base(esid, inter->ua_level);
187 idx = esid2idx(child->ua_base, inter->ua_level);
188 inter->u.ua_child[idx] = child;
189 setbit(&inter->ua_alloc, idx);
190 powerpc_sync();
190 mb();
191
192 /* Set up parent to point to intermediate node ... */
193 idx = esid2idx(inter->ua_base, parent->ua_level);
194 parent->u.ua_child[idx] = inter;
195 setbit(&parent->ua_alloc, idx);
196
197 return (inter);
198}

--- 343 unchanged lines hidden ---
191
192 /* Set up parent to point to intermediate node ... */
193 idx = esid2idx(inter->ua_base, parent->ua_level);
194 parent->u.ua_child[idx] = inter;
195 setbit(&parent->ua_alloc, idx);
196
197 return (inter);
198}

--- 343 unchanged lines hidden ---