~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/ABI/testing/sysfs-firmware-memmap

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/ABI/testing/sysfs-firmware-memmap (Architecture m68k) and /Documentation/ABI/testing/sysfs-firmware-memmap (Architecture mips)


  1 What:           /sys/firmware/memmap/               1 What:           /sys/firmware/memmap/
  2 Date:           June 2008                           2 Date:           June 2008
  3 Contact:        Bernhard Walle <bernhard.walle@      3 Contact:        Bernhard Walle <bernhard.walle@gmx.de>
  4 Description:                                        4 Description:
  5                 On all platforms, the firmware      5                 On all platforms, the firmware provides a memory map which the
  6                 kernel reads. The resources fr      6                 kernel reads. The resources from that memory map are registered
  7                 in the kernel resource tree an      7                 in the kernel resource tree and exposed to userspace via
  8                 /proc/iomem (together with oth      8                 /proc/iomem (together with other resources).
  9                                                     9 
 10                 However, on most architectures     10                 However, on most architectures that firmware-provided memory
 11                 map is modified afterwards by      11                 map is modified afterwards by the kernel itself, either because
 12                 the kernel merges that memory      12                 the kernel merges that memory map with other information or
 13                 just because the user overwrit     13                 just because the user overwrites that memory map via command
 14                 line.                              14                 line.
 15                                                    15 
 16                 kexec needs the raw firmware-p     16                 kexec needs the raw firmware-provided memory map to setup the
 17                 parameter segment of the kerne     17                 parameter segment of the kernel that should be booted with
 18                 kexec. Also, the raw memory ma     18                 kexec. Also, the raw memory map is useful for debugging. For
 19                 that reason, /sys/firmware/mem     19                 that reason, /sys/firmware/memmap is an interface that provides
 20                 the raw memory map to userspac     20                 the raw memory map to userspace.
 21                                                    21 
 22                 The structure is as follows: U     22                 The structure is as follows: Under /sys/firmware/memmap there
 23                 are subdirectories with the nu     23                 are subdirectories with the number of the entry as their name::
 24                                                    24 
 25                         /sys/firmware/memmap/0     25                         /sys/firmware/memmap/0
 26                         /sys/firmware/memmap/1     26                         /sys/firmware/memmap/1
 27                         /sys/firmware/memmap/2     27                         /sys/firmware/memmap/2
 28                         /sys/firmware/memmap/3     28                         /sys/firmware/memmap/3
 29                         ...                        29                         ...
 30                                                    30 
 31                 The maximum depends on the num     31                 The maximum depends on the number of memory map entries provided
 32                 by the firmware. The order is      32                 by the firmware. The order is just the order that the firmware
 33                 provides.                          33                 provides.
 34                                                    34 
 35                 Each directory contains three      35                 Each directory contains three files:
 36                                                    36 
 37                 ========  ====================     37                 ========  =====================================================
 38                 start     The start address (a     38                 start     The start address (as hexadecimal number with the
 39                           '0x' prefix).            39                           '0x' prefix).
 40                 end       The end address, inc     40                 end       The end address, inclusive (regardless whether the
 41                           firmware provides in     41                           firmware provides inclusive or exclusive ranges).
 42                 type      Type of the entry as     42                 type      Type of the entry as string. See below for a list of
 43                           valid types.             43                           valid types.
 44                 ========  ====================     44                 ========  =====================================================
 45                                                    45 
 46                 So, for example::                  46                 So, for example::
 47                                                    47 
 48                         /sys/firmware/memmap/0     48                         /sys/firmware/memmap/0/start
 49                         /sys/firmware/memmap/0     49                         /sys/firmware/memmap/0/end
 50                         /sys/firmware/memmap/0     50                         /sys/firmware/memmap/0/type
 51                         /sys/firmware/memmap/1     51                         /sys/firmware/memmap/1/start
 52                         ...                        52                         ...
 53                                                    53 
 54                 Currently following types exis     54                 Currently following types exist:
 55                                                    55 
 56                   - System RAM                     56                   - System RAM
 57                   - ACPI Tables                    57                   - ACPI Tables
 58                   - ACPI Non-volatile Storage      58                   - ACPI Non-volatile Storage
 59                   - Unusable memory                59                   - Unusable memory
 60                   - Persistent Memory (legacy)     60                   - Persistent Memory (legacy)
 61                   - Persistent Memory              61                   - Persistent Memory
 62                   - Soft Reserved                  62                   - Soft Reserved
 63                   - reserved                       63                   - reserved
 64                                                    64 
 65                 Following shell snippet can be     65                 Following shell snippet can be used to display that memory
 66                 map in a human-readable format     66                 map in a human-readable format::
 67                                                    67 
 68                   #!/bin/bash                      68                   #!/bin/bash
 69                   cd /sys/firmware/memmap          69                   cd /sys/firmware/memmap
 70                   for dir in * ; do                70                   for dir in * ; do
 71                       start=$(cat $dir/start)      71                       start=$(cat $dir/start)
 72                       end=$(cat $dir/end)          72                       end=$(cat $dir/end)
 73                       type=$(cat $dir/type)        73                       type=$(cat $dir/type)
 74                       printf "%016x-%016x (%s)     74                       printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
 75                   done                             75                   done
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php