opnsense-src/sys/compat/linuxkpi/common/include/asm
Jean-Sébastien Pédron 1e99b2ee90
linuxkpi: Fix uses of pmap_change_attr()
[Why]
This function takes an offset and a length as argument, not a physical
address and a number of pages.

This misuse caused the `set_memory_*()` and
`arch_io_reserve_memtype_wc()` functions to return EINVAL.

Another problem was the fact that they returned errors as a positive
integer, whereas Linux uses negative integers.

[How]
Physical addresses and number of pages are converted to offset+length in
the `set_memory_*()` functions.

`arch_io_reserve_memtype_wc()` now calls `pmap_change_attr()` directly
instead of using `set_memory_wc()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D42053
2023-10-03 22:13:52 +02:00
..
fpu spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
atomic-long.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
atomic.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
atomic64.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
barrier.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
byteorder.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
cpufeature.h LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards 2022-01-10 22:49:38 +03:00
fcntl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
intel-family.h linuxkpi: Add alderlake defines in intel-family 2023-03-28 10:57:13 +02:00
io.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
iosf_mbi.h linuxkpi: Add asm/iosfmbi.h 2022-06-29 09:55:19 +02:00
memtype.h linuxkpi: Define pat_enabled() 2023-03-21 23:36:40 +01:00
msr.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
neon.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pgtable.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
processor.h linuxkpi: Define cpu_data(cpu) 2023-02-13 22:09:32 +01:00
set_memory.h linuxkpi: Fix uses of pmap_change_attr() 2023-10-03 22:13:52 +02:00
smp.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
types.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uaccess.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
unaligned.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00