smmu_v3_ptops.cc (14098:f4b9024d1a96) smmu_v3_ptops.cc (14100:6ef1220dc6da)
1/*
2 * Copyright (c) 2013, 2018-2019 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

117 case 1: return mask(39, 30);
118 case 2: return mask(39, 21);
119 case 3: return mask(39, 12);
120 default: panic("bad level %d", level);
121 }
122}
123
124unsigned
1/*
2 * Copyright (c) 2013, 2018-2019 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

117 case 1: return mask(39, 30);
118 case 2: return mask(39, 21);
119 case 3: return mask(39, 12);
120 default: panic("bad level %d", level);
121 }
122}
123
124unsigned
125V7LPageTableOps::firstLevel() const
125V7LPageTableOps::firstLevel(uint8_t tsz) const
126{
127 return 1;
128}
129
130unsigned
131V7LPageTableOps::lastLevel() const
132{
133 return 3;

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

211 case 1: return mask(47, 30);
212 case 2: return mask(47, 21);
213 case 3: return mask(47, 12);
214 default: panic("bad level %d", level);
215 }
216}
217
218unsigned
126{
127 return 1;
128}
129
130unsigned
131V7LPageTableOps::lastLevel() const
132{
133 return 3;

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

211 case 1: return mask(47, 30);
212 case 2: return mask(47, 21);
213 case 3: return mask(47, 12);
214 default: panic("bad level %d", level);
215 }
216}
217
218unsigned
219V8PageTableOps4k::firstLevel() const
219V8PageTableOps4k::firstLevel(uint8_t tsz) const
220{
220{
221 return 0;
221 if (tsz >= 16 && tsz <= 24) return 0;
222 if (tsz >= 25 && tsz <= 33) return 1;
223 if (tsz >= 34 && tsz <= 39) return 2;
224
225 panic("Unsupported TnSZ: %d\n", tsz);
222}
223
224unsigned
225V8PageTableOps4k::lastLevel() const
226{
227 return 3;
228}
229

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

307 case 1: return ~mask(36);
308 case 2: return ~mask(25);
309 case 3: return ~mask(14);
310 default: panic("bad level %d", level);
311 }
312}
313
314unsigned
226}
227
228unsigned
229V8PageTableOps4k::lastLevel() const
230{
231 return 3;
232}
233

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

311 case 1: return ~mask(36);
312 case 2: return ~mask(25);
313 case 3: return ~mask(14);
314 default: panic("bad level %d", level);
315 }
316}
317
318unsigned
315V8PageTableOps16k::firstLevel() const
319V8PageTableOps16k::firstLevel(uint8_t tsz) const
316{
320{
317 return 0;
321 if (tsz == 16) return 0;
322 if (tsz >= 17 && tsz <= 27) return 1;
323 if (tsz >= 28 && tsz <= 38) return 2;
324 if (tsz == 39) return 3;
325
326 panic("Unsupported TnSZ: %d\n", tsz);
318}
319
320unsigned
321V8PageTableOps16k::lastLevel() const
322{
323 return 3;
324}
325

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

395 case 1: return mask(47, 42);
396 case 2: return mask(47, 29);
397 case 3: return mask(47, 16);
398 default: panic("bad level %d", level);
399 }
400}
401
402unsigned
327}
328
329unsigned
330V8PageTableOps16k::lastLevel() const
331{
332 return 3;
333}
334

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

404 case 1: return mask(47, 42);
405 case 2: return mask(47, 29);
406 case 3: return mask(47, 16);
407 default: panic("bad level %d", level);
408 }
409}
410
411unsigned
403V8PageTableOps64k::firstLevel() const
412V8PageTableOps64k::firstLevel(uint8_t tsz) const
404{
413{
405 return 1;
414 if (tsz >= 12 && tsz <= 21) return 1;
415 if (tsz >= 22 && tsz <= 34) return 2;
416 if (tsz >= 35 && tsz <= 39) return 3;
417
418 panic("Unsupported TnSZ: %d\n", tsz);
406}
407
408unsigned
409V8PageTableOps64k::lastLevel() const
410{
411 return 3;
412}
419}
420
421unsigned
422V8PageTableOps64k::lastLevel() const
423{
424 return 3;
425}