⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proll.patch

📁 qemu虚拟机代码
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
+	romvec = init_openprom_qemu(bb.nbanks, bb.bankv, hiphybas,+				    (void *)hw_idprom->cmdline, hw_idprom->boot_device, nographic);++	printk("Memory used: virt 0x%x:0x%x[%dK] iomap 0x%x:0x%x\n",+	    PROLBASE, (int)cmem.curp, ((unsigned) cmem.curp - PROLBASE)/1024,+	    (int)cio.start, (int)cio.curp);++	{+	    void (*entry)(const void *, int, int, int, int) = (void *) hw_idprom->load_addr;+		printk("Kernel loaded at 0x%x, size %dK, command line = '%s'\n",+		       *entry, hw_idprom->kernel_size/1024, hw_idprom->cmdline);+		entry(romvec, 0, 0, 0, 0);+	}++	mem_fini(&cmem);+	vcon_fini(&dp0);+}++/*+ * dvma_alloc over iommu_alloc.+ */+void *dvma_alloc(int size, unsigned int *pphys)+{+	return iommu_alloc(&ciommu, size, pphys);+}++/*+ */+void udelay(__attribute__((unused)) unsigned long usecs)+{+    // Qemu hardware is perfect and does not need any delays!+}++static void init_idprom()+{+	void *va_prom;++	if ((va_prom = map_io(PHYS_JJ_EEPROM, PHYS_JJ_EEPROM_SIZE)) == NULL) {+		printk("init_idprom: cannot map eeprom\n");+		fatal();+	}+	bcopy(va_prom + PHYS_JJ_IDPROM_OFF, idprom, IDPROM_SIZE);+	/*+	 * hw_idprom is not used anywhere.+	 * It's just as we hate to leave hanging pointers (I/O page here).+	 */+	hw_idprom = va_prom; +}+diff -ruN proll_18.orig/qemu/openprom.c proll-patch-15/qemu/openprom.c--- proll_18.orig/qemu/openprom.c	1970-01-01 00:00:00.000000000 +0000+++ proll-patch-15/qemu/openprom.c	2005-11-07 20:11:04.000000000 +0000@@ -0,0 +1,910 @@+/*+ * PROM interface support+ * Copyright 1996 The Australian National University.+ * Copyright 1996 Fujitsu Laboratories Limited+ * Copyright 1999 Pete A. Zaitcev+ * This software may be distributed under the terms of the Gnu+ * Public License version 2 or later+ */++#include <openprom.h>+#include <general.h>+#include <romlib.h>+#include <system.h>+#include <vconsole.h>+#include "phys_jj.h"++//#define DEBUG_OBP++#define PAGE_SIZE 4096++struct property {+	const char *name;+	const char *value;+	int length;+};++struct node {+	const struct property *properties;+	/* short */ const int sibling;+	/* short */ const int child;+};++static int obp_nextnode(int node);+static int obp_child(int node);+static int obp_proplen(int node, char *name);+static int obp_getprop(int node, char *name, char *val);+static int obp_setprop(int node, char *name, char *val, int len);+static const char *obp_nextprop(int node, char *name);++static char obp_idprom[IDPROM_SIZE];+static const struct property null_properties = { NULL, NULL, -1 };+static const int prop_true = -1;++static struct property propv_root[7];++static const struct property propv_root_templ[] = {+	{"name",	"SUNW,SparcStation-5", sizeof("SUNW,SparcStation-5") },+	{"idprom",	obp_idprom, IDPROM_SIZE},+	{"banner-name", "SparcStation", sizeof("SparcStation")},+	{"compatible",	"sun4m", 6},+};++static const int prop_iommu_reg[] = {+	0x0, 0x10000000, 0x00000300,+};+static const struct property propv_iommu[] = {+	{"name",	"iommu", sizeof("iommu")},+	{"reg",		(char*)&prop_iommu_reg[0], sizeof(prop_iommu_reg) },+	{NULL, NULL, -1}+};++static const int prop_sbus_ranges[] = {+	0x0, 0x0, 0x0, 0x30000000, 0x10000000,+	0x1, 0x0, 0x0, 0x40000000, 0x10000000,+	0x2, 0x0, 0x0, 0x50000000, 0x10000000,+	0x3, 0x0, 0x0, 0x60000000, 0x10000000,+	0x4, 0x0, 0x0, 0x70000000, 0x10000000,+};+static const struct property propv_sbus[] = {+	{"name",	"sbus", 5},+	{"ranges",	(char*)&prop_sbus_ranges[0], sizeof(prop_sbus_ranges)},+	{"device_type",	"hierarchical", sizeof("hierarchical") },+	{NULL, NULL, -1}+};++static const int prop_tcx_regs[] = {+	0x2, 0x00800000, 0x00100000,+	0x2, 0x02000000, 0x00000001,+	0x2, 0x04000000, 0x00800000,+	0x2, 0x06000000, 0x00800000,+	0x2, 0x0a000000, 0x00000001,+	0x2, 0x0c000000, 0x00000001,+	0x2, 0x0e000000, 0x00000001,+	0x2, 0x00700000, 0x00001000,+	0x2, 0x00200000, 0x00000004,+	0x2, 0x00300000, 0x0000081c,+	0x2, 0x00000000, 0x00010000,+	0x2, 0x00240000, 0x00000004,+	0x2, 0x00280000, 0x00000001,+};++#if 1	/* Zaitcev */+static const int pixfreq = 0x03dfd240;+static const int hbporch = 0xa0;+static const int vfreq = 0x3c;+#endif+#if 0	/* Kevin Boone - 70Hz refresh */+static const int pixfreq = 0x047868C0;+static const int hbporch = 0x90;+static const int vfreq = 0x46;+#endif++static const int vbporch = 0x1d;+static const int vsync = 0x6;+static const int hsync = 0x88;+static const int vfporch = 0x3;+static const int hfporch = 0x18;+static const int height = 0x300;+static const int width = 0x400;+static const int linebytes = 0x400;+static const int depth = 24;+static const int tcx_intr[] = { 5, 0 };+static const int tcx_interrupts = 5;+static const struct property propv_sbus_tcx[] = {+	{"name",	"SUNW,tcx", sizeof("SUNW,tcx")},+	{"vbporch",	(char*)&vbporch, sizeof(int)},+	{"hbporch",	(char*)&hbporch, sizeof(int)},+	{"vsync",	(char*)&vsync, sizeof(int)},+	{"hsync",	(char*)&hsync, sizeof(int)},+	{"vfporch",	(char*)&vfporch, sizeof(int)},+	{"hfporch",	(char*)&hfporch, sizeof(int)},+	{"pixfreq",	(char*)&pixfreq, sizeof(int)},+	{"vfreq",	(char*)&vfreq, sizeof(int)},+	{"height",	(char*)&height, sizeof(int)},+	{"width",	(char*)&width, sizeof(int)},+	{"linebytes",	(char*)&linebytes, sizeof(int)},+	{"depth",	(char*)&depth, sizeof(int)},+	{"reg",		(char*)&prop_tcx_regs[0], sizeof(prop_tcx_regs)},+	{"tcx-8-bit",	0, -1},+	{"intr",	(char*)&tcx_intr[0], sizeof(tcx_intr)},+	{"interrupts",	(char*)&tcx_interrupts, sizeof(tcx_interrupts)},+	{"device_type",	"display", sizeof("display")},+	{NULL, NULL, -1}+};++static const int prop_cs4231_reg[] = {+	0x3, 0x0C000000, 0x00000040+};+static const int cs4231_interrupts = 5;+static const int cs4231_intr[] = { 5, 0 };++static const struct property propv_sbus_cs4231[] = {+	{"name",	"SUNW,CS4231", sizeof("SUNW,CS4231") },+	{"intr",	(char*)&cs4231_intr[0], sizeof(cs4231_intr) },+	{"interrupts",  (char*)&cs4231_interrupts, sizeof(cs4231_interrupts) },	+	{"reg",		(char*)&prop_cs4231_reg[0], sizeof(prop_cs4231_reg) },+	{"device_type", "serial", sizeof("serial") },+	{"alias",	"audio", sizeof("audio") },+	{NULL, NULL, -1}+};++static const int cpu_nctx = NCTX_SWIFT;+static const int cpu_cache_line_size = 0x20;+static const int cpu_cache_nlines = 0x200;+static const struct property propv_cpu[] = {+	{"name",	"STP1012PGA", sizeof("STP1012PGA") },+	{"device_type",	"cpu", 4 },+	{"mmu-nctx",	(char*)&cpu_nctx, sizeof(int)},+	{"cache-line-size",	(char*)&cpu_cache_line_size, sizeof(int)},+	{"cache-nlines",	(char*)&cpu_cache_nlines, sizeof(int)},+	{NULL, NULL, -1}+};++static const int prop_obio_ranges[] = {+	0x0, 0x0, 0x0, 0x71000000, 0x01000000,+};+static const struct property propv_obio[] = {+	{"name",	"obio", 5 },+	{"ranges",	(char*)&prop_obio_ranges[0], sizeof(prop_obio_ranges) },+	{"device_type",	"hierarchical", sizeof("hierarchical") },+	{NULL, NULL, -1}+};++static const int prop_auxio_reg[] = {+	0x0, 0x00900000, 0x00000001,+};+static const struct property propv_obio_auxio[] = {+	{"name",	"auxio", sizeof("auxio") },+	{"reg",		(char*)&prop_auxio_reg[0], sizeof(prop_auxio_reg) },+	{NULL, NULL, -1}+};++static const int prop_int_reg[] = {+	0x0, 0x00e00000, 0x00000010,+	0x0, 0x00e10000, 0x00000010,+};+static const struct property propv_obio_int[] = {+	{"name",	"interrupt", sizeof("interrupt")},+	{"reg",		(char*)&prop_int_reg[0], sizeof(prop_int_reg) },+	{NULL, NULL, -1}+};++static const int prop_cnt_reg[] = {+	0x0, 0x00d00000, 0x00000010,+	0x0, 0x00d10000, 0x00000010,+};+static const struct property propv_obio_cnt[] = {+	{"name",	"counter", sizeof("counter")},+	{"reg",		(char*)&prop_cnt_reg[0], sizeof(prop_cnt_reg) },+	{NULL, NULL, -1}+};++static const int prop_eeprom_reg[] = {+	0x0, 0x00200000, 0x00002000,+};+static const struct property propv_obio_eep[] = {+	{"name",	"eeprom", sizeof("eeprom")},+	{"reg",		(char*)&prop_eeprom_reg[0], sizeof(prop_eeprom_reg) },+	{"model",	"mk48t08", sizeof("mk48t08")},+	{NULL, NULL, -1}+};++static const int prop_su_reg[] = {+	0x0, 0x003002f8, 0x00000008,+};+static const struct property propv_obio_su[] = {+	{"name",	"su", sizeof("su")},+	{"reg",		(char*)&prop_su_reg[0], sizeof(prop_su_reg) },+	{NULL, NULL, -1}+};++static const int prop_zs_intr[] = { 0x2c, 0x0 };+static const int prop_zs_reg[] = {+	0x0, 0x00000000, 0x00000008,+};+static void *prop_zs_addr;+static const int prop_zs_slave = 1;+static const struct property propv_obio_zs[] = {+	{"name",	"zs", sizeof("zs")},+	{"reg",		(char*)&prop_zs_reg[0], sizeof(prop_zs_reg) },+	{"slave",	(char*)&prop_zs_slave, sizeof(prop_zs_slave) },+	{"device_type", "serial", sizeof("serial") },+	{"intr",	(char*)&prop_zs_intr[0], sizeof(prop_zs_intr) },+	{"address",	(char*)&prop_zs_addr, sizeof(prop_zs_addr) },+	{"keyboard",	(char*)&prop_true, 0},+	{"mouse",	(char*)&prop_true, 0},+	{NULL, NULL, -1}+};++static const int prop_zs1_intr[] = { 0x2c, 0x0 };+static const int prop_zs1_reg[] = {+	0x0, 0x00100000, 0x00000008,+};+static void *prop_zs1_addr;+static const int prop_zs1_slave = 0;+static const struct property propv_obio_zs1[] = {+	{"name",	"zs", sizeof("zs")},+	{"reg",		(char*)&prop_zs1_reg[0], sizeof(prop_zs1_reg) },+	{"slave",	(char*)&prop_zs1_slave, sizeof(prop_zs1_slave) },+	{"device_type", "serial", sizeof("serial") },+	{"intr",	(char*)&prop_zs1_intr[0], sizeof(prop_zs1_intr) },+	{"address",	(char*)&prop_zs1_addr, sizeof(prop_zs1_addr) },+	{NULL, NULL, -1}+};++static const int prop_ledma_reg[] = {+	0x4, 0x08400010, 0x00000020,+};+static const int prop_ledma_burst = 0x3f;+static const struct property propv_sbus_ledma[] = {+	{"name",	"ledma", sizeof("ledma")},+	{"reg",		(char*)&prop_ledma_reg[0], sizeof(prop_ledma_reg) },+	{"burst-sizes",	(char*)&prop_ledma_burst, sizeof(int) },+	{NULL, NULL, -1}+};++static const int prop_le_reg[] = {+	0x4, 0x08c00000, 0x00000004,+};+static const int prop_le_busmaster_regval = 0x7;+static const int prop_le_intr[] = { 0x26, 0x0 };+static const struct property propv_sbus_ledma_le[] = {+	{"name",	"le", sizeof("le")},+	{"reg",		(char*)&prop_le_reg[0], sizeof(prop_le_reg) },+	{"busmaster-regval",	(char*)&prop_le_busmaster_regval, sizeof(int)},+	{"intr",	(char*)&prop_le_intr[0], sizeof(prop_le_intr) },+	{NULL, NULL, -1}+};++static const int prop_espdma_reg[] = {+	0x4, 0x08400000, 0x00000010,+};++static const struct property propv_sbus_espdma[] = {+	{"name",	"espdma", sizeof("espdma")}, +	{"reg",		(char*)&prop_espdma_reg[0], sizeof(prop_espdma_reg) },+	{NULL, NULL, -1}+};++static const int prop_esp_reg[] = {+	0x4, 0x08800000, 0x00000040,+};+static const int prop_esp_intr[] = { 0x24, 0x0 };+static const struct property propv_sbus_espdma_esp[] = {+	{"name",	"esp", sizeof("esp")},+	{"reg",		(char*)&prop_esp_reg[0], sizeof(prop_esp_reg) },+	{"intr",	(char*)&prop_esp_intr[0], sizeof(prop_esp_intr) },+	{NULL, NULL, -1}+};++static const int prop_bpp_reg[] = {+	0x4, 0x0c800000, 0x0000001c,+};+static const int prop_bpp_intr[] = { 0x33, 0x0 };+static const struct property propv_sbus_bpp[] = {+	{"name",	"SUNW,bpp", sizeof("SUNW,bpp")},+	{"reg",		(char*)&prop_bpp_reg[0], sizeof(prop_bpp_reg) },+	{"intr",	(char*)&prop_bpp_intr[0], sizeof(prop_bpp_intr) },+	{NULL, NULL, -1}+};++static const int prop_apc_reg[] = {+	0x4, 0x0a000000, 0x00000010,+};+static const struct property propv_sbus_apc[] = {+	{"name",	"xxxpower-management", sizeof("xxxpower-management")},+	{"reg",		(char*)&prop_apc_reg[0], sizeof(prop_apc_reg) },+	{NULL, NULL, -1}+};++static const int prop_fd_intr[] = { 0x2b, 0x0 };+static const int prop_fd_reg[] = {+	0x0, 0x00400000, 0x0000000f,+};+static const struct property propv_obio_fd[] = {+	{"name",	"SUNW,fdtwo", sizeof("SUNW,fdtwo")},+	{"reg",		(char*)&prop_fd_reg[0], sizeof(prop_fd_reg) },+	{"device_type", "block", sizeof("block") },+	{"intr",	(char*)&prop_fd_intr[0], sizeof(prop_fd_intr) },+	{NULL, NULL, -1}+};++static const int prop_pw_intr[] = { 0x22, 0x0 };+static const int prop_pw_reg[] = {+	0x0, 0x00910000, 0x00000001,+};+static const struct property propv_obio_pw[] = {+	{"name",	"power", sizeof("power")},+	{"reg",		(char*)&prop_pw_reg[0], sizeof(prop_pw_reg) },+	{"intr",	(char*)&prop_pw_intr[0], sizeof(prop_pw_intr) },+	{NULL, NULL, -1}+};++static const int prop_cf_reg[] = {+	0x0, 0x00800000, 0x00000001,+};+static const struct property propv_obio_cf[] = {+	{"name",	"slavioconfig", sizeof("slavioconfig")},+	{"reg",		(char*)&prop_cf_reg[0], sizeof(prop_cf_reg) },+	{NULL, NULL, -1}+};++static const struct property propv_options[] = {+	{"name",	"options", sizeof("options")},+	{"screen-#columns",	"80", sizeof("80")},+	{"screen-#rows",	"25", sizeof("25")},+	{"tpe-link-test?",	(char *)&prop_true, 0},+	{"ttya-mode",		"9600,8,n,1,-", sizeof("9600,8,n,1,-")},+	{"ttya-ignore-cd",	(char *)&prop_true, 0},+	{"ttya-rts-dtr-off",	0, -1},+	{"ttyb-mode",		"9600,8,n,1,-", sizeof("9600,8,n,1,-")},+	{"ttyb-ignore-cd",	(char *)&prop_true, 0},

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -