Skip to content

Commit 82c17ad

Browse files
committed
standalone_systests: drop dead hsv39.h fallback definitions
hsv39.h's HSV39_PageSize, TLBEntry64, hsv39_make_tlb_entry(), and hsv39_write_tlb_entry() were locally redefined when __HEXAGON_ARCH__ was 80 or earlier. But the only consumer of this header is hsv39_tlb.c, which is forced to build with -mv81 by CMakeLists.txt (the next commit). So the fallback was unreachable in practice. The fallbacks were also semantically wrong: the local TLBEntry64 omitted the HSV39:1 bit field that the toolchain's version sets, so even if reached the fallback would have produced incorrect TLB entries. Delete them. The toolchain's tlb.h provides the correct definitions when __HEXAGON_ARCH__ > 80. Keep pow4() — it is used directly by hsv39_tlb.c, not just by the deleted helpers. Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
1 parent d4f7faa commit 82c17ad

1 file changed

Lines changed: 0 additions & 58 deletions

File tree

standalone_systests/include/hsv39.h

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,64 +19,6 @@ static inline uint64_t pow4(uint64_t n)
1919
return 1ull << (n * 2);
2020
}
2121

22-
/* HSV39 page size enumeration - powers of 4 encoding */
23-
typedef enum {
24-
HSV39_PAGE_1M = 0x01,
25-
HSV39_PAGE_4M = 0x04,
26-
HSV39_PAGE_16M = 0x10,
27-
HSV39_PAGE_256M = 0x100,
28-
HSV39_PAGE_1G = 0x400,
29-
HSV39_PAGE_4G = 0x1000,
30-
HSV39_PAGE_16G = 0x4000,
31-
HSV39_PAGE_64G = 0x10000,
32-
} HSV39_PageSize;
33-
34-
/* Extended TLB entry for 64-bit addressing */
35-
typedef union {
36-
struct {
37-
uint64_t V:1; /* Valid bit */
38-
uint64_t G:1; /* Global bit */
39-
uint64_t ASID:7; /* Address Space ID */
40-
uint64_t VPN:28; /* Virtual Page Number */
41-
uint64_t U:1; /* User bit */
42-
uint64_t R:1; /* Read bit */
43-
uint64_t W:1; /* Write bit */
44-
uint64_t X:1; /* Execute bit */
45-
uint64_t C:3; /* Cache attributes */
46-
uint64_t PPN:36; /* Physical Page Number (36-bit) */
47-
uint64_t reserved:14;
48-
};
49-
uint64_t raw;
50-
} TLBEntry64;
51-
52-
/* HSV39 helper functions */
53-
static inline TLBEntry64 hsv39_make_tlb_entry(uint64_t va, uint64_t pa,
54-
HSV39_PageSize page_size,
55-
uint32_t xwru, uint32_t asid,
56-
bool G)
57-
{
58-
TLBEntry64 entry = {0};
59-
uint64_t page_mask = pow4(__builtin_ctzll(page_size)) * 1024 * 1024 - 1;
60-
61-
entry.V = 1;
62-
entry.G = G ? 1 : 0;
63-
entry.ASID = asid & 0x7f;
64-
entry.VPN = (va & ~page_mask) >> 12;
65-
entry.U = (xwru & 0x1) ? 1 : 0;
66-
entry.R = (xwru & 0x2) ? 1 : 0;
67-
entry.W = (xwru & 0x4) ? 1 : 0;
68-
entry.X = (xwru & 0x8) ? 1 : 0;
69-
entry.C = 0x3; /* Default cache attributes */
70-
entry.PPN = (pa & ~page_mask) >> 12;
71-
72-
return entry;
73-
}
74-
75-
static inline void hsv39_write_tlb_entry(uint64_t entry_raw, int index)
76-
{
77-
tlbw(entry_raw, index);
78-
}
79-
8022
static inline void remove_hsv39_trans(int index)
8123
{
8224
TLBEntry64 entry;

0 commit comments

Comments
 (0)