Skip to content

Commit

Permalink
tools: jailhouse-cell-linux: Add support for pio_regions
Browse files Browse the repository at this point in the history
We will need to parse pio_regions in the future.

Signed-off-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
rralf authored and jan-kiszka committed Jul 29, 2019
1 parent 6adfa0a commit ded106d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/jailhouse-cell-linux
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,15 @@ class Irqchip:
return self.address == 0xfec00000


class PIORegion:
_REGION_FORMAT = 'HH'
SIZE = struct.calcsize(_REGION_FORMAT)

def __init__(self, pio_struct):
(self.base, self.length) = struct.unpack_from(self._REGION_FORMAT, \
pio_struct)


class Config:
_HEADER_FORMAT = '6sH32s4xIIIIIIIIIQ8x32x'
_HEADER_REVISION = 11
Expand Down Expand Up @@ -609,6 +618,12 @@ class Config:
Irqchip(self.data[irqchip_offs:]))
irqchip_offs += Irqchip.SIZE

pioregion_offs = irqchip_offs
self.pio_regions = []
for n in range(self.num_pio_regions):
self.pio_regions.append(PIORegion(self.data[pioregion_offs:]))
pioregion_offs += PIORegion.SIZE


# see linux/Documentation/x86/boot.txt
class X86SetupHeader:
Expand Down

0 comments on commit ded106d

Please sign in to comment.