added my Recipes
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
From 592c915df252932961a4151c891da58c48a8db90 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 2 Mar 2023 18:47:40 -0800
|
||||
Subject: [PATCH] Define CARD32 as uint as it is 32-bit
|
||||
|
||||
long can be 64bit on LP64 systems and none of systems we support need int < 32-bits
|
||||
therefore use NUM32 to be int always if the system is linux
|
||||
|
||||
Fixes build with clang-16
|
||||
thunk.c:147:3: error: incompatible function pointer types initializing 'x86emuu32 (*)(X86EMU_pioAddr)' (aka 'unsigned int (*)(unsigned short)') with an expression of type 'unsigned long (*)(unsigned short)' [-Wincompatible-function-pointer-types]
|
||||
(&x_inl),
|
||||
^~~~~~~~
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
x86emu/include/xf86int10.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/x86emu/include/xf86int10.h
|
||||
+++ b/x86emu/include/xf86int10.h
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#define CARD8 unsigned char
|
||||
#define CARD16 unsigned short
|
||||
-#define CARD32 unsigned long
|
||||
+#define CARD32 unsigned int
|
||||
#define pointer void *
|
||||
#define IOADDRESS void *
|
||||
#define Bool int
|
||||
--- a/x86emu/include/types.h
|
||||
+++ b/x86emu/include/types.h
|
||||
@@ -77,7 +77,8 @@
|
||||
defined(__s390x__) || \
|
||||
(defined(__hppa__) && defined(__LP64)) || \
|
||||
defined(__amd64__) || defined(amd64) || \
|
||||
- (defined(__sgi) && (_MIPS_SZLONG == 64))
|
||||
+ (defined(__sgi) && (_MIPS_SZLONG == 64)) || \
|
||||
+ defined(__linux__)
|
||||
#define NUM32 int
|
||||
#else
|
||||
#define NUM32 long
|
||||
@@ -0,0 +1,33 @@
|
||||
From c782e208021409e9b78acb2200abd4319072e78a Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 2 Sep 2022 00:28:05 -0700
|
||||
Subject: [PATCH] Fix type of the void pointer assignment
|
||||
|
||||
Fixes build with clang
|
||||
|
||||
x86-common.c:216:9: error: incompatible integer to pointer conversion assigning to 'void *' from 'long' [-Wint-conversion]
|
||||
offset = mem_info.offset - REAL_MEM_BASE;
|
||||
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
x86-common.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/x86-common.c b/x86-common.c
|
||||
index 137bc3c..6f737ed 100644
|
||||
--- a/x86-common.c
|
||||
+++ b/x86-common.c
|
||||
@@ -213,7 +213,7 @@ void *LRMI_common_init(int high_page)
|
||||
if (!real_mem_init(high_page))
|
||||
return NULL;
|
||||
|
||||
- offset = mem_info.offset - REAL_MEM_BASE;
|
||||
+ offset = (void*)(mem_info.offset - REAL_MEM_BASE);
|
||||
|
||||
/*
|
||||
Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502)
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
assume zero is valid address
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Roy Li <rongqing.li@windriver.com>
|
||||
---
|
||||
thunk.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/thunk.c b/thunk.c
|
||||
index 796e88b..6121ea1 100644
|
||||
--- a/thunk.c
|
||||
+++ b/thunk.c
|
||||
@@ -141,9 +141,6 @@ int LRMI_init() {
|
||||
|
||||
mmap_addr = LRMI_common_init(1);
|
||||
|
||||
- if (!mmap_addr)
|
||||
- return 0;
|
||||
-
|
||||
X86EMU_pioFuncs pioFuncs = {
|
||||
(&x_inb),
|
||||
(&x_inw),
|
||||
--
|
||||
1.9.1
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
Upstream-Statue: Pending
|
||||
[from ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/l/libx86-1.1-21.fc23.src.rpm]
|
||||
|
||||
diff -ur libx86-1.1/lrmi.c libx86-1.1.hack/lrmi.c
|
||||
--- libx86-1.1/lrmi.c 2006-10-30 15:10:16.000000000 -0500
|
||||
+++ libx86-1.1.hack/lrmi.c 2009-10-26 15:55:42.000000000 -0400
|
||||
@@ -136,7 +136,7 @@
|
||||
if (context.ready)
|
||||
return 1;
|
||||
|
||||
- if (!LRMI_common_init())
|
||||
+ if (!LRMI_common_init(0))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
diff -ur libx86-1.1/thunk.c libx86-1.1.hack/thunk.c
|
||||
--- libx86-1.1/thunk.c 2008-04-02 20:48:00.000000000 -0400
|
||||
+++ libx86-1.1.hack/thunk.c 2009-10-26 16:05:39.000000000 -0400
|
||||
@@ -139,11 +139,11 @@
|
||||
int i;
|
||||
X86EMU_intrFuncs intFuncs[256];
|
||||
|
||||
- if (!LRMI_common_init())
|
||||
+ mmap_addr = LRMI_common_init(1);
|
||||
+
|
||||
+ if (!mmap_addr)
|
||||
return 0;
|
||||
|
||||
- mmap_addr = 0;
|
||||
-
|
||||
X86EMU_pioFuncs pioFuncs = {
|
||||
(&x_inb),
|
||||
(&x_inw),
|
||||
@@ -169,10 +169,10 @@
|
||||
X86_ESP = 0xFFF9;
|
||||
memset (stack, 0, 64*1024);
|
||||
|
||||
- *((char *)0) = 0x4f; /* Make sure that we end up jumping back to a
|
||||
- halt instruction */
|
||||
+ *mmap_addr = 0x4f; /* Make sure that we end up jumping back to a
|
||||
+ halt instruction */
|
||||
|
||||
- M.mem_base = 0;
|
||||
+ M.mem_base = (unsigned long)mmap_addr;
|
||||
M.mem_size = 1024*1024;
|
||||
|
||||
return 1;
|
||||
diff -ur libx86-1.1/x86-common.c libx86-1.1.hack/x86-common.c
|
||||
--- libx86-1.1/x86-common.c 2008-05-16 12:56:23.000000000 -0400
|
||||
+++ libx86-1.1.hack/x86-common.c 2009-10-26 16:03:21.000000000 -0400
|
||||
@@ -45,14 +45,15 @@
|
||||
static struct {
|
||||
int ready;
|
||||
int count;
|
||||
+ void *offset;
|
||||
struct mem_block blocks[REAL_MEM_BLOCKS];
|
||||
} mem_info = { 0 };
|
||||
|
||||
static int
|
||||
-real_mem_init(void)
|
||||
+real_mem_init(int high_page)
|
||||
{
|
||||
void *m;
|
||||
- int fd_zero;
|
||||
+ int fd_zero, flags = MAP_SHARED;
|
||||
|
||||
if (mem_info.ready)
|
||||
return 1;
|
||||
@@ -63,9 +64,12 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ if (!high_page)
|
||||
+ flags |= MAP_FIXED;
|
||||
+
|
||||
m = mmap((void *)REAL_MEM_BASE, REAL_MEM_SIZE,
|
||||
- PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
- MAP_FIXED | MAP_SHARED, fd_zero, 0);
|
||||
+ PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
+ flags, fd_zero, 0);
|
||||
|
||||
if (m == (void *)-1) {
|
||||
perror("mmap /dev/zero");
|
||||
@@ -76,6 +80,7 @@
|
||||
close(fd_zero);
|
||||
|
||||
mem_info.ready = 1;
|
||||
+ mem_info.offset = m;
|
||||
mem_info.count = 1;
|
||||
mem_info.blocks[0].size = REAL_MEM_SIZE;
|
||||
mem_info.blocks[0].free = 1;
|
||||
@@ -87,7 +92,7 @@
|
||||
real_mem_deinit(void)
|
||||
{
|
||||
if (mem_info.ready) {
|
||||
- munmap((void *)REAL_MEM_BASE, REAL_MEM_SIZE);
|
||||
+ munmap(mem_info.offset, REAL_MEM_SIZE);
|
||||
mem_info.ready = 0;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +124,7 @@
|
||||
LRMI_alloc_real(int size)
|
||||
{
|
||||
int i;
|
||||
- char *r = (char *)REAL_MEM_BASE;
|
||||
+ char *r = (char *)mem_info.offset;
|
||||
|
||||
if (!mem_info.ready)
|
||||
return NULL;
|
||||
@@ -151,7 +156,7 @@
|
||||
LRMI_free_real(void *m)
|
||||
{
|
||||
int i;
|
||||
- char *r = (char *)REAL_MEM_BASE;
|
||||
+ char *r = (char *)mem_info.offset;
|
||||
|
||||
if (!mem_info.ready)
|
||||
return;
|
||||
@@ -200,13 +205,15 @@
|
||||
return *(unsigned short *)(i * 4);
|
||||
}
|
||||
|
||||
-int LRMI_common_init(void)
|
||||
+void *LRMI_common_init(int high_page)
|
||||
{
|
||||
- void *m;
|
||||
+ void *m, *offset;
|
||||
int fd_mem;
|
||||
|
||||
- if (!real_mem_init())
|
||||
- return 0;
|
||||
+ if (!real_mem_init(high_page))
|
||||
+ return NULL;
|
||||
+
|
||||
+ offset = mem_info.offset - REAL_MEM_BASE;
|
||||
|
||||
/*
|
||||
Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502)
|
||||
@@ -217,33 +224,33 @@
|
||||
if (fd_mem == -1) {
|
||||
real_mem_deinit();
|
||||
perror("open /dev/mem");
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
- m = mmap((void *)0, 0x502,
|
||||
- PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
- MAP_FIXED | MAP_SHARED, fd_mem, 0);
|
||||
+ m = mmap(offset, 0x502,
|
||||
+ PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
+ MAP_FIXED | MAP_SHARED, fd_mem, 0);
|
||||
|
||||
if (m == (void *)-1) {
|
||||
close(fd_mem);
|
||||
real_mem_deinit();
|
||||
perror("mmap /dev/mem");
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
- m = mmap((void *)0xa0000, 0x100000 - 0xa0000,
|
||||
+ m = mmap(offset+0xa0000, 0x100000 - 0xa0000,
|
||||
PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
MAP_FIXED | MAP_SHARED, fd_mem, 0xa0000);
|
||||
|
||||
if (m == (void *)-1) {
|
||||
- munmap((void *)0, 0x502);
|
||||
+ munmap(offset, 0x502);
|
||||
close(fd_mem);
|
||||
real_mem_deinit();
|
||||
perror("mmap /dev/mem");
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
close(fd_mem);
|
||||
|
||||
- return 1;
|
||||
+ return offset;
|
||||
}
|
||||
diff -ur libx86-1.1/x86-common.h libx86-1.1.hack/x86-common.h
|
||||
--- libx86-1.1/x86-common.h 2006-09-07 18:44:27.000000000 -0400
|
||||
+++ libx86-1.1.hack/x86-common.h 2009-10-26 16:01:19.000000000 -0400
|
||||
@@ -40,4 +40,4 @@
|
||||
|
||||
void *LRMI_alloc_real(int size);
|
||||
void LRMI_free_real(void *m);
|
||||
-int LRMI_common_init(void);
|
||||
+void *LRMI_common_init(int high_page);
|
||||
@@ -0,0 +1,17 @@
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 951b617..6d9b73d 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -22,7 +22,7 @@ static: $(OBJECTS)
|
||||
$(AR) cru libx86.a $(OBJECTS)
|
||||
|
||||
shared: $(OBJECTS)
|
||||
- $(CC) $(CFLAGS) -o libx86.so.1 -shared -Wl,-soname,libx86.so.1 $(OBJECTS)
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o libx86.so.1 -shared -Wl,-soname,libx86.so.1 $(OBJECTS)
|
||||
|
||||
objclean:
|
||||
$(MAKE) -C x86emu clean
|
||||
Reference in New Issue
Block a user