]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/dpdk/config/arm/armv8_machine.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / spdk / dpdk / config / arm / armv8_machine.py
1 #!/usr/bin/python
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2017 Cavium, Inc
4
5 ident = []
6 fname = '/sys/devices/system/cpu/cpu0/regs/identification/midr_el1'
7 with open(fname) as f:
8 content = f.read()
9
10 midr_el1 = (int(content.rstrip('\n'), 16))
11
12 ident.append(hex((midr_el1 >> 24) & 0xFF)) # Implementer
13 ident.append(hex((midr_el1 >> 20) & 0xF)) # Variant
14 ident.append(hex((midr_el1 >> 16) & 0XF)) # Architecture
15 ident.append(hex((midr_el1 >> 4) & 0xFFF)) # Primary Part number
16 ident.append(hex(midr_el1 & 0xF)) # Revision
17
18 print(' '.join(ident))