parisc: Implement PDC_PAT_PD_GET_ADDR_MAP
Signed-off-by: Helge Deller <deller@gmx.de>
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 @@
{
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 @@
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! */
};
/********************************************************************