ladybird/Kernel/Net
Liav A 05ba034000 Kernel: Introduce the IOWindow class
This class is intended to replace all IOAddress usages in the Kernel
codebase altogether. The idea is to ensure IO can be done in
arch-specific manner that is determined mostly in compile-time, but to
still be able to use most of the Kernel code in non-x86 builds. Specific
devices that rely on x86-specific IO instructions are already placed in
the Arch/x86 directory and are omitted for non-x86 builds.

The reason this works so well is the fact that x86 IO space acts in a
similar fashion to the traditional memory space being available in most
CPU architectures - the x86 IO space is essentially just an array of
bytes like the physical memory address space, but requires x86 IO
instructions to load and store data. Therefore, many devices allow host
software to interact with the hardware registers in both ways, with a
noticeable trend even in the modern x86 hardware to move away from the
old x86 IO space to exclusively using memory-mapped IO.

Therefore, the IOWindow class encapsulates both methods for x86 builds.
The idea is to allow PCI devices to be used in either way in x86 builds,
so when trying to map an IOWindow on a PCI BAR, the Kernel will try to
find the proper method being declared with the PCI BAR flags.
For old PCI hardware on non-x86 builds this might turn into a problem as
we can't use port mapped IO, so the Kernel will gracefully fail with
ENOTSUP error code if that's the case, as there's really nothing we can
do within such case.

For general IO, the read{8,16,32} and write{8,16,32} methods are
available as a convenient API for other places in the Kernel. There are
simply no direct 64-bit IO API methods yet, as it's not needed right now
and is not considered to be Arch-agnostic too - the x86 IO space doesn't
support generating 64 bit cycle on IO bus and instead requires two 2
32-bit accesses. If for whatever reason it appears to be necessary to do
IO in such manner, it could probably be added with some neat tricks to
do so. It is recommended to use Memory::TypedMapping struct if direct 64
bit IO is actually needed.
2022-09-23 17:22:15 +01:00
..
Intel Kernel: Introduce the IOWindow class 2022-09-23 17:22:15 +01:00
NE2000 Kernel: Introduce the IOWindow class 2022-09-23 17:22:15 +01:00
Realtek Kernel: Introduce the IOWindow class 2022-09-23 17:22:15 +01:00
ARP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
EthernetFrameHeader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
EtherType.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ICMP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
IPv4.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
IPv4Socket.cpp Kernel: Use Process::credentials() and remove user ID/group ID helpers 2022-08-22 12:46:32 +02:00
IPv4Socket.h Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy 2022-08-21 16:45:42 +02:00
IPv4SocketTuple.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LocalSocket.cpp Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy 2022-08-21 16:45:42 +02:00
LocalSocket.h Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy 2022-08-21 16:45:42 +02:00
LoopbackAdapter.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
LoopbackAdapter.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
NetworkAdapter.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
NetworkAdapter.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
NetworkingManagement.cpp Kernel: Introduce the IOWindow class 2022-09-23 17:22:15 +01:00
NetworkingManagement.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
NetworkTask.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
NetworkTask.h Kernel: Avoid deadlock when trying to send packets from the NetworkTask 2021-04-30 23:11:56 +02:00
Routing.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Routing.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Socket.cpp Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy 2022-08-21 16:45:42 +02:00
Socket.h Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy 2022-08-21 16:45:42 +02:00
TCP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
TCPSocket.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
TCPSocket.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
UDP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
UDPSocket.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
UDPSocket.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00