1 diff -urN linux/arch/i386/config.in linux/arch/i386/config.in
2 --- linux/arch/i386/config.in Tue Jan 9 16:24:13 2001
3 +++ linux/arch/i386/config.in Wed Jan 10 07:08:08 2001
5 tristate '/dev/cpu/microcode - Intel P6 CPU microcode support' CONFIG_MICROCODE
6 tristate '/dev/cpu/*/msr - Model-specific register support' CONFIG_X86_MSR
7 tristate '/dev/cpu/*/cpuid - CPU information support' CONFIG_X86_CPUID
8 +bool 'E820 proc support' CONFIG_E820_PROC
10 choice 'High Memory Support' \
11 "off CONFIG_NOHIGHMEM \
12 --- linux/arch/i386/kernel/Makefile Wed Jan 17 15:58:23 2001
13 +++ linux/arch/i386/kernel/Makefile Wed Jan 17 15:58:47 2001
17 obj-$(CONFIG_MCA) += mca.o
18 +obj-$(CONFIG_E820_PROC) += e820.o rpmhelper.o
19 obj-$(CONFIG_MTRR) += mtrr.o
20 obj-$(CONFIG_X86_MSR) += msr.o
21 obj-$(CONFIG_X86_CPUID) += cpuid.o
22 diff -urN linux/arch/i386/kernel/e820.c linux/arch/i386/kernel/e820.c
23 --- linux/arch/i386/kernel/e820.c Wed Dec 31 19:00:00 1969
24 +++ linux/arch/i386/kernel/e820.c Wed Jan 10 07:05:51 2001
26 +/* Copyright (c) 2001 Red Hat, Inc. All rights reserved.
27 + * This software may be freely redistributed under the terms of the
28 + * GNU General Public License.
29 + * You should have received a copy of the GNU General Public License
30 + * along with this program; if not, write to the Free Software
31 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 + * Author: Arjan van de Ven <arjanv@redhat.com
35 +#include <linux/config.h>
36 +#include <linux/kernel.h>
37 +#include <linux/init.h> /* for module_init/exit */
38 +#include <linux/proc_fs.h>
39 +#include <linux/module.h>
40 +#include <linux/version.h>
41 +#include <linux/types.h>
43 +#include <asm/e820.h>
45 +extern struct e820map e820;
46 +struct proc_dir_entry *e820_proc_entry;
48 +static int e820_proc_output(char *buffer, int bufsize)
52 + for (i = 0; i < e820.nr_map; i++) {
53 + /* FIXME: check for overflow */
54 + bufpos += sprintf(buffer+bufpos,"%016Lx @ %016Lx ",
55 + e820.map[i].size, e820.map[i].addr);
56 + switch (e820.map[i].type) {
57 + case E820_RAM: bufpos += sprintf(buffer+bufpos,"(usable)\n");
60 + bufpos += sprintf(buffer+bufpos,"(reserved)\n");
63 + bufpos += sprintf(buffer+bufpos,"(ACPI data)\n");
66 + bufpos += sprintf(buffer+bufpos,"(ACPI NVS)\n");
68 + default: bufpos += sprintf(buffer+bufpos,"type %lu\n", e820.map[i].type);
80 +static int e820_read_proc(char *page, char **start, off_t off,
81 + int count, int *eof, void *data)
83 + int len = e820_proc_output (page,4096);
84 + if (len <= off+count) *eof = 1;
85 + *start = page + off;
87 + if (len>count) len = count;
92 +int e820_module_init(void)
94 + /* /proc/e820info probably isn't the best place for it, need
95 + to find a better one */
96 + e820_proc_entry = create_proc_entry ("e820info", 0, NULL);
97 + if (e820_proc_entry==NULL)
100 + e820_proc_entry->read_proc = e820_read_proc;
101 + e820_proc_entry->owner = THIS_MODULE;
107 +void e820_module_exit(void)
109 + remove_proc_entry ("e820info", e820_proc_entry);
112 +module_init(e820_module_init);
113 +module_exit(e820_module_exit);
115 diff -urN /usr/src/linux-2.4.9-7/arch/i386/kernel/rpmhelper.c linux/arch/i386/kernel/rpmhelper.c
116 --- /usr/src/linux-2.4.9-7/arch/i386/kernel/rpmhelper.c Thu Jan 1 01:00:00 1970
117 +++ linux/arch/i386/kernel/rpmhelper.c Sun Oct 28 17:09:58 2001
119 +#include <linux/config.h>
120 +#include <linux/kernel.h>
121 +#include <linux/init.h> /* for module_init/exit */
122 +#include <linux/proc_fs.h>
123 +#include <linux/module.h>
124 +#include <linux/version.h>
125 +#include <linux/types.h>
127 +#include <asm/e820.h>
128 +#include <asm/cpufeature.h>
129 +#include <asm/processor.h>
132 +/* this file, present in the -BOOT kernel, informs anaconda about which
133 + kernels this system needs. While not impossible to do in userspace,
134 + the kernel has the authorative list of defective bioses (440GX etc) that
135 + have special needs.
138 +#define cpu_has_cmov (test_bit(X86_FEATURE_CMOV, boot_cpu_data.x86_capability))
141 +extern char rpmarchitecture[];
142 +extern char rpmkerneltype[];
143 +extern int skip_ioapic_setup;
145 +extern struct e820map e820;
146 +extern struct cpuinfo_x86 boot_cpu_data;
148 +static inline int needbigmem()
152 + /* no pae no bigmem */
153 + if ( (!cpu_has_pae) || (!cpu_has_xmm) )
156 + for (i = 0; i < e820.nr_map; i++) {
157 + switch (e820.map[i].type) {
159 + if (e820.map[i].addr > 0xffffffff)
161 + if (e820.map[i].addr+e820.map[i].size > 0xffffffff)
171 +static inline void cputype(void)
173 + /* i386 works always */
174 + sprintf(rpmarchitecture,"i386");
175 + /* test for i586 and up */
176 + if (boot_cpu_data.x86_model<5)
178 + sprintf(rpmarchitecture,"i586 i385");
179 + /* i686 and above needs cmov support */
182 + sprintf(rpmarchitecture,"i686 i586 i386");
185 + if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
186 + (boot_cpu_data.x86>=6) )
187 + sprintf(rpmarchitecture,"athlon i686 i586 i386");
191 +int __init rpmhelper_init(void)
194 + /* > 4Gb ram addressable -> Enterprise kernel */
195 + ent = needbigmem();
196 + /* 440GX or similarly broken bios ? -> smp kernel */
197 + #if CONFIG_X86_LOCAL_APIC
198 + if (skip_ioapic_setup==0)
203 + sprintf(rpmkerneltype,"bigmem smp");
206 + sprintf(rpmkerneltype,"smp");
214 +void rpmhelper_exit(void)
218 +module_init(rpmhelper_init);
219 +module_exit(rpmhelper_exit);
221 diff -urN /usr/src/linux-2.4.9-7/include/linux/sysctl.h linux/include/linux/sysctl.h
222 --- /usr/src/linux-2.4.9-7/include/linux/sysctl.h Thu Oct 18 18:42:27 2001
223 +++ linux/include/linux/sysctl.h Sun Oct 28 17:13:51 2001
226 /* CTL_DEBUG names: */
236 diff -urN /usr/src/linux-2.4.9-7/kernel/sysctl.c linux/kernel/sysctl.c
237 --- /usr/src/linux-2.4.9-7/kernel/sysctl.c Thu Oct 18 18:34:52 2001
238 +++ linux/kernel/sysctl.c Sun Oct 28 17:13:18 2001
240 extern int sem_ctls[];
243 +char rpmarchitecture[64];
244 +char rpmkerneltype[64];
247 extern char reboot_command [];
248 extern int stop_a_enabled;
252 static ctl_table debug_table[] = {
253 + {DEBUG_RPM1, "kerneltype", rpmkerneltype, 64,
254 + 0444, NULL, &proc_doutsstring, &sysctl_string},
255 + {DEBUG_RPM2, "rpmarch", rpmarchitecture, 64,
256 + 0444, NULL, &proc_doutsstring, &sysctl_string},