You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'akpm' (patches from Andrew)
Merge second patchbomb from Andrew Morton:
- the rest of MM
- various misc bits
- add ability to run /sbin/reboot at reboot time
- printk/vsprintf changes
- fiddle with seq_printf() return value
* akpm: (114 commits)
parisc: remove use of seq_printf return value
lru_cache: remove use of seq_printf return value
tracing: remove use of seq_printf return value
cgroup: remove use of seq_printf return value
proc: remove use of seq_printf return value
s390: remove use of seq_printf return value
cris fasttimer: remove use of seq_printf return value
cris: remove use of seq_printf return value
openrisc: remove use of seq_printf return value
ARM: plat-pxa: remove use of seq_printf return value
nios2: cpuinfo: remove use of seq_printf return value
microblaze: mb: remove use of seq_printf return value
ipc: remove use of seq_printf return value
rtc: remove use of seq_printf return value
power: wakeup: remove use of seq_printf return value
x86: mtrr: if: remove use of seq_printf return value
linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK
MAINTAINERS: CREDITS: remove Stefano Brivio from B43
.mailmap: add Ricardo Ribalda
CREDITS: add Ricardo Ribalda Delgado
...
This commit is contained in:
@@ -100,6 +100,7 @@ Rajesh Shah <rajesh.shah@intel.com>
|
||||
Ralf Baechle <ralf@linux-mips.org>
|
||||
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||
Rémi Denis-Courmont <rdenis@simphalempin.com>
|
||||
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
|
||||
Rudolf Marek <R.Marek@sh.cvut.cz>
|
||||
Rui Saraiva <rmps@joel.ist.utl.pt>
|
||||
Sachin P Sant <ssant@in.ibm.com>
|
||||
|
||||
@@ -508,6 +508,10 @@ E: paul@paulbristow.net
|
||||
W: http://paulbristow.net/linux/idefloppy.html
|
||||
D: Maintainer of IDE/ATAPI floppy driver
|
||||
|
||||
N: Stefano Brivio
|
||||
E: stefano.brivio@polimi.it
|
||||
D: Broadcom B43 driver
|
||||
|
||||
N: Dominik Brodowski
|
||||
E: linux@brodo.de
|
||||
W: http://www.brodo.de/
|
||||
@@ -3008,6 +3012,19 @@ W: http://www.qsl.net/dl1bke/
|
||||
D: Generic Z8530 driver, AX.25 DAMA slave implementation
|
||||
D: Several AX.25 hacks
|
||||
|
||||
N: Ricardo Ribalda Delgado
|
||||
E: ricardo.ribalda@gmail.com
|
||||
W: http://ribalda.com
|
||||
D: PLX USB338x driver
|
||||
D: PCA9634 driver
|
||||
D: Option GTM671WFS
|
||||
D: Fintek F81216A
|
||||
D: Various kernel hacks
|
||||
S: Qtechnology A/S
|
||||
S: Valby Langgade 142
|
||||
S: 2500 Valby
|
||||
S: Denmark
|
||||
|
||||
N: Francois-Rene Rideau
|
||||
E: fare@tunes.org
|
||||
W: http://www.tunes.org/~fare
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
What: /sys/block/zram<id>/num_reads
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The num_reads file is read-only and specifies the number of
|
||||
reads (failed or successful) done on this device.
|
||||
Now accessible via zram<id>/stat node.
|
||||
|
||||
What: /sys/block/zram<id>/num_writes
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The num_writes file is read-only and specifies the number of
|
||||
writes (failed or successful) done on this device.
|
||||
Now accessible via zram<id>/stat node.
|
||||
|
||||
What: /sys/block/zram<id>/invalid_io
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The invalid_io file is read-only and specifies the number of
|
||||
non-page-size-aligned I/O requests issued to this device.
|
||||
Now accessible via zram<id>/io_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/failed_reads
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The failed_reads file is read-only and specifies the number of
|
||||
failed reads happened on this device.
|
||||
Now accessible via zram<id>/io_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/failed_writes
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The failed_writes file is read-only and specifies the number of
|
||||
failed writes happened on this device.
|
||||
Now accessible via zram<id>/io_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/notify_free
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The notify_free file is read-only. Depending on device usage
|
||||
scenario it may account a) the number of pages freed because
|
||||
of swap slot free notifications or b) the number of pages freed
|
||||
because of REQ_DISCARD requests sent by bio. The former ones
|
||||
are sent to a swap block device when a swap slot is freed, which
|
||||
implies that this disk is being used as a swap disk. The latter
|
||||
ones are sent by filesystem mounted with discard option,
|
||||
whenever some data blocks are getting discarded.
|
||||
Now accessible via zram<id>/io_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/zero_pages
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The zero_pages file is read-only and specifies number of zero
|
||||
filled pages written to this disk. No memory is allocated for
|
||||
such pages.
|
||||
Now accessible via zram<id>/mm_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/orig_data_size
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The orig_data_size file is read-only and specifies uncompressed
|
||||
size of data stored in this disk. This excludes zero-filled
|
||||
pages (zero_pages) since no memory is allocated for them.
|
||||
Unit: bytes
|
||||
Now accessible via zram<id>/mm_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/compr_data_size
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The compr_data_size file is read-only and specifies compressed
|
||||
size of data stored in this disk. So, compression ratio can be
|
||||
calculated using orig_data_size and this statistic.
|
||||
Unit: bytes
|
||||
Now accessible via zram<id>/mm_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/mem_used_total
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The mem_used_total file is read-only and specifies the amount
|
||||
of memory, including allocator fragmentation and metadata
|
||||
overhead, allocated for this disk. So, allocator space
|
||||
efficiency can be calculated using compr_data_size and this
|
||||
statistic.
|
||||
Unit: bytes
|
||||
Now accessible via zram<id>/mm_stat node.
|
||||
|
||||
What: /sys/block/zram<id>/mem_used_max
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The mem_used_max file is read/write and specifies the amount
|
||||
of maximum memory zram have consumed to store compressed data.
|
||||
For resetting the value, you should write "0". Otherwise,
|
||||
you could see -EINVAL.
|
||||
Unit: bytes
|
||||
Downgraded to write-only node: so it's possible to set new
|
||||
value only; its current value is stored in zram<id>/mm_stat
|
||||
node.
|
||||
|
||||
What: /sys/block/zram<id>/mem_limit
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The mem_limit file is read/write and specifies the maximum
|
||||
amount of memory ZRAM can use to store the compressed data.
|
||||
The limit could be changed in run time and "0" means disable
|
||||
the limit. No limit is the initial state. Unit: bytes
|
||||
Downgraded to write-only node: so it's possible to set new
|
||||
value only; its current value is stored in zram<id>/mm_stat
|
||||
node.
|
||||
@@ -141,3 +141,28 @@ Description:
|
||||
amount of memory ZRAM can use to store the compressed data. The
|
||||
limit could be changed in run time and "0" means disable the
|
||||
limit. No limit is the initial state. Unit: bytes
|
||||
|
||||
What: /sys/block/zram<id>/compact
|
||||
Date: August 2015
|
||||
Contact: Minchan Kim <minchan@kernel.org>
|
||||
Description:
|
||||
The compact file is write-only and trigger compaction for
|
||||
allocator zrm uses. The allocator moves some objects so that
|
||||
it could free fragment space.
|
||||
|
||||
What: /sys/block/zram<id>/io_stat
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The io_stat file is read-only and accumulates device's I/O
|
||||
statistics not accounted by block layer. For example,
|
||||
failed_reads, failed_writes, etc. File format is similar to
|
||||
block layer statistics file format.
|
||||
|
||||
What: /sys/block/zram<id>/mm_stat
|
||||
Date: August 2015
|
||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||
Description:
|
||||
The mm_stat file is read-only and represents device's mm
|
||||
statistics (orig_data_size, compr_data_size, etc.) in a format
|
||||
similar to block layer statistics file format.
|
||||
|
||||
@@ -98,20 +98,79 @@ size of the disk when not in use so a huge zram is wasteful.
|
||||
mount /dev/zram1 /tmp
|
||||
|
||||
7) Stats:
|
||||
Per-device statistics are exported as various nodes under
|
||||
/sys/block/zram<id>/
|
||||
disksize
|
||||
num_reads
|
||||
num_writes
|
||||
failed_reads
|
||||
failed_writes
|
||||
invalid_io
|
||||
notify_free
|
||||
zero_pages
|
||||
orig_data_size
|
||||
compr_data_size
|
||||
mem_used_total
|
||||
mem_used_max
|
||||
Per-device statistics are exported as various nodes under /sys/block/zram<id>/
|
||||
|
||||
A brief description of exported device attritbutes. For more details please
|
||||
read Documentation/ABI/testing/sysfs-block-zram.
|
||||
|
||||
Name access description
|
||||
---- ------ -----------
|
||||
disksize RW show and set the device's disk size
|
||||
initstate RO shows the initialization state of the device
|
||||
reset WO trigger device reset
|
||||
num_reads RO the number of reads
|
||||
failed_reads RO the number of failed reads
|
||||
num_write RO the number of writes
|
||||
failed_writes RO the number of failed writes
|
||||
invalid_io RO the number of non-page-size-aligned I/O requests
|
||||
max_comp_streams RW the number of possible concurrent compress operations
|
||||
comp_algorithm RW show and change the compression algorithm
|
||||
notify_free RO the number of notifications to free pages (either
|
||||
slot free notifications or REQ_DISCARD requests)
|
||||
zero_pages RO the number of zero filled pages written to this disk
|
||||
orig_data_size RO uncompressed size of data stored in this disk
|
||||
compr_data_size RO compressed size of data stored in this disk
|
||||
mem_used_total RO the amount of memory allocated for this disk
|
||||
mem_used_max RW the maximum amount memory zram have consumed to
|
||||
store compressed data
|
||||
mem_limit RW the maximum amount of memory ZRAM can use to store
|
||||
the compressed data
|
||||
num_migrated RO the number of objects migrated migrated by compaction
|
||||
|
||||
|
||||
WARNING
|
||||
=======
|
||||
per-stat sysfs attributes are considered to be deprecated.
|
||||
The basic strategy is:
|
||||
-- the existing RW nodes will be downgraded to WO nodes (in linux 4.11)
|
||||
-- deprecated RO sysfs nodes will eventually be removed (in linux 4.11)
|
||||
|
||||
The list of deprecated attributes can be found here:
|
||||
Documentation/ABI/obsolete/sysfs-block-zram
|
||||
|
||||
Basically, every attribute that has its own read accessible sysfs node
|
||||
(e.g. num_reads) *AND* is accessible via one of the stat files (zram<id>/stat
|
||||
or zram<id>/io_stat or zram<id>/mm_stat) is considered to be deprecated.
|
||||
|
||||
User space is advised to use the following files to read the device statistics.
|
||||
|
||||
File /sys/block/zram<id>/stat
|
||||
|
||||
Represents block layer statistics. Read Documentation/block/stat.txt for
|
||||
details.
|
||||
|
||||
File /sys/block/zram<id>/io_stat
|
||||
|
||||
The stat file represents device's I/O statistics not accounted by block
|
||||
layer and, thus, not available in zram<id>/stat file. It consists of a
|
||||
single line of text and contains the following stats separated by
|
||||
whitespace:
|
||||
failed_reads
|
||||
failed_writes
|
||||
invalid_io
|
||||
notify_free
|
||||
|
||||
File /sys/block/zram<id>/mm_stat
|
||||
|
||||
The stat file represents device's mm statistics. It consists of a single
|
||||
line of text and contains the following stats separated by whitespace:
|
||||
orig_data_size
|
||||
compr_data_size
|
||||
mem_used_total
|
||||
mem_limit
|
||||
mem_used_max
|
||||
zero_pages
|
||||
num_migrated
|
||||
|
||||
8) Deactivate:
|
||||
swapoff /dev/zram0
|
||||
|
||||
@@ -523,6 +523,7 @@ prototypes:
|
||||
void (*close)(struct vm_area_struct*);
|
||||
int (*fault)(struct vm_area_struct*, struct vm_fault *);
|
||||
int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *);
|
||||
int (*pfn_mkwrite)(struct vm_area_struct *, struct vm_fault *);
|
||||
int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);
|
||||
|
||||
locking rules:
|
||||
@@ -532,6 +533,7 @@ close: yes
|
||||
fault: yes can return with page locked
|
||||
map_pages: yes
|
||||
page_mkwrite: yes can return with page locked
|
||||
pfn_mkwrite: yes
|
||||
access: yes
|
||||
|
||||
->fault() is called when a previously not present pte is about
|
||||
@@ -558,6 +560,12 @@ the page has been truncated, the filesystem should not look up a new page
|
||||
like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which
|
||||
will cause the VM to retry the fault.
|
||||
|
||||
->pfn_mkwrite() is the same as page_mkwrite but when the pte is
|
||||
VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is
|
||||
VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior
|
||||
after this call is to make the pte read-write, unless pfn_mkwrite returns
|
||||
an error.
|
||||
|
||||
->access() is called when get_user_pages() fails in
|
||||
access_process_vm(), typically used to debug a process through
|
||||
/proc/pid/mem or ptrace. This function is needed only for
|
||||
|
||||
@@ -8,6 +8,21 @@ If variable is of Type, use printk format specifier:
|
||||
unsigned long long %llu or %llx
|
||||
size_t %zu or %zx
|
||||
ssize_t %zd or %zx
|
||||
s32 %d or %x
|
||||
u32 %u or %x
|
||||
s64 %lld or %llx
|
||||
u64 %llu or %llx
|
||||
|
||||
If <type> is dependent on a config option for its size (e.g., sector_t,
|
||||
blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
|
||||
format specifier of its largest possible type and explicitly cast to it.
|
||||
Example:
|
||||
|
||||
printk("test: sector number/total blocks: %llu/%llu\n",
|
||||
(unsigned long long)sector, (unsigned long long)blockcount);
|
||||
|
||||
Reminder: sizeof() result is of type size_t.
|
||||
|
||||
|
||||
Raw pointer value SHOULD be printed with %p. The kernel supports
|
||||
the following extended format specifiers for pointer types:
|
||||
@@ -54,6 +69,7 @@ Struct Resources:
|
||||
|
||||
For printing struct resources. The 'R' and 'r' specifiers result in a
|
||||
printed resource with ('R') or without ('r') a decoded flags member.
|
||||
Passed by reference.
|
||||
|
||||
Physical addresses types phys_addr_t:
|
||||
|
||||
@@ -132,6 +148,8 @@ MAC/FDDI addresses:
|
||||
specifier to use reversed byte order suitable for visual interpretation
|
||||
of Bluetooth addresses which are in the little endian order.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
IPv4 addresses:
|
||||
|
||||
%pI4 1.2.3.4
|
||||
@@ -146,6 +164,8 @@ IPv4 addresses:
|
||||
host, network, big or little endian order addresses respectively. Where
|
||||
no specifier is provided the default network/big endian order is used.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
IPv6 addresses:
|
||||
|
||||
%pI6 0001:0002:0003:0004:0005:0006:0007:0008
|
||||
@@ -160,6 +180,8 @@ IPv6 addresses:
|
||||
print a compressed IPv6 address as described by
|
||||
http://tools.ietf.org/html/rfc5952
|
||||
|
||||
Passed by reference.
|
||||
|
||||
IPv4/IPv6 addresses (generic, with port, flowinfo, scope):
|
||||
|
||||
%pIS 1.2.3.4 or 0001:0002:0003:0004:0005:0006:0007:0008
|
||||
@@ -186,6 +208,8 @@ IPv4/IPv6 addresses (generic, with port, flowinfo, scope):
|
||||
specifiers can be used as well and are ignored in case of an IPv6
|
||||
address.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
Further examples:
|
||||
|
||||
%pISfc 1.2.3.4 or [1:2:3:4:5:6:7:8]/123456789
|
||||
@@ -207,6 +231,8 @@ UUID/GUID addresses:
|
||||
Where no additional specifiers are used the default little endian
|
||||
order with lower case hex characters will be printed.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
dentry names:
|
||||
%pd{,2,3,4}
|
||||
%pD{,2,3,4}
|
||||
@@ -216,6 +242,8 @@ dentry names:
|
||||
equivalent of %s dentry->d_name.name we used to use, %pd<n> prints
|
||||
n last components. %pD does the same thing for struct file.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
struct va_format:
|
||||
|
||||
%pV
|
||||
@@ -231,23 +259,20 @@ struct va_format:
|
||||
Do not use this feature without some mechanism to verify the
|
||||
correctness of the format string and va_list arguments.
|
||||
|
||||
u64 SHOULD be printed with %llu/%llx:
|
||||
Passed by reference.
|
||||
|
||||
printk("%llu", u64_var);
|
||||
struct clk:
|
||||
|
||||
s64 SHOULD be printed with %lld/%llx:
|
||||
%pC pll1
|
||||
%pCn pll1
|
||||
%pCr 1560000000
|
||||
|
||||
printk("%lld", s64_var);
|
||||
For printing struct clk structures. '%pC' and '%pCn' print the name
|
||||
(Common Clock Framework) or address (legacy clock framework) of the
|
||||
structure; '%pCr' prints the current clock rate.
|
||||
|
||||
If <type> is dependent on a config option for its size (e.g., sector_t,
|
||||
blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
|
||||
format specifier of its largest possible type and explicitly cast to it.
|
||||
Example:
|
||||
Passed by reference.
|
||||
|
||||
printk("test: sector number/total blocks: %llu/%llu\n",
|
||||
(unsigned long long)sector, (unsigned long long)blockcount);
|
||||
|
||||
Reminder: sizeof() result is of type size_t.
|
||||
|
||||
Thank you for your cooperation and attention.
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ Currently, these files are in /proc/sys/vm:
|
||||
- admin_reserve_kbytes
|
||||
- block_dump
|
||||
- compact_memory
|
||||
- compact_unevictable_allowed
|
||||
- dirty_background_bytes
|
||||
- dirty_background_ratio
|
||||
- dirty_bytes
|
||||
@@ -106,6 +107,16 @@ huge pages although processes will also directly compact memory as required.
|
||||
|
||||
==============================================================
|
||||
|
||||
compact_unevictable_allowed
|
||||
|
||||
Available only when CONFIG_COMPACTION is set. When set to 1, compaction is
|
||||
allowed to examine the unevictable lru (mlocked pages) for pages to compact.
|
||||
This should be used on systems where stalls for minor page faults are an
|
||||
acceptable trade for large contiguous free memory. Set to 0 to prevent
|
||||
compaction from moving pages that are unevictable. Default value is 1.
|
||||
|
||||
==============================================================
|
||||
|
||||
dirty_background_bytes
|
||||
|
||||
Contains the amount of dirty memory at which the background kernel
|
||||
|
||||
@@ -267,21 +267,34 @@ call, then it is required that system administrator mount a file system of
|
||||
type hugetlbfs:
|
||||
|
||||
mount -t hugetlbfs \
|
||||
-o uid=<value>,gid=<value>,mode=<value>,size=<value>,nr_inodes=<value> \
|
||||
none /mnt/huge
|
||||
-o uid=<value>,gid=<value>,mode=<value>,pagesize=<value>,size=<value>,\
|
||||
min_size=<value>,nr_inodes=<value> none /mnt/huge
|
||||
|
||||
This command mounts a (pseudo) filesystem of type hugetlbfs on the directory
|
||||
/mnt/huge. Any files created on /mnt/huge uses huge pages. The uid and gid
|
||||
options sets the owner and group of the root of the file system. By default
|
||||
the uid and gid of the current process are taken. The mode option sets the
|
||||
mode of root of file system to value & 01777. This value is given in octal.
|
||||
By default the value 0755 is picked. The size option sets the maximum value of
|
||||
memory (huge pages) allowed for that filesystem (/mnt/huge). The size is
|
||||
rounded down to HPAGE_SIZE. The option nr_inodes sets the maximum number of
|
||||
inodes that /mnt/huge can use. If the size or nr_inodes option is not
|
||||
provided on command line then no limits are set. For size and nr_inodes
|
||||
options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For
|
||||
example, size=2K has the same meaning as size=2048.
|
||||
By default the value 0755 is picked. If the paltform supports multiple huge
|
||||
page sizes, the pagesize option can be used to specify the huge page size and
|
||||
associated pool. pagesize is specified in bytes. If pagesize is not specified
|
||||
the paltform's default huge page size and associated pool will be used. The
|
||||
size option sets the maximum value of memory (huge pages) allowed for that
|
||||
filesystem (/mnt/huge). The size option can be specified in bytes, or as a
|
||||
percentage of the specified huge page pool (nr_hugepages). The size is
|
||||
rounded down to HPAGE_SIZE boundary. The min_size option sets the minimum
|
||||
value of memory (huge pages) allowed for the filesystem. min_size can be
|
||||
specified in the same way as size, either bytes or a percentage of the
|
||||
huge page pool. At mount time, the number of huge pages specified by
|
||||
min_size are reserved for use by the filesystem. If there are not enough
|
||||
free huge pages available, the mount will fail. As huge pages are allocated
|
||||
to the filesystem and freed, the reserve count is adjusted so that the sum
|
||||
of allocated and reserved huge pages is always at least min_size. The option
|
||||
nr_inodes sets the maximum number of inodes that /mnt/huge can use. If the
|
||||
size, min_size or nr_inodes option is not provided on command line then
|
||||
no limits are set. For pagesize, size, min_size and nr_inodes options, you
|
||||
can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For example, size=2K
|
||||
has the same meaning as size=2048.
|
||||
|
||||
While read system calls are supported on files that reside on hugetlb
|
||||
file systems, write system calls are not.
|
||||
@@ -289,15 +302,23 @@ file systems, write system calls are not.
|
||||
Regular chown, chgrp, and chmod commands (with right permissions) could be
|
||||
used to change the file attributes on hugetlbfs.
|
||||
|
||||
Also, it is important to note that no such mount command is required if the
|
||||
Also, it is important to note that no such mount command is required if
|
||||
applications are going to use only shmat/shmget system calls or mmap with
|
||||
MAP_HUGETLB. Users who wish to use hugetlb page via shared memory segment
|
||||
should be a member of a supplementary group and system admin needs to
|
||||
configure that gid into /proc/sys/vm/hugetlb_shm_group. It is possible for
|
||||
same or different applications to use any combination of mmaps and shm*
|
||||
calls, though the mount of filesystem will be required for using mmap calls
|
||||
without MAP_HUGETLB. For an example of how to use mmap with MAP_HUGETLB see
|
||||
map_hugetlb.c.
|
||||
MAP_HUGETLB. For an example of how to use mmap with MAP_HUGETLB see map_hugetlb
|
||||
below.
|
||||
|
||||
Users who wish to use hugetlb memory via shared memory segment should be a
|
||||
member of a supplementary group and system admin needs to configure that gid
|
||||
into /proc/sys/vm/hugetlb_shm_group. It is possible for same or different
|
||||
applications to use any combination of mmaps and shm* calls, though the mount of
|
||||
filesystem will be required for using mmap calls without MAP_HUGETLB.
|
||||
|
||||
Syscalls that operate on memory backed by hugetlb pages only have their lengths
|
||||
aligned to the native page size of the processor; they will normally fail with
|
||||
errno set to EINVAL or exclude hugetlb pages that extend beyond the length if
|
||||
not hugepage aligned. For example, munmap(2) will fail if memory is backed by
|
||||
a hugetlb page and the length is smaller than the hugepage size.
|
||||
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
@@ -22,6 +22,7 @@ CONTENTS
|
||||
- Filtering special vmas.
|
||||
- munlock()/munlockall() system call handling.
|
||||
- Migrating mlocked pages.
|
||||
- Compacting mlocked pages.
|
||||
- mmap(MAP_LOCKED) system call handling.
|
||||
- munmap()/exit()/exec() system call handling.
|
||||
- try_to_unmap().
|
||||
@@ -450,6 +451,17 @@ list because of a race between munlock and migration, page migration uses the
|
||||
putback_lru_page() function to add migrated pages back to the LRU.
|
||||
|
||||
|
||||
COMPACTING MLOCKED PAGES
|
||||
------------------------
|
||||
|
||||
The unevictable LRU can be scanned for compactable regions and the default
|
||||
behavior is to do so. /proc/sys/vm/compact_unevictable_allowed controls
|
||||
this behavior (see Documentation/sysctl/vm.txt). Once scanning of the
|
||||
unevictable LRU is enabled, the work of compaction is mostly handled by
|
||||
the page migration code and the same work flow as described in MIGRATING
|
||||
MLOCKED PAGES will apply.
|
||||
|
||||
|
||||
mmap(MAP_LOCKED) SYSTEM CALL HANDLING
|
||||
-------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
zsmalloc
|
||||
--------
|
||||
|
||||
This allocator is designed for use with zram. Thus, the allocator is
|
||||
supposed to work well under low memory conditions. In particular, it
|
||||
never attempts higher order page allocation which is very likely to
|
||||
fail under memory pressure. On the other hand, if we just use single
|
||||
(0-order) pages, it would suffer from very high fragmentation --
|
||||
any object of size PAGE_SIZE/2 or larger would occupy an entire page.
|
||||
This was one of the major issues with its predecessor (xvmalloc).
|
||||
|
||||
To overcome these issues, zsmalloc allocates a bunch of 0-order pages
|
||||
and links them together using various 'struct page' fields. These linked
|
||||
pages act as a single higher-order page i.e. an object can span 0-order
|
||||
page boundaries. The code refers to these linked pages as a single entity
|
||||
called zspage.
|
||||
|
||||
For simplicity, zsmalloc can only allocate objects of size up to PAGE_SIZE
|
||||
since this satisfies the requirements of all its current users (in the
|
||||
worst case, page is incompressible and is thus stored "as-is" i.e. in
|
||||
uncompressed form). For allocation requests larger than this size, failure
|
||||
is returned (see zs_malloc).
|
||||
|
||||
Additionally, zs_malloc() does not return a dereferenceable pointer.
|
||||
Instead, it returns an opaque handle (unsigned long) which encodes actual
|
||||
location of the allocated object. The reason for this indirection is that
|
||||
zsmalloc does not keep zspages permanently mapped since that would cause
|
||||
issues on 32-bit systems where the VA region for kernel space mappings
|
||||
is very small. So, before using the allocating memory, the object has to
|
||||
be mapped using zs_map_object() to get a usable pointer and subsequently
|
||||
unmapped using zs_unmap_object().
|
||||
|
||||
stat
|
||||
----
|
||||
|
||||
With CONFIG_ZSMALLOC_STAT, we could see zsmalloc internal information via
|
||||
/sys/kernel/debug/zsmalloc/<user name>. Here is a sample of stat output:
|
||||
|
||||
# cat /sys/kernel/debug/zsmalloc/zram0/classes
|
||||
|
||||
class size almost_full almost_empty obj_allocated obj_used pages_used pages_per_zspage
|
||||
..
|
||||
..
|
||||
9 176 0 1 186 129 8 4
|
||||
10 192 1 0 2880 2872 135 3
|
||||
11 208 0 1 819 795 42 2
|
||||
12 224 0 1 219 159 12 4
|
||||
..
|
||||
..
|
||||
|
||||
|
||||
class: index
|
||||
size: object size zspage stores
|
||||
almost_empty: the number of ZS_ALMOST_EMPTY zspages(see below)
|
||||
almost_full: the number of ZS_ALMOST_FULL zspages(see below)
|
||||
obj_allocated: the number of objects allocated
|
||||
obj_used: the number of objects allocated to the user
|
||||
pages_used: the number of pages allocated for the class
|
||||
pages_per_zspage: the number of 0-order pages to make a zspage
|
||||
|
||||
We assign a zspage to ZS_ALMOST_EMPTY fullness group when:
|
||||
n <= N / f, where
|
||||
n = number of allocated objects
|
||||
N = total number of objects zspage can store
|
||||
f = fullness_threshold_frac(ie, 4 at the moment)
|
||||
|
||||
Similarly, we assign zspage to:
|
||||
ZS_ALMOST_FULL when n > N / f
|
||||
ZS_EMPTY when n == 0
|
||||
ZS_FULL when n == N
|
||||
+37
-38
@@ -625,16 +625,16 @@ F: drivers/iommu/amd_iommu*.[ch]
|
||||
F: include/linux/amd-iommu.h
|
||||
|
||||
AMD KFD
|
||||
M: Oded Gabbay <oded.gabbay@amd.com>
|
||||
L: dri-devel@lists.freedesktop.org
|
||||
T: git git://people.freedesktop.org/~gabbayo/linux.git
|
||||
S: Supported
|
||||
F: drivers/gpu/drm/amd/amdkfd/
|
||||
M: Oded Gabbay <oded.gabbay@amd.com>
|
||||
L: dri-devel@lists.freedesktop.org
|
||||
T: git git://people.freedesktop.org/~gabbayo/linux.git
|
||||
S: Supported
|
||||
F: drivers/gpu/drm/amd/amdkfd/
|
||||
F: drivers/gpu/drm/amd/include/cik_structs.h
|
||||
F: drivers/gpu/drm/amd/include/kgd_kfd_interface.h
|
||||
F: drivers/gpu/drm/radeon/radeon_kfd.c
|
||||
F: drivers/gpu/drm/radeon/radeon_kfd.h
|
||||
F: include/uapi/linux/kfd_ioctl.h
|
||||
F: drivers/gpu/drm/radeon/radeon_kfd.c
|
||||
F: drivers/gpu/drm/radeon/radeon_kfd.h
|
||||
F: include/uapi/linux/kfd_ioctl.h
|
||||
|
||||
AMD MICROCODE UPDATE SUPPORT
|
||||
M: Borislav Petkov <bp@alien8.de>
|
||||
@@ -1915,16 +1915,14 @@ S: Maintained
|
||||
F: drivers/media/radio/radio-aztech*
|
||||
|
||||
B43 WIRELESS DRIVER
|
||||
M: Stefano Brivio <stefano.brivio@polimi.it>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
L: b43-dev@lists.infradead.org
|
||||
W: http://wireless.kernel.org/en/users/Drivers/b43
|
||||
S: Maintained
|
||||
S: Odd Fixes
|
||||
F: drivers/net/wireless/b43/
|
||||
|
||||
B43LEGACY WIRELESS DRIVER
|
||||
M: Larry Finger <Larry.Finger@lwfinger.net>
|
||||
M: Stefano Brivio <stefano.brivio@polimi.it>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
L: b43-dev@lists.infradead.org
|
||||
W: http://wireless.kernel.org/en/users/Drivers/b43
|
||||
@@ -1967,10 +1965,10 @@ F: Documentation/filesystems/befs.txt
|
||||
F: fs/befs/
|
||||
|
||||
BECKHOFF CX5020 ETHERCAT MASTER DRIVER
|
||||
M: Dariusz Marcinkiewicz <reksio@newterm.pl>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/ec_bhf.c
|
||||
M: Dariusz Marcinkiewicz <reksio@newterm.pl>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/ec_bhf.c
|
||||
|
||||
BFS FILE SYSTEM
|
||||
M: "Tigran A. Aivazian" <tigran@aivazian.fsnet.co.uk>
|
||||
@@ -2896,11 +2894,11 @@ S: Supported
|
||||
F: drivers/net/ethernet/chelsio/cxgb3/
|
||||
|
||||
CXGB3 ISCSI DRIVER (CXGB3I)
|
||||
M: Karen Xie <kxie@chelsio.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
W: http://www.chelsio.com
|
||||
S: Supported
|
||||
F: drivers/scsi/cxgbi/cxgb3i
|
||||
M: Karen Xie <kxie@chelsio.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
W: http://www.chelsio.com
|
||||
S: Supported
|
||||
F: drivers/scsi/cxgbi/cxgb3i
|
||||
|
||||
CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
|
||||
M: Steve Wise <swise@chelsio.com>
|
||||
@@ -2917,11 +2915,11 @@ S: Supported
|
||||
F: drivers/net/ethernet/chelsio/cxgb4/
|
||||
|
||||
CXGB4 ISCSI DRIVER (CXGB4I)
|
||||
M: Karen Xie <kxie@chelsio.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
W: http://www.chelsio.com
|
||||
S: Supported
|
||||
F: drivers/scsi/cxgbi/cxgb4i
|
||||
M: Karen Xie <kxie@chelsio.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
W: http://www.chelsio.com
|
||||
S: Supported
|
||||
F: drivers/scsi/cxgbi/cxgb4i
|
||||
|
||||
CXGB4 IWARP RNIC DRIVER (IW_CXGB4)
|
||||
M: Steve Wise <swise@chelsio.com>
|
||||
@@ -5223,7 +5221,7 @@ F: arch/x86/kernel/tboot.c
|
||||
INTEL WIRELESS WIMAX CONNECTION 2400
|
||||
M: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
|
||||
M: linux-wimax@intel.com
|
||||
L: wimax@linuxwimax.org (subscribers-only)
|
||||
L: wimax@linuxwimax.org (subscribers-only)
|
||||
S: Supported
|
||||
W: http://linuxwimax.org
|
||||
F: Documentation/wimax/README.i2400m
|
||||
@@ -5926,7 +5924,7 @@ F: arch/powerpc/platforms/512x/
|
||||
F: arch/powerpc/platforms/52xx/
|
||||
|
||||
LINUX FOR POWERPC EMBEDDED PPC4XX
|
||||
M: Alistair Popple <alistair@popple.id.au>
|
||||
M: Alistair Popple <alistair@popple.id.au>
|
||||
M: Matt Porter <mporter@kernel.crashing.org>
|
||||
W: http://www.penguinppc.org/
|
||||
L: linuxppc-dev@lists.ozlabs.org
|
||||
@@ -6399,7 +6397,7 @@ S: Supported
|
||||
F: drivers/watchdog/mena21_wdt.c
|
||||
|
||||
MEN CHAMELEON BUS (mcb)
|
||||
M: Johannes Thumshirn <johannes.thumshirn@men.de>
|
||||
M: Johannes Thumshirn <johannes.thumshirn@men.de>
|
||||
S: Supported
|
||||
F: drivers/mcb/
|
||||
F: include/linux/mcb.h
|
||||
@@ -7955,10 +7953,10 @@ L: rtc-linux@googlegroups.com
|
||||
S: Maintained
|
||||
|
||||
QAT DRIVER
|
||||
M: Tadeusz Struk <tadeusz.struk@intel.com>
|
||||
L: qat-linux@intel.com
|
||||
S: Supported
|
||||
F: drivers/crypto/qat/
|
||||
M: Tadeusz Struk <tadeusz.struk@intel.com>
|
||||
L: qat-linux@intel.com
|
||||
S: Supported
|
||||
F: drivers/crypto/qat/
|
||||
|
||||
QIB DRIVER
|
||||
M: Mike Marciniszyn <infinipath@intel.com>
|
||||
@@ -10129,11 +10127,11 @@ F: include/linux/cdrom.h
|
||||
F: include/uapi/linux/cdrom.h
|
||||
|
||||
UNISYS S-PAR DRIVERS
|
||||
M: Benjamin Romer <benjamin.romer@unisys.com>
|
||||
M: David Kershner <david.kershner@unisys.com>
|
||||
L: sparmaintainer@unisys.com (Unisys internal)
|
||||
S: Supported
|
||||
F: drivers/staging/unisys/
|
||||
M: Benjamin Romer <benjamin.romer@unisys.com>
|
||||
M: David Kershner <david.kershner@unisys.com>
|
||||
L: sparmaintainer@unisys.com (Unisys internal)
|
||||
S: Supported
|
||||
F: drivers/staging/unisys/
|
||||
|
||||
UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
|
||||
M: Vinayak Holikatti <vinholikatti@gmail.com>
|
||||
@@ -10690,7 +10688,7 @@ F: drivers/media/rc/winbond-cir.c
|
||||
WIMAX STACK
|
||||
M: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
|
||||
M: linux-wimax@intel.com
|
||||
L: wimax@linuxwimax.org (subscribers-only)
|
||||
L: wimax@linuxwimax.org (subscribers-only)
|
||||
S: Supported
|
||||
W: http://linuxwimax.org
|
||||
F: Documentation/wimax/README.wimax
|
||||
@@ -10981,6 +10979,7 @@ L: linux-mm@kvack.org
|
||||
S: Maintained
|
||||
F: mm/zsmalloc.c
|
||||
F: include/linux/zsmalloc.h
|
||||
F: Documentation/vm/zsmalloc.txt
|
||||
|
||||
ZSWAP COMPRESSED SWAP CACHING
|
||||
M: Seth Jennings <sjennings@variantweb.net>
|
||||
|
||||
+52
-57
@@ -51,19 +51,19 @@ static struct dentry *dbgfs_root, *dbgfs_state, **dbgfs_chan;
|
||||
|
||||
static int dbg_show_requester_chan(struct seq_file *s, void *p)
|
||||
{
|
||||
int pos = 0;
|
||||
int chan = (int)s->private;
|
||||
int i;
|
||||
u32 drcmr;
|
||||
|
||||
pos += seq_printf(s, "DMA channel %d requesters list :\n", chan);
|
||||
seq_printf(s, "DMA channel %d requesters list :\n", chan);
|
||||
for (i = 0; i < DMA_MAX_REQUESTERS; i++) {
|
||||
drcmr = DRCMR(i);
|
||||
if ((drcmr & DRCMR_CHLNUM) == chan)
|
||||
pos += seq_printf(s, "\tRequester %d (MAPVLD=%d)\n", i,
|
||||
!!(drcmr & DRCMR_MAPVLD));
|
||||
seq_printf(s, "\tRequester %d (MAPVLD=%d)\n",
|
||||
i, !!(drcmr & DRCMR_MAPVLD));
|
||||
}
|
||||
return pos;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int dbg_burst_from_dcmd(u32 dcmd)
|
||||
@@ -83,7 +83,6 @@ static int is_phys_valid(unsigned long addr)
|
||||
|
||||
static int dbg_show_descriptors(struct seq_file *s, void *p)
|
||||
{
|
||||
int pos = 0;
|
||||
int chan = (int)s->private;
|
||||
int i, max_show = 20, burst, width;
|
||||
u32 dcmd;
|
||||
@@ -94,44 +93,43 @@ static int dbg_show_descriptors(struct seq_file *s, void *p)
|
||||
spin_lock_irqsave(&dma_channels[chan].lock, flags);
|
||||
phys_desc = DDADR(chan);
|
||||
|
||||
pos += seq_printf(s, "DMA channel %d descriptors :\n", chan);
|
||||
pos += seq_printf(s, "[%03d] First descriptor unknown\n", 0);
|
||||
seq_printf(s, "DMA channel %d descriptors :\n", chan);
|
||||
seq_printf(s, "[%03d] First descriptor unknown\n", 0);
|
||||
for (i = 1; i < max_show && is_phys_valid(phys_desc); i++) {
|
||||
desc = phys_to_virt(phys_desc);
|
||||
dcmd = desc->dcmd;
|
||||
burst = dbg_burst_from_dcmd(dcmd);
|
||||
width = (1 << ((dcmd >> 14) & 0x3)) >> 1;
|
||||
|
||||
pos += seq_printf(s, "[%03d] Desc at %08lx(virt %p)\n",
|
||||
i, phys_desc, desc);
|
||||
pos += seq_printf(s, "\tDDADR = %08x\n", desc->ddadr);
|
||||
pos += seq_printf(s, "\tDSADR = %08x\n", desc->dsadr);
|
||||
pos += seq_printf(s, "\tDTADR = %08x\n", desc->dtadr);
|
||||
pos += seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d"
|
||||
" width=%d len=%d)\n",
|
||||
dcmd,
|
||||
DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
|
||||
DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
|
||||
DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
|
||||
DCMD_STR(ENDIAN), burst, width,
|
||||
dcmd & DCMD_LENGTH);
|
||||
seq_printf(s, "[%03d] Desc at %08lx(virt %p)\n",
|
||||
i, phys_desc, desc);
|
||||
seq_printf(s, "\tDDADR = %08x\n", desc->ddadr);
|
||||
seq_printf(s, "\tDSADR = %08x\n", desc->dsadr);
|
||||
seq_printf(s, "\tDTADR = %08x\n", desc->dtadr);
|
||||
seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d len=%d)\n",
|
||||
dcmd,
|
||||
DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
|
||||
DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
|
||||
DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
|
||||
DCMD_STR(ENDIAN), burst, width,
|
||||
dcmd & DCMD_LENGTH);
|
||||
phys_desc = desc->ddadr;
|
||||
}
|
||||
if (i == max_show)
|
||||
pos += seq_printf(s, "[%03d] Desc at %08lx ... max display reached\n",
|
||||
i, phys_desc);
|
||||
seq_printf(s, "[%03d] Desc at %08lx ... max display reached\n",
|
||||
i, phys_desc);
|
||||
else
|
||||
pos += seq_printf(s, "[%03d] Desc at %08lx is %s\n",
|
||||
i, phys_desc, phys_desc == DDADR_STOP ?
|
||||
"DDADR_STOP" : "invalid");
|
||||
seq_printf(s, "[%03d] Desc at %08lx is %s\n",
|
||||
i, phys_desc, phys_desc == DDADR_STOP ?
|
||||
"DDADR_STOP" : "invalid");
|
||||
|
||||
spin_unlock_irqrestore(&dma_channels[chan].lock, flags);
|
||||
return pos;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dbg_show_chan_state(struct seq_file *s, void *p)
|
||||
{
|
||||
int pos = 0;
|
||||
int chan = (int)s->private;
|
||||
u32 dcsr, dcmd;
|
||||
int burst, width;
|
||||
@@ -142,42 +140,39 @@ static int dbg_show_chan_state(struct seq_file *s, void *p)
|
||||
burst = dbg_burst_from_dcmd(dcmd);
|
||||
width = (1 << ((dcmd >> 14) & 0x3)) >> 1;
|
||||
|
||||
pos += seq_printf(s, "DMA channel %d\n", chan);
|
||||
pos += seq_printf(s, "\tPriority : %s\n",
|
||||
str_prio[dma_channels[chan].prio]);
|
||||
pos += seq_printf(s, "\tUnaligned transfer bit: %s\n",
|
||||
DALGN & (1 << chan) ? "yes" : "no");
|
||||
pos += seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n",
|
||||
dcsr, DCSR_STR(RUN), DCSR_STR(NODESC),
|
||||
DCSR_STR(STOPIRQEN), DCSR_STR(EORIRQEN),
|
||||
DCSR_STR(EORJMPEN), DCSR_STR(EORSTOPEN),
|
||||
DCSR_STR(SETCMPST), DCSR_STR(CLRCMPST),
|
||||
DCSR_STR(CMPST), DCSR_STR(EORINTR), DCSR_STR(REQPEND),
|
||||
DCSR_STR(STOPSTATE), DCSR_STR(ENDINTR),
|
||||
DCSR_STR(STARTINTR), DCSR_STR(BUSERR));
|
||||
seq_printf(s, "DMA channel %d\n", chan);
|
||||
seq_printf(s, "\tPriority : %s\n", str_prio[dma_channels[chan].prio]);
|
||||
seq_printf(s, "\tUnaligned transfer bit: %s\n",
|
||||
DALGN & (1 << chan) ? "yes" : "no");
|
||||
seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n",
|
||||
dcsr, DCSR_STR(RUN), DCSR_STR(NODESC),
|
||||
DCSR_STR(STOPIRQEN), DCSR_STR(EORIRQEN),
|
||||
DCSR_STR(EORJMPEN), DCSR_STR(EORSTOPEN),
|
||||
DCSR_STR(SETCMPST), DCSR_STR(CLRCMPST),
|
||||
DCSR_STR(CMPST), DCSR_STR(EORINTR), DCSR_STR(REQPEND),
|
||||
DCSR_STR(STOPSTATE), DCSR_STR(ENDINTR),
|
||||
DCSR_STR(STARTINTR), DCSR_STR(BUSERR));
|
||||
|
||||
pos += seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d"
|
||||
" len=%d)\n",
|
||||
dcmd,
|
||||
DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
|
||||
DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
|
||||
DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
|
||||
DCMD_STR(ENDIAN), burst, width, dcmd & DCMD_LENGTH);
|
||||
pos += seq_printf(s, "\tDSADR = %08x\n", DSADR(chan));
|
||||
pos += seq_printf(s, "\tDTADR = %08x\n", DTADR(chan));
|
||||
pos += seq_printf(s, "\tDDADR = %08x\n", DDADR(chan));
|
||||
return pos;
|
||||
seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d len=%d)\n",
|
||||
dcmd,
|
||||
DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
|
||||
DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
|
||||
DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
|
||||
DCMD_STR(ENDIAN), burst, width, dcmd & DCMD_LENGTH);
|
||||
seq_printf(s, "\tDSADR = %08x\n", DSADR(chan));
|
||||
seq_printf(s, "\tDTADR = %08x\n", DTADR(chan));
|
||||
seq_printf(s, "\tDDADR = %08x\n", DDADR(chan));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dbg_show_state(struct seq_file *s, void *p)
|
||||
{
|
||||
int pos = 0;
|
||||
|
||||
/* basic device status */
|
||||
pos += seq_printf(s, "DMA engine status\n");
|
||||
pos += seq_printf(s, "\tChannel number: %d\n", num_dma_channels);
|
||||
seq_puts(s, "DMA engine status\n");
|
||||
seq_printf(s, "\tChannel number: %d\n", num_dma_channels);
|
||||
|
||||
return pos;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DBGFS_FUNC_DECL(name) \
|
||||
|
||||
@@ -527,7 +527,8 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
i = debug_log_cnt;
|
||||
|
||||
while (i != end_i || debug_log_cnt_wrapped) {
|
||||
if (seq_printf(m, debug_log_string[i], debug_log_value[i]) < 0)
|
||||
seq_printf(m, debug_log_string[i], debug_log_value[i]);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
i = (i+1) % DEBUG_LOG_MAX;
|
||||
}
|
||||
@@ -542,24 +543,22 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS;
|
||||
|
||||
#if 1 //ndef FAST_TIMER_LOG
|
||||
seq_printf(m, "div: %i freq: %i delay: %i"
|
||||
"\n",
|
||||
seq_printf(m, "div: %i freq: %i delay: %i\n",
|
||||
timer_div_settings[cur],
|
||||
timer_freq_settings[cur],
|
||||
timer_delay_settings[cur]);
|
||||
#endif
|
||||
#ifdef FAST_TIMER_LOG
|
||||
t = &timer_started_log[cur];
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -571,16 +570,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
seq_printf(m, "Timers added: %i\n", fast_timers_added);
|
||||
for (i = 0; i < num_to_show; i++) {
|
||||
t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS];
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
}
|
||||
seq_putc(m, '\n');
|
||||
@@ -590,16 +588,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
seq_printf(m, "Timers expired: %i\n", fast_timers_expired);
|
||||
for (i = 0; i < num_to_show; i++) {
|
||||
t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS];
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
}
|
||||
seq_putc(m, '\n');
|
||||
@@ -611,19 +608,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
while (t) {
|
||||
nextt = t->next;
|
||||
local_irq_restore(flags);
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
/* " func: 0x%08lX" */
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data
|
||||
/* , t->function */
|
||||
) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
local_irq_save(flags);
|
||||
if (t->next != nextt)
|
||||
|
||||
@@ -63,35 +63,37 @@ int show_cpuinfo(struct seq_file *m, void *v)
|
||||
else
|
||||
info = &cpu_info[revision];
|
||||
|
||||
return seq_printf(m,
|
||||
"processor\t: 0\n"
|
||||
"cpu\t\t: CRIS\n"
|
||||
"cpu revision\t: %lu\n"
|
||||
"cpu model\t: %s\n"
|
||||
"cache size\t: %d kB\n"
|
||||
"fpu\t\t: %s\n"
|
||||
"mmu\t\t: %s\n"
|
||||
"mmu DMA bug\t: %s\n"
|
||||
"ethernet\t: %s Mbps\n"
|
||||
"token ring\t: %s\n"
|
||||
"scsi\t\t: %s\n"
|
||||
"ata\t\t: %s\n"
|
||||
"usb\t\t: %s\n"
|
||||
"bogomips\t: %lu.%02lu\n",
|
||||
seq_printf(m,
|
||||
"processor\t: 0\n"
|
||||
"cpu\t\t: CRIS\n"
|
||||
"cpu revision\t: %lu\n"
|
||||
"cpu model\t: %s\n"
|
||||
"cache size\t: %d kB\n"
|
||||
"fpu\t\t: %s\n"
|
||||
"mmu\t\t: %s\n"
|
||||
"mmu DMA bug\t: %s\n"
|
||||
"ethernet\t: %s Mbps\n"
|
||||
"token ring\t: %s\n"
|
||||
"scsi\t\t: %s\n"
|
||||
"ata\t\t: %s\n"
|
||||
"usb\t\t: %s\n"
|
||||
"bogomips\t: %lu.%02lu\n",
|
||||
|
||||
revision,
|
||||
info->model,
|
||||
info->cache,
|
||||
info->flags & HAS_FPU ? "yes" : "no",
|
||||
info->flags & HAS_MMU ? "yes" : "no",
|
||||
info->flags & HAS_MMU_BUG ? "yes" : "no",
|
||||
info->flags & HAS_ETHERNET100 ? "10/100" : "10",
|
||||
info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
|
||||
info->flags & HAS_SCSI ? "yes" : "no",
|
||||
info->flags & HAS_ATA ? "yes" : "no",
|
||||
info->flags & HAS_USB ? "yes" : "no",
|
||||
(loops_per_jiffy * HZ + 500) / 500000,
|
||||
((loops_per_jiffy * HZ + 500) / 5000) % 100);
|
||||
revision,
|
||||
info->model,
|
||||
info->cache,
|
||||
info->flags & HAS_FPU ? "yes" : "no",
|
||||
info->flags & HAS_MMU ? "yes" : "no",
|
||||
info->flags & HAS_MMU_BUG ? "yes" : "no",
|
||||
info->flags & HAS_ETHERNET100 ? "10/100" : "10",
|
||||
info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
|
||||
info->flags & HAS_SCSI ? "yes" : "no",
|
||||
info->flags & HAS_ATA ? "yes" : "no",
|
||||
info->flags & HAS_USB ? "yes" : "no",
|
||||
(loops_per_jiffy * HZ + 500) / 500000,
|
||||
((loops_per_jiffy * HZ + 500) / 5000) % 100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
@@ -501,7 +501,8 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
i = debug_log_cnt;
|
||||
|
||||
while ((i != end_i || debug_log_cnt_wrapped)) {
|
||||
if (seq_printf(m, debug_log_string[i], debug_log_value[i]) < 0)
|
||||
seq_printf(m, debug_log_string[i], debug_log_value[i]);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
i = (i+1) % DEBUG_LOG_MAX;
|
||||
}
|
||||
@@ -516,23 +517,21 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS;
|
||||
|
||||
#if 1 //ndef FAST_TIMER_LOG
|
||||
seq_printf(m, "div: %i delay: %i"
|
||||
"\n",
|
||||
seq_printf(m, "div: %i delay: %i\n",
|
||||
timer_div_settings[cur],
|
||||
timer_delay_settings[cur]);
|
||||
#endif
|
||||
#ifdef FAST_TIMER_LOG
|
||||
t = &timer_started_log[cur];
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -544,16 +543,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
seq_printf(m, "Timers added: %i\n", fast_timers_added);
|
||||
for (i = 0; i < num_to_show; i++) {
|
||||
t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS];
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
}
|
||||
seq_putc(m, '\n');
|
||||
@@ -563,16 +561,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
seq_printf(m, "Timers expired: %i\n", fast_timers_expired);
|
||||
for (i = 0; i < num_to_show; i++){
|
||||
t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS];
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
}
|
||||
seq_putc(m, '\n');
|
||||
@@ -584,19 +581,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
|
||||
while (t != NULL){
|
||||
nextt = t->next;
|
||||
local_irq_restore(flags);
|
||||
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
|
||||
"d: %6li us data: 0x%08lX"
|
||||
/* " func: 0x%08lX" */
|
||||
"\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data
|
||||
/* , t->function */
|
||||
) < 0)
|
||||
seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
|
||||
t->name,
|
||||
(unsigned long)t->tv_set.tv_jiff,
|
||||
(unsigned long)t->tv_set.tv_usec,
|
||||
(unsigned long)t->tv_expires.tv_jiff,
|
||||
(unsigned long)t->tv_expires.tv_usec,
|
||||
t->delay_us,
|
||||
t->data);
|
||||
if (seq_has_overflowed(m))
|
||||
return 0;
|
||||
local_irq_save(flags);
|
||||
if (t->next != nextt)
|
||||
|
||||
@@ -77,36 +77,38 @@ int show_cpuinfo(struct seq_file *m, void *v)
|
||||
}
|
||||
}
|
||||
|
||||
return seq_printf(m,
|
||||
"processor\t: %d\n"
|
||||
"cpu\t\t: CRIS\n"
|
||||
"cpu revision\t: %lu\n"
|
||||
"cpu model\t: %s\n"
|
||||
"cache size\t: %d KB\n"
|
||||
"fpu\t\t: %s\n"
|
||||
"mmu\t\t: %s\n"
|
||||
"mmu DMA bug\t: %s\n"
|
||||
"ethernet\t: %s Mbps\n"
|
||||
"token ring\t: %s\n"
|
||||
"scsi\t\t: %s\n"
|
||||
"ata\t\t: %s\n"
|
||||
"usb\t\t: %s\n"
|
||||
"bogomips\t: %lu.%02lu\n\n",
|
||||
seq_printf(m,
|
||||
"processor\t: %d\n"
|
||||
"cpu\t\t: CRIS\n"
|
||||
"cpu revision\t: %lu\n"
|
||||
"cpu model\t: %s\n"
|
||||
"cache size\t: %d KB\n"
|
||||
"fpu\t\t: %s\n"
|
||||
"mmu\t\t: %s\n"
|
||||
"mmu DMA bug\t: %s\n"
|
||||
"ethernet\t: %s Mbps\n"
|
||||
"token ring\t: %s\n"
|
||||
"scsi\t\t: %s\n"
|
||||
"ata\t\t: %s\n"
|
||||
"usb\t\t: %s\n"
|
||||
"bogomips\t: %lu.%02lu\n\n",
|
||||
|
||||
cpu,
|
||||
revision,
|
||||
info->cpu_model,
|
||||
info->cache_size,
|
||||
info->flags & HAS_FPU ? "yes" : "no",
|
||||
info->flags & HAS_MMU ? "yes" : "no",
|
||||
info->flags & HAS_MMU_BUG ? "yes" : "no",
|
||||
info->flags & HAS_ETHERNET100 ? "10/100" : "10",
|
||||
info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
|
||||
info->flags & HAS_SCSI ? "yes" : "no",
|
||||
info->flags & HAS_ATA ? "yes" : "no",
|
||||
info->flags & HAS_USB ? "yes" : "no",
|
||||
(loops_per_jiffy * HZ + 500) / 500000,
|
||||
((loops_per_jiffy * HZ + 500) / 5000) % 100);
|
||||
cpu,
|
||||
revision,
|
||||
info->cpu_model,
|
||||
info->cache_size,
|
||||
info->flags & HAS_FPU ? "yes" : "no",
|
||||
info->flags & HAS_MMU ? "yes" : "no",
|
||||
info->flags & HAS_MMU_BUG ? "yes" : "no",
|
||||
info->flags & HAS_ETHERNET100 ? "10/100" : "10",
|
||||
info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
|
||||
info->flags & HAS_SCSI ? "yes" : "no",
|
||||
info->flags & HAS_ATA ? "yes" : "no",
|
||||
info->flags & HAS_USB ? "yes" : "no",
|
||||
(loops_per_jiffy * HZ + 500) / 500000,
|
||||
((loops_per_jiffy * HZ + 500) / 5000) % 100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
static int show_cpuinfo(struct seq_file *m, void *v)
|
||||
{
|
||||
int count = 0;
|
||||
char *fpga_family = "Unknown";
|
||||
char *cpu_ver = "Unknown";
|
||||
int i;
|
||||
@@ -48,91 +47,89 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
||||
}
|
||||
}
|
||||
|
||||
count = seq_printf(m,
|
||||
"CPU-Family: MicroBlaze\n"
|
||||
"FPGA-Arch: %s\n"
|
||||
"CPU-Ver: %s, %s endian\n"
|
||||
"CPU-MHz: %d.%02d\n"
|
||||
"BogoMips: %lu.%02lu\n",
|
||||
fpga_family,
|
||||
cpu_ver,
|
||||
cpuinfo.endian ? "little" : "big",
|
||||
cpuinfo.cpu_clock_freq /
|
||||
1000000,
|
||||
cpuinfo.cpu_clock_freq %
|
||||
1000000,
|
||||
loops_per_jiffy / (500000 / HZ),
|
||||
(loops_per_jiffy / (5000 / HZ)) % 100);
|
||||
seq_printf(m,
|
||||
"CPU-Family: MicroBlaze\n"
|
||||
"FPGA-Arch: %s\n"
|
||||
"CPU-Ver: %s, %s endian\n"
|
||||
"CPU-MHz: %d.%02d\n"
|
||||
"BogoMips: %lu.%02lu\n",
|
||||
fpga_family,
|
||||
cpu_ver,
|
||||
cpuinfo.endian ? "little" : "big",
|
||||
cpuinfo.cpu_clock_freq / 1000000,
|
||||
cpuinfo.cpu_clock_freq % 1000000,
|
||||
loops_per_jiffy / (500000 / HZ),
|
||||
(loops_per_jiffy / (5000 / HZ)) % 100);
|
||||
|
||||
count += seq_printf(m,
|
||||
"HW:\n Shift:\t\t%s\n"
|
||||
" MSR:\t\t%s\n"
|
||||
" PCMP:\t\t%s\n"
|
||||
" DIV:\t\t%s\n",
|
||||
(cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no",
|
||||
(cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no",
|
||||
(cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no",
|
||||
(cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no");
|
||||
seq_printf(m,
|
||||
"HW:\n Shift:\t\t%s\n"
|
||||
" MSR:\t\t%s\n"
|
||||
" PCMP:\t\t%s\n"
|
||||
" DIV:\t\t%s\n",
|
||||
(cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no",
|
||||
(cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no",
|
||||
(cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no",
|
||||
(cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no");
|
||||
|
||||
count += seq_printf(m,
|
||||
" MMU:\t\t%x\n",
|
||||
cpuinfo.mmu);
|
||||
seq_printf(m, " MMU:\t\t%x\n", cpuinfo.mmu);
|
||||
|
||||
count += seq_printf(m,
|
||||
" MUL:\t\t%s\n"
|
||||
" FPU:\t\t%s\n",
|
||||
(cpuinfo.use_mult & PVR2_USE_MUL64_MASK) ? "v2" :
|
||||
(cpuinfo.use_mult & PVR0_USE_HW_MUL_MASK) ? "v1" : "no",
|
||||
(cpuinfo.use_fpu & PVR2_USE_FPU2_MASK) ? "v2" :
|
||||
(cpuinfo.use_fpu & PVR0_USE_FPU_MASK) ? "v1" : "no");
|
||||
seq_printf(m,
|
||||
" MUL:\t\t%s\n"
|
||||
" FPU:\t\t%s\n",
|
||||
(cpuinfo.use_mult & PVR2_USE_MUL64_MASK) ? "v2" :
|
||||
(cpuinfo.use_mult & PVR0_USE_HW_MUL_MASK) ? "v1" : "no",
|
||||
(cpuinfo.use_fpu & PVR2_USE_FPU2_MASK) ? "v2" :
|
||||
(cpuinfo.use_fpu & PVR0_USE_FPU_MASK) ? "v1" : "no");
|
||||
|
||||
count += seq_printf(m,
|
||||
" Exc:\t\t%s%s%s%s%s%s%s%s\n",
|
||||
(cpuinfo.use_exc & PVR2_OPCODE_0x0_ILL_MASK) ? "op0x0 " : "",
|
||||
(cpuinfo.use_exc & PVR2_UNALIGNED_EXC_MASK) ? "unal " : "",
|
||||
(cpuinfo.use_exc & PVR2_ILL_OPCODE_EXC_MASK) ? "ill " : "",
|
||||
(cpuinfo.use_exc & PVR2_IOPB_BUS_EXC_MASK) ? "iopb " : "",
|
||||
(cpuinfo.use_exc & PVR2_DOPB_BUS_EXC_MASK) ? "dopb " : "",
|
||||
(cpuinfo.use_exc & PVR2_DIV_ZERO_EXC_MASK) ? "zero " : "",
|
||||
(cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "",
|
||||
(cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : "");
|
||||
seq_printf(m,
|
||||
" Exc:\t\t%s%s%s%s%s%s%s%s\n",
|
||||
(cpuinfo.use_exc & PVR2_OPCODE_0x0_ILL_MASK) ? "op0x0 " : "",
|
||||
(cpuinfo.use_exc & PVR2_UNALIGNED_EXC_MASK) ? "unal " : "",
|
||||
(cpuinfo.use_exc & PVR2_ILL_OPCODE_EXC_MASK) ? "ill " : "",
|
||||
(cpuinfo.use_exc & PVR2_IOPB_BUS_EXC_MASK) ? "iopb " : "",
|
||||
(cpuinfo.use_exc & PVR2_DOPB_BUS_EXC_MASK) ? "dopb " : "",
|
||||
(cpuinfo.use_exc & PVR2_DIV_ZERO_EXC_MASK) ? "zero " : "",
|
||||
(cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "",
|
||||
(cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : "");
|
||||
|
||||
count += seq_printf(m,
|
||||
"Stream-insns:\t%sprivileged\n",
|
||||
cpuinfo.mmu_privins ? "un" : "");
|
||||
seq_printf(m,
|
||||
"Stream-insns:\t%sprivileged\n",
|
||||
cpuinfo.mmu_privins ? "un" : "");
|
||||
|
||||
if (cpuinfo.use_icache)
|
||||
count += seq_printf(m,
|
||||
"Icache:\t\t%ukB\tline length:\t%dB\n",
|
||||
cpuinfo.icache_size >> 10,
|
||||
cpuinfo.icache_line_length);
|
||||
seq_printf(m,
|
||||
"Icache:\t\t%ukB\tline length:\t%dB\n",
|
||||
cpuinfo.icache_size >> 10,
|
||||
cpuinfo.icache_line_length);
|
||||
else
|
||||
count += seq_printf(m, "Icache:\t\tno\n");
|
||||
seq_puts(m, "Icache:\t\tno\n");
|
||||
|
||||
if (cpuinfo.use_dcache) {
|
||||
count += seq_printf(m,
|
||||
"Dcache:\t\t%ukB\tline length:\t%dB\n",
|
||||
cpuinfo.dcache_size >> 10,
|
||||
cpuinfo.dcache_line_length);
|
||||
seq_printf(m, "Dcache-Policy:\t");
|
||||
seq_printf(m,
|
||||
"Dcache:\t\t%ukB\tline length:\t%dB\n",
|
||||
cpuinfo.dcache_size >> 10,
|
||||
cpuinfo.dcache_line_length);
|
||||
seq_puts(m, "Dcache-Policy:\t");
|
||||
if (cpuinfo.dcache_wb)
|
||||
count += seq_printf(m, "write-back\n");
|
||||
seq_puts(m, "write-back\n");
|
||||
else
|
||||
count += seq_printf(m, "write-through\n");
|
||||
} else
|
||||
count += seq_printf(m, "Dcache:\t\tno\n");
|
||||
seq_puts(m, "write-through\n");
|
||||
} else {
|
||||
seq_puts(m, "Dcache:\t\tno\n");
|
||||
}
|
||||
|
||||
count += seq_printf(m,
|
||||
"HW-Debug:\t%s\n",
|
||||
cpuinfo.hw_debug ? "yes" : "no");
|
||||
seq_printf(m,
|
||||
"HW-Debug:\t%s\n",
|
||||
cpuinfo.hw_debug ? "yes" : "no");
|
||||
|
||||
count += seq_printf(m,
|
||||
"PVR-USR1:\t%02x\n"
|
||||
"PVR-USR2:\t%08x\n",
|
||||
cpuinfo.pvr_user1,
|
||||
cpuinfo.pvr_user2);
|
||||
seq_printf(m,
|
||||
"PVR-USR1:\t%02x\n"
|
||||
"PVR-USR2:\t%08x\n",
|
||||
cpuinfo.pvr_user1,
|
||||
cpuinfo.pvr_user2);
|
||||
|
||||
seq_printf(m, "Page size:\t%lu\n", PAGE_SIZE);
|
||||
|
||||
count += seq_printf(m, "Page size:\t%lu\n", PAGE_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+34
-35
@@ -126,47 +126,46 @@ void __init setup_cpuinfo(void)
|
||||
*/
|
||||
static int show_cpuinfo(struct seq_file *m, void *v)
|
||||
{
|
||||
int count = 0;
|
||||
const u32 clockfreq = cpuinfo.cpu_clock_freq;
|
||||
|
||||
count = seq_printf(m,
|
||||
"CPU:\t\tNios II/%s\n"
|
||||
"MMU:\t\t%s\n"
|
||||
"FPU:\t\tnone\n"
|
||||
"Clocking:\t%u.%02u MHz\n"
|
||||
"BogoMips:\t%lu.%02lu\n"
|
||||
"Calibration:\t%lu loops\n",
|
||||
cpuinfo.cpu_impl,
|
||||
cpuinfo.mmu ? "present" : "none",
|
||||
clockfreq / 1000000, (clockfreq / 100000) % 10,
|
||||
(loops_per_jiffy * HZ) / 500000,
|
||||
((loops_per_jiffy * HZ) / 5000) % 100,
|
||||
(loops_per_jiffy * HZ));
|
||||
seq_printf(m,
|
||||
"CPU:\t\tNios II/%s\n"
|
||||
"MMU:\t\t%s\n"
|
||||
"FPU:\t\tnone\n"
|
||||
"Clocking:\t%u.%02u MHz\n"
|
||||
"BogoMips:\t%lu.%02lu\n"
|
||||
"Calibration:\t%lu loops\n",
|
||||
cpuinfo.cpu_impl,
|
||||
cpuinfo.mmu ? "present" : "none",
|
||||
clockfreq / 1000000, (clockfreq / 100000) % 10,
|
||||
(loops_per_jiffy * HZ) / 500000,
|
||||
((loops_per_jiffy * HZ) / 5000) % 100,
|
||||
(loops_per_jiffy * HZ));
|
||||
|
||||
count += seq_printf(m,
|
||||
"HW:\n"
|
||||
" MUL:\t\t%s\n"
|
||||
" MULX:\t\t%s\n"
|
||||
" DIV:\t\t%s\n",
|
||||
cpuinfo.has_mul ? "yes" : "no",
|
||||
cpuinfo.has_mulx ? "yes" : "no",
|
||||
cpuinfo.has_div ? "yes" : "no");
|
||||
seq_printf(m,
|
||||
"HW:\n"
|
||||
" MUL:\t\t%s\n"
|
||||
" MULX:\t\t%s\n"
|
||||
" DIV:\t\t%s\n",
|
||||
cpuinfo.has_mul ? "yes" : "no",
|
||||
cpuinfo.has_mulx ? "yes" : "no",
|
||||
cpuinfo.has_div ? "yes" : "no");
|
||||
|
||||
count += seq_printf(m,
|
||||
"Icache:\t\t%ukB, line length: %u\n",
|
||||
cpuinfo.icache_size >> 10,
|
||||
cpuinfo.icache_line_size);
|
||||
seq_printf(m,
|
||||
"Icache:\t\t%ukB, line length: %u\n",
|
||||
cpuinfo.icache_size >> 10,
|
||||
cpuinfo.icache_line_size);
|
||||
|
||||
count += seq_printf(m,
|
||||
"Dcache:\t\t%ukB, line length: %u\n",
|
||||
cpuinfo.dcache_size >> 10,
|
||||
cpuinfo.dcache_line_size);
|
||||
seq_printf(m,
|
||||
"Dcache:\t\t%ukB, line length: %u\n",
|
||||
cpuinfo.dcache_size >> 10,
|
||||
cpuinfo.dcache_line_size);
|
||||
|
||||
count += seq_printf(m,
|
||||
"TLB:\t\t%u ways, %u entries, %u PID bits\n",
|
||||
cpuinfo.tlb_num_ways,
|
||||
cpuinfo.tlb_num_entries,
|
||||
cpuinfo.tlb_pid_num_bits);
|
||||
seq_printf(m,
|
||||
"TLB:\t\t%u ways, %u entries, %u PID bits\n",
|
||||
cpuinfo.tlb_num_ways,
|
||||
cpuinfo.tlb_num_entries,
|
||||
cpuinfo.tlb_pid_num_bits);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -329,30 +329,32 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
||||
version = (vr & SPR_VR_VER) >> 24;
|
||||
revision = vr & SPR_VR_REV;
|
||||
|
||||
return seq_printf(m,
|
||||
"cpu\t\t: OpenRISC-%x\n"
|
||||
"revision\t: %d\n"
|
||||
"frequency\t: %ld\n"
|
||||
"dcache size\t: %d bytes\n"
|
||||
"dcache block size\t: %d bytes\n"
|
||||
"icache size\t: %d bytes\n"
|
||||
"icache block size\t: %d bytes\n"
|
||||
"immu\t\t: %d entries, %lu ways\n"
|
||||
"dmmu\t\t: %d entries, %lu ways\n"
|
||||
"bogomips\t: %lu.%02lu\n",
|
||||
version,
|
||||
revision,
|
||||
loops_per_jiffy * HZ,
|
||||
cpuinfo.dcache_size,
|
||||
cpuinfo.dcache_block_size,
|
||||
cpuinfo.icache_size,
|
||||
cpuinfo.icache_block_size,
|
||||
1 << ((mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTS) >> 2),
|
||||
1 + (mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTW),
|
||||
1 << ((mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTS) >> 2),
|
||||
1 + (mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTW),
|
||||
(loops_per_jiffy * HZ) / 500000,
|
||||
((loops_per_jiffy * HZ) / 5000) % 100);
|
||||
seq_printf(m,
|
||||
"cpu\t\t: OpenRISC-%x\n"
|
||||
"revision\t: %d\n"
|
||||
"frequency\t: %ld\n"
|
||||
"dcache size\t: %d bytes\n"
|
||||
"dcache block size\t: %d bytes\n"
|
||||
"icache size\t: %d bytes\n"
|
||||
"icache block size\t: %d bytes\n"
|
||||
"immu\t\t: %d entries, %lu ways\n"
|
||||
"dmmu\t\t: %d entries, %lu ways\n"
|
||||
"bogomips\t: %lu.%02lu\n",
|
||||
version,
|
||||
revision,
|
||||
loops_per_jiffy * HZ,
|
||||
cpuinfo.dcache_size,
|
||||
cpuinfo.dcache_block_size,
|
||||
cpuinfo.icache_size,
|
||||
cpuinfo.icache_block_size,
|
||||
1 << ((mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTS) >> 2),
|
||||
1 + (mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTW),
|
||||
1 << ((mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTS) >> 2),
|
||||
1 + (mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTW),
|
||||
(loops_per_jiffy * HZ) / 500000,
|
||||
((loops_per_jiffy * HZ) / 5000) % 100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *c_start(struct seq_file *m, loff_t * pos)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user