WSL2-Linux-Kernel/Documentation
Bernhard Walle 69ac9cd629 sysfs: add /sys/firmware/memmap
This patch adds /sys/firmware/memmap interface that represents the BIOS
(or Firmware) provided memory map. The tree looks like:

    /sys/firmware/memmap/0/start   (hex number)
                           end     (hex number)
                           type    (string)
    ...                 /1/start
                           end
                           type

With the following shell snippet one can print the memory map in the same form
the kernel prints itself when booting on x86 (the E820 map).

  --------- 8< --------------------------
    #!/bin/sh
    cd /sys/firmware/memmap
    for dir in * ; do
        start=$(cat $dir/start)
        end=$(cat $dir/end)
        type=$(cat $dir/type)
        printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
    done
  --------- >8 --------------------------

That patch only provides the needed interface:

 1. The sysfs interface.
 2. The structure and enumeration definition.
 3. The function firmware_map_add() and firmware_map_add_early()
    that should be called from architecture code (E820/EFI, for
    example) to add the contents to the interface.

If the kernel is compiled without CONFIG_FIRMWARE_MEMMAP, the interface does
nothing without cluttering the architecture-specific code with #ifdef's.

The purpose of the new interface is kexec: While /proc/iomem represents
the *used* memory map (e.g. modified via kernel parameters like 'memmap'
and 'mem'), the /sys/firmware/memmap tree represents the unmodified memory
map provided via the firmware. So kexec can:

 - use the original memory map for rebooting,
 - use the /proc/iomem for setting up the ELF core headers for kdump
   case that should only represent the memory of the system.

The patch has been tested on i386 and x86_64.

Signed-off-by: Bernhard Walle <bwalle@suse.de>
Acked-by: Greg KH <gregkh@suse.de>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: kexec@lists.infradead.org
Cc: yhlu.kernel@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-08 17:55:41 +02:00
..
ABI
DocBook
PCI
RCU
accounting
acpi
aoe
arm
auxdisplay
blackfin
block
cdrom
connector
console
controllers
cpu-freq
cpuidle
cris
crypto
device-mapper
driver-model
dvb
early-userspace
fault-injection
fb
filesystems
firmware_class
frv
hwmon
i2c
i2o
ia64
ide
infiniband
input
ioctl
isdn
ja_JP
kbuild
kdump
ko_KR
laptops
lguest
m68k
make
mips
mn10300
namespaces
netlabel
networking
parisc
pcmcia
power
powerpc
prctl
s390
scheduler
scsi
serial
sh
sound
sparc
spi
sysctl
telephony
thermal
timers
uml
usb
video4linux
vm
w1
watchdog
x86
zh_CN
00-INDEX
BUG-HUNTING
Changes
CodingStyle
DMA-API.txt
DMA-ISA-LPC.txt
DMA-attributes.txt
DMA-mapping.txt
HOWTO
IO-mapping.txt
IPMI.txt
IRQ-affinity.txt
IRQ.txt
Intel-IOMMU.txt
MSI-HOWTO.txt
ManagementStyle
README.DAC960
README.cycladesZ
SAK.txt
SM501.txt
SecurityBugs
Smack.txt
SubmitChecklist
SubmittingDrivers
SubmittingPatches
VGA-softcursor.txt
applying-patches.txt
atomic_ops.txt
basic_profiling.txt
binfmt_misc.txt
braille-console.txt
cachetlb.txt
cciss.txt
cgroups.txt
cli-sti-removal.txt
computone.txt
cpqarray.txt
cpu-hotplug.txt
cpu-load.txt
cpusets.txt
cputopology.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
devices.txt
digiepca.txt
dontdiff
edac.txt
eisa.txt
email-clients.txt
exception.txt
feature-removal-schedule.txt
floppy.txt
gpio.txt
hayes-esp.txt
highuid.txt
hpet.txt
hw_random.txt
initrd.txt
io_ordering.txt
ioctl-number.txt
iostats.txt
irqflags-tracing.txt
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt
kernel-docs.txt
kernel-parameters.txt
keys-request-key.txt
keys.txt
kobject.txt
kprobes.txt
kref.txt
ldm.txt
leds-class.txt
local_ops.txt
lockdep-design.txt
lockstat.txt
logo.gif
logo.txt
magic-number.txt
markers.txt
mca.txt
md.txt
memory-barriers.txt
memory-hotplug.txt
memory.txt
mono.txt
moxa-smartio
mtrr.txt
mutex-design.txt
nbd.txt
nmi_watchdog.txt
nommu-mmap.txt
numastat.txt
oops-tracing.txt
paride.txt
parport-lowlevel.txt
parport.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
prio_tree.txt
ramdisk.txt
rbtree.txt
rfkill.txt
riscom8.txt
robust-futex-ABI.txt
robust-futexes.txt
rocket.txt
rt-mutex-design.txt
rt-mutex.txt
rtc.txt
serial-console.txt
sgi-ioc4.txt
sgi-visws.txt
sparse.txt
specialix.txt
spinlocks.txt
stable_api_nonsense.txt
stable_kernel_rules.txt
stallion.txt
svga.txt
sx.txt
sysfs-rules.txt
sysrq.txt
tty.txt
unaligned-memory-access.txt
unicode.txt
unshare.txt
video-output.txt
volatile-considered-harmful.txt
voyager.txt
zorro.txt

README.cycladesZ

The Cyclades-Z must have firmware loaded onto the card before it will
operate.  This operation should be performed during system startup,

The firmware, loader program and the latest device driver code are
available from Cyclades at
    ftp://ftp.cyclades.com/pub/cyclades/cyclades-z/linux/