aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-10-22 14:31:39 +0200
committerHelge Deller <deller@gmx.de>2023-10-22 14:31:39 +0200
commit822ec0b7528b9f53518edd6170c4196ddafaf320 (patch)
tree5923dd4a4b2f9fff4be8881462b0902fd4ebb1dc
parent2dcfdab01a5dd193fe127eda359629e8656cc3e8 (diff)
downloadseabios-hppa-822ec0b7528b9f53518edd6170c4196ddafaf320.zip
seabios-hppa-822ec0b7528b9f53518edd6170c4196ddafaf320.tar.gz
seabios-hppa-822ec0b7528b9f53518edd6170c4196ddafaf320.tar.bz2
parisc: Implement PDC_PAT_PD_GET_ADDR_MAP
Implemented for memory only for now... Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/parisc.c16
-rw-r--r--src/parisc/pdcpat.h4
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! */
};
/********************************************************************