From 822ec0b7528b9f53518edd6170c4196ddafaf320 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 22 Oct 2023 14:31:39 +0200 Subject: parisc: Implement PDC_PAT_PD_GET_ADDR_MAP Implemented for memory only for now... Signed-off-by: Helge Deller --- src/parisc/parisc.c | 16 ++++++++++++++++ src/parisc/pdcpat.h | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index 10cf5ac..ab7ff62 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -2045,8 +2045,24 @@ static int pdc_pat_pd(unsigned int *arg) { unsigned long option = ARG1; unsigned long *result = (unsigned long *)ARG2; + struct pdc_pat_pd_addr_map_entry *mem_table = (void *)ARG3; + unsigned long count = ARG4; + unsigned long offset = ARG5; switch (option) { + case PDC_PAT_PD_GET_ADDR_MAP: + if (count < sizeof(*mem_table) || offset != 0) + return PDC_INVALID_ARG; + memset(mem_table, 0, sizeof(*mem_table)); + mem_table->entry_type = PAT_MEMORY_DESCRIPTOR; + mem_table->memory_type = PAT_MEMTYPE_MEMORY; + mem_table->memory_usage = PAT_MEMUSE_GENERAL; /* ?? */ + mem_table->paddr = 0; /* note: 64bit! */ + mem_table->pages = ram_size / 4096; /* Length in 4K pages */ + mem_table->cell_map = 0; + result[0] = sizeof(*mem_table); + return PDC_OK; + case PDC_PAT_PD_GET_PDC_INTERF_REV: result[0] = 5; // legacy_rev result[1] = 6; // pat_rev diff --git a/src/parisc/pdcpat.h b/src/parisc/pdcpat.h index 57eb122..1c1a62e 100644 --- a/src/parisc/pdcpat.h +++ b/src/parisc/pdcpat.h @@ -280,10 +280,10 @@ struct pdc_pat_pd_addr_map_entry { unsigned char reserve1[5]; unsigned char memory_type; unsigned char memory_usage; - unsigned long paddr; + unsigned long long paddr; /* note: 64bit! */ unsigned int pages; /* Length in 4K pages */ unsigned int reserve2; - unsigned long cell_map; + unsigned long long cell_map; /* note: 64bit! */ }; /******************************************************************** -- cgit v1.1