diff options
Diffstat (limited to 'meta-oe/recipes-extended')
3 files changed, 221 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-assume-zero-is-valid-address.patch b/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-assume-zero-is-valid-address.patch new file mode 100644 index 000000000..7a46301de --- /dev/null +++ b/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-assume-zero-is-valid-address.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | assume zero is valid address | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | thunk.c | 3 --- | ||
8 | 1 file changed, 3 deletions(-) | ||
9 | |||
10 | diff --git a/thunk.c b/thunk.c | ||
11 | index 796e88b..6121ea1 100644 | ||
12 | --- a/thunk.c | ||
13 | +++ b/thunk.c | ||
14 | @@ -141,9 +141,6 @@ int LRMI_init() { | ||
15 | |||
16 | mmap_addr = LRMI_common_init(1); | ||
17 | |||
18 | - if (!mmap_addr) | ||
19 | - return 0; | ||
20 | - | ||
21 | X86EMU_pioFuncs pioFuncs = { | ||
22 | (&x_inb), | ||
23 | (&x_inw), | ||
24 | -- | ||
25 | 1.9.1 | ||
26 | |||
diff --git a/meta-oe/recipes-extended/libx86-1/libx86-1.1/libx86-mmap-offset.patch b/meta-oe/recipes-extended/libx86-1/libx86-1.1/libx86-mmap-offset.patch new file mode 100644 index 000000000..843acc886 --- /dev/null +++ b/meta-oe/recipes-extended/libx86-1/libx86-1.1/libx86-mmap-offset.patch | |||
@@ -0,0 +1,190 @@ | |||
1 | Upstream-Statue: Pending | ||
2 | [from ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/l/libx86-1.1-21.fc23.src.rpm] | ||
3 | |||
4 | diff -ur libx86-1.1/lrmi.c libx86-1.1.hack/lrmi.c | ||
5 | --- libx86-1.1/lrmi.c 2006-10-30 15:10:16.000000000 -0500 | ||
6 | +++ libx86-1.1.hack/lrmi.c 2009-10-26 15:55:42.000000000 -0400 | ||
7 | @@ -136,7 +136,7 @@ | ||
8 | if (context.ready) | ||
9 | return 1; | ||
10 | |||
11 | - if (!LRMI_common_init()) | ||
12 | + if (!LRMI_common_init(0)) | ||
13 | return 0; | ||
14 | |||
15 | /* | ||
16 | diff -ur libx86-1.1/thunk.c libx86-1.1.hack/thunk.c | ||
17 | --- libx86-1.1/thunk.c 2008-04-02 20:48:00.000000000 -0400 | ||
18 | +++ libx86-1.1.hack/thunk.c 2009-10-26 16:05:39.000000000 -0400 | ||
19 | @@ -139,11 +139,11 @@ | ||
20 | int i; | ||
21 | X86EMU_intrFuncs intFuncs[256]; | ||
22 | |||
23 | - if (!LRMI_common_init()) | ||
24 | + mmap_addr = LRMI_common_init(1); | ||
25 | + | ||
26 | + if (!mmap_addr) | ||
27 | return 0; | ||
28 | |||
29 | - mmap_addr = 0; | ||
30 | - | ||
31 | X86EMU_pioFuncs pioFuncs = { | ||
32 | (&x_inb), | ||
33 | (&x_inw), | ||
34 | @@ -169,10 +169,10 @@ | ||
35 | X86_ESP = 0xFFF9; | ||
36 | memset (stack, 0, 64*1024); | ||
37 | |||
38 | - *((char *)0) = 0x4f; /* Make sure that we end up jumping back to a | ||
39 | - halt instruction */ | ||
40 | + *mmap_addr = 0x4f; /* Make sure that we end up jumping back to a | ||
41 | + halt instruction */ | ||
42 | |||
43 | - M.mem_base = 0; | ||
44 | + M.mem_base = (unsigned long)mmap_addr; | ||
45 | M.mem_size = 1024*1024; | ||
46 | |||
47 | return 1; | ||
48 | diff -ur libx86-1.1/x86-common.c libx86-1.1.hack/x86-common.c | ||
49 | --- libx86-1.1/x86-common.c 2008-05-16 12:56:23.000000000 -0400 | ||
50 | +++ libx86-1.1.hack/x86-common.c 2009-10-26 16:03:21.000000000 -0400 | ||
51 | @@ -45,14 +45,15 @@ | ||
52 | static struct { | ||
53 | int ready; | ||
54 | int count; | ||
55 | + void *offset; | ||
56 | struct mem_block blocks[REAL_MEM_BLOCKS]; | ||
57 | } mem_info = { 0 }; | ||
58 | |||
59 | static int | ||
60 | -real_mem_init(void) | ||
61 | +real_mem_init(int high_page) | ||
62 | { | ||
63 | void *m; | ||
64 | - int fd_zero; | ||
65 | + int fd_zero, flags = MAP_SHARED; | ||
66 | |||
67 | if (mem_info.ready) | ||
68 | return 1; | ||
69 | @@ -63,9 +64,12 @@ | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | + if (!high_page) | ||
74 | + flags |= MAP_FIXED; | ||
75 | + | ||
76 | m = mmap((void *)REAL_MEM_BASE, REAL_MEM_SIZE, | ||
77 | - PROT_READ | PROT_WRITE | PROT_EXEC, | ||
78 | - MAP_FIXED | MAP_SHARED, fd_zero, 0); | ||
79 | + PROT_READ | PROT_WRITE | PROT_EXEC, | ||
80 | + flags, fd_zero, 0); | ||
81 | |||
82 | if (m == (void *)-1) { | ||
83 | perror("mmap /dev/zero"); | ||
84 | @@ -76,6 +80,7 @@ | ||
85 | close(fd_zero); | ||
86 | |||
87 | mem_info.ready = 1; | ||
88 | + mem_info.offset = m; | ||
89 | mem_info.count = 1; | ||
90 | mem_info.blocks[0].size = REAL_MEM_SIZE; | ||
91 | mem_info.blocks[0].free = 1; | ||
92 | @@ -87,7 +92,7 @@ | ||
93 | real_mem_deinit(void) | ||
94 | { | ||
95 | if (mem_info.ready) { | ||
96 | - munmap((void *)REAL_MEM_BASE, REAL_MEM_SIZE); | ||
97 | + munmap(mem_info.offset, REAL_MEM_SIZE); | ||
98 | mem_info.ready = 0; | ||
99 | } | ||
100 | } | ||
101 | @@ -119,7 +124,7 @@ | ||
102 | LRMI_alloc_real(int size) | ||
103 | { | ||
104 | int i; | ||
105 | - char *r = (char *)REAL_MEM_BASE; | ||
106 | + char *r = (char *)mem_info.offset; | ||
107 | |||
108 | if (!mem_info.ready) | ||
109 | return NULL; | ||
110 | @@ -151,7 +156,7 @@ | ||
111 | LRMI_free_real(void *m) | ||
112 | { | ||
113 | int i; | ||
114 | - char *r = (char *)REAL_MEM_BASE; | ||
115 | + char *r = (char *)mem_info.offset; | ||
116 | |||
117 | if (!mem_info.ready) | ||
118 | return; | ||
119 | @@ -200,13 +205,15 @@ | ||
120 | return *(unsigned short *)(i * 4); | ||
121 | } | ||
122 | |||
123 | -int LRMI_common_init(void) | ||
124 | +void *LRMI_common_init(int high_page) | ||
125 | { | ||
126 | - void *m; | ||
127 | + void *m, *offset; | ||
128 | int fd_mem; | ||
129 | |||
130 | - if (!real_mem_init()) | ||
131 | - return 0; | ||
132 | + if (!real_mem_init(high_page)) | ||
133 | + return NULL; | ||
134 | + | ||
135 | + offset = mem_info.offset - REAL_MEM_BASE; | ||
136 | |||
137 | /* | ||
138 | Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502) | ||
139 | @@ -217,33 +224,33 @@ | ||
140 | if (fd_mem == -1) { | ||
141 | real_mem_deinit(); | ||
142 | perror("open /dev/mem"); | ||
143 | - return 0; | ||
144 | + return NULL; | ||
145 | } | ||
146 | |||
147 | - m = mmap((void *)0, 0x502, | ||
148 | - PROT_READ | PROT_WRITE | PROT_EXEC, | ||
149 | - MAP_FIXED | MAP_SHARED, fd_mem, 0); | ||
150 | + m = mmap(offset, 0x502, | ||
151 | + PROT_READ | PROT_WRITE | PROT_EXEC, | ||
152 | + MAP_FIXED | MAP_SHARED, fd_mem, 0); | ||
153 | |||
154 | if (m == (void *)-1) { | ||
155 | close(fd_mem); | ||
156 | real_mem_deinit(); | ||
157 | perror("mmap /dev/mem"); | ||
158 | - return 0; | ||
159 | + return NULL; | ||
160 | } | ||
161 | |||
162 | - m = mmap((void *)0xa0000, 0x100000 - 0xa0000, | ||
163 | + m = mmap(offset+0xa0000, 0x100000 - 0xa0000, | ||
164 | PROT_READ | PROT_WRITE | PROT_EXEC, | ||
165 | MAP_FIXED | MAP_SHARED, fd_mem, 0xa0000); | ||
166 | |||
167 | if (m == (void *)-1) { | ||
168 | - munmap((void *)0, 0x502); | ||
169 | + munmap(offset, 0x502); | ||
170 | close(fd_mem); | ||
171 | real_mem_deinit(); | ||
172 | perror("mmap /dev/mem"); | ||
173 | - return 0; | ||
174 | + return NULL; | ||
175 | } | ||
176 | |||
177 | close(fd_mem); | ||
178 | |||
179 | - return 1; | ||
180 | + return offset; | ||
181 | } | ||
182 | diff -ur libx86-1.1/x86-common.h libx86-1.1.hack/x86-common.h | ||
183 | --- libx86-1.1/x86-common.h 2006-09-07 18:44:27.000000000 -0400 | ||
184 | +++ libx86-1.1.hack/x86-common.h 2009-10-26 16:01:19.000000000 -0400 | ||
185 | @@ -40,4 +40,4 @@ | ||
186 | |||
187 | void *LRMI_alloc_real(int size); | ||
188 | void LRMI_free_real(void *m); | ||
189 | -int LRMI_common_init(void); | ||
190 | +void *LRMI_common_init(int high_page); | ||
diff --git a/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb b/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb index 7551e7dca..20c152cb4 100644 --- a/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb +++ b/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb | |||
@@ -7,7 +7,11 @@ LICENSE = "MIT & BSD-3-Clause" | |||
7 | SECTION = "libs" | 7 | SECTION = "libs" |
8 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=633af6c02e6f624d4c472d970a2aca53" | 8 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=633af6c02e6f624d4c472d970a2aca53" |
9 | 9 | ||
10 | SRC_URI = "http://www.codon.org.uk/~mjg59/libx86/downloads/${BPN}-${PV}.tar.gz" | 10 | SRC_URI = "http://www.codon.org.uk/~mjg59/libx86/downloads/${BPN}-${PV}.tar.gz \ |
11 | file://libx86-mmap-offset.patch \ | ||
12 | file://0001-assume-zero-is-valid-address.patch \ | ||
13 | " | ||
14 | |||
11 | SRC_URI[md5sum] = "41bee1f8e22b82d82b5f7d7ba51abc2a" | 15 | SRC_URI[md5sum] = "41bee1f8e22b82d82b5f7d7ba51abc2a" |
12 | SRC_URI[sha256sum] = "5bf13104cb327472b5cb65643352a9138646becacc06763088d83001d832d048" | 16 | SRC_URI[sha256sum] = "5bf13104cb327472b5cb65643352a9138646becacc06763088d83001d832d048" |
13 | 17 | ||