On 14/09/2021 21:23, Mark Cave-Ayland wrote:

On 12/09/2021 18:39, Philippe Mathieu-Daudé wrote:

On 9/12/21 9:49 AM, Mark Cave-Ayland wrote:
The declaration ROM is located at the top-most address of the standard slot
space.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk>
---
  hw/nubus/nubus-device.c  | 43 +++++++++++++++++++++++++++++++++++++++-
  include/hw/nubus/nubus.h |  5 +++++
  2 files changed, 47 insertions(+), 1 deletion(-)

+    /* Declaration ROM */

+        } else if (size > NUBUS_DECL_ROM_MAX_SIZE) {

I'd check for >= and define as (64 * KiB).

That's a good idea - I'll update this for the v2.

And in fact it looks like it is possible to embed multi-function MacOS drivers in the declaration ROM so I'll keep the > and increase the maximum size to 128K which should give plenty of breathing space for binary drivers.

+            error_setg(errp, "romfile \"%s\" too large (maximum size 64K)",
+                       nd->romfile);
+            g_free(path);
+            return;
+        }

diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h
index 87a97516c7..42f4c9dbb8 100644
--- a/include/hw/nubus/nubus.h
+++ b/include/hw/nubus/nubus.h
@@ -39,12 +39,17 @@ struct NubusBus {
      uint32_t slot_available_mask;
  };
+#define NUBUS_DECL_ROM_MAX_SIZE    0xffff


ATB,

Mark.

Reply via email to