| .. | .. |
|---|
| 20 | 20 | the raw memory map to userspace. |
|---|
| 21 | 21 | |
|---|
| 22 | 22 | The structure is as follows: Under /sys/firmware/memmap there |
|---|
| 23 | | - are subdirectories with the number of the entry as their name: |
|---|
| 23 | + are subdirectories with the number of the entry as their name:: |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | /sys/firmware/memmap/0 |
|---|
| 26 | 26 | /sys/firmware/memmap/1 |
|---|
| .. | .. |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | Each directory contains three files: |
|---|
| 36 | 36 | |
|---|
| 37 | | - start : The start address (as hexadecimal number with the |
|---|
| 37 | + ======== ===================================================== |
|---|
| 38 | + start The start address (as hexadecimal number with the |
|---|
| 38 | 39 | '0x' prefix). |
|---|
| 39 | | - end : The end address, inclusive (regardless whether the |
|---|
| 40 | + end The end address, inclusive (regardless whether the |
|---|
| 40 | 41 | firmware provides inclusive or exclusive ranges). |
|---|
| 41 | | - type : Type of the entry as string. See below for a list of |
|---|
| 42 | + type Type of the entry as string. See below for a list of |
|---|
| 42 | 43 | valid types. |
|---|
| 44 | + ======== ===================================================== |
|---|
| 43 | 45 | |
|---|
| 44 | | - So, for example: |
|---|
| 46 | + So, for example:: |
|---|
| 45 | 47 | |
|---|
| 46 | 48 | /sys/firmware/memmap/0/start |
|---|
| 47 | 49 | /sys/firmware/memmap/0/end |
|---|
| .. | .. |
|---|
| 57 | 59 | - reserved |
|---|
| 58 | 60 | |
|---|
| 59 | 61 | Following shell snippet can be used to display that memory |
|---|
| 60 | | - map in a human-readable format: |
|---|
| 62 | + map in a human-readable format:: |
|---|
| 61 | 63 | |
|---|
| 62 | | - -------------------- 8< ---------------------------------------- |
|---|
| 63 | 64 | #!/bin/bash |
|---|
| 64 | 65 | cd /sys/firmware/memmap |
|---|
| 65 | 66 | for dir in * ; do |
|---|
| .. | .. |
|---|
| 68 | 69 | type=$(cat $dir/type) |
|---|
| 69 | 70 | printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type" |
|---|
| 70 | 71 | done |
|---|
| 71 | | - -------------------- >8 ---------------------------------------- |
|---|