gic.cc (12184:3aabca509b7a) gic.cc (12515:e3d1a64d0260)
1/*
2 * Copyright (c) 2015-2017 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

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

300 DPRINTF(GIC, "copy cpu 0x%x 0x%08x\n", daddr, val);
301 to->writeCpu(ctx, daddr, val);
302}
303
304void
305MuxingKvmGic::copyBankedDistRange(BaseGicRegisters* from, BaseGicRegisters* to,
306 Addr daddr, size_t size)
307{
1/*
2 * Copyright (c) 2015-2017 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

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

300 DPRINTF(GIC, "copy cpu 0x%x 0x%08x\n", daddr, val);
301 to->writeCpu(ctx, daddr, val);
302}
303
304void
305MuxingKvmGic::copyBankedDistRange(BaseGicRegisters* from, BaseGicRegisters* to,
306 Addr daddr, size_t size)
307{
308 for (int ctx = 0; ctx < system._numContexts; ++ctx)
308 for (int ctx = 0; ctx < system.numContexts(); ++ctx)
309 for (auto a = daddr; a < daddr + size; a += 4)
310 copyDistRegister(from, to, ctx, a);
311}
312
313void
314MuxingKvmGic::clearBankedDistRange(BaseGicRegisters* to,
315 Addr daddr, size_t size)
316{
309 for (auto a = daddr; a < daddr + size; a += 4)
310 copyDistRegister(from, to, ctx, a);
311}
312
313void
314MuxingKvmGic::clearBankedDistRange(BaseGicRegisters* to,
315 Addr daddr, size_t size)
316{
317 for (int ctx = 0; ctx < system._numContexts; ++ctx)
317 for (int ctx = 0; ctx < system.numContexts(); ++ctx)
318 for (auto a = daddr; a < daddr + size; a += 4)
319 to->writeDistributor(ctx, a, 0xFFFFFFFF);
320}
321
322void
323MuxingKvmGic::copyDistRange(BaseGicRegisters* from, BaseGicRegisters* to,
324 Addr daddr, size_t size)
325{

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

340{
341 Addr set, clear;
342 size_t size;
343
344 /// CPU state (GICC_*)
345 // Copy CPU Interface Control Register (CTLR),
346 // Interrupt Priority Mask Register (PMR), and
347 // Binary Point Register (BPR)
318 for (auto a = daddr; a < daddr + size; a += 4)
319 to->writeDistributor(ctx, a, 0xFFFFFFFF);
320}
321
322void
323MuxingKvmGic::copyDistRange(BaseGicRegisters* from, BaseGicRegisters* to,
324 Addr daddr, size_t size)
325{

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

340{
341 Addr set, clear;
342 size_t size;
343
344 /// CPU state (GICC_*)
345 // Copy CPU Interface Control Register (CTLR),
346 // Interrupt Priority Mask Register (PMR), and
347 // Binary Point Register (BPR)
348 for (int ctx = 0; ctx < system._numContexts; ++ctx) {
348 for (int ctx = 0; ctx < system.numContexts(); ++ctx) {
349 copyCpuRegister(from, to, ctx, GICC_CTLR);
350 copyCpuRegister(from, to, ctx, GICC_PMR);
351 copyCpuRegister(from, to, ctx, GICC_BPR);
352 }
353
354
355 /// Distributor state (GICD_*)
356 // Copy Distributor Control Register (CTLR)

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

418MuxingKvmGic::fromKvmToPl390()
419{
420 copyGicState(kernelGic, static_cast<Pl390*>(this));
421
422 // the values read for the Interrupt Priority Mask Register (PMR)
423 // have been shifted by three bits due to its having been emulated by
424 // a VGIC with only 5 PMR bits in its VMCR register. Presently the
425 // Linux kernel does not repair this inaccuracy, so we correct it here.
349 copyCpuRegister(from, to, ctx, GICC_CTLR);
350 copyCpuRegister(from, to, ctx, GICC_PMR);
351 copyCpuRegister(from, to, ctx, GICC_BPR);
352 }
353
354
355 /// Distributor state (GICD_*)
356 // Copy Distributor Control Register (CTLR)

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

418MuxingKvmGic::fromKvmToPl390()
419{
420 copyGicState(kernelGic, static_cast<Pl390*>(this));
421
422 // the values read for the Interrupt Priority Mask Register (PMR)
423 // have been shifted by three bits due to its having been emulated by
424 // a VGIC with only 5 PMR bits in its VMCR register. Presently the
425 // Linux kernel does not repair this inaccuracy, so we correct it here.
426 for (int cpu = 0; cpu < system._numContexts; ++cpu) {
426 for (int cpu = 0; cpu < system.numContexts(); ++cpu) {
427 cpuPriority[cpu] <<= 3;
428 assert((cpuPriority[cpu] & ~0xff) == 0);
429 }
430}
431
432MuxingKvmGic *
433MuxingKvmGicParams::create()
434{
435 return new MuxingKvmGic(this);
436}
427 cpuPriority[cpu] <<= 3;
428 assert((cpuPriority[cpu] & ~0xff) == 0);
429 }
430}
431
432MuxingKvmGic *
433MuxingKvmGicParams::create()
434{
435 return new MuxingKvmGic(this);
436}