summaryrefslogtreecommitdiff
path: root/Kernel/DoubleBuffer.h
AgeCommit message (Collapse)Author
2019-10-18Revert "Kernel: Make DoubleBuffer use a KBuffer instead of kmalloc()ing"Andreas Kling
This reverts commit 1cca5142afbd76833deedfdb238230ac53424855. This appears to be causing intermittent triple-faults and I don't know why yet, so I'll just revert it to keep the tree in decent shape.
2019-10-18Kernel: Make DoubleBuffer use a KBuffer instead of kmalloc()ingAndreas Kling
Background: DoubleBuffer is a handy buffer class in the kernel that allows you to keep writing to it from the "outside" while the "inside" reads from it. It's used for things like LocalSocket and PTY's. Internally, it has a read buffer and a write buffer, but the two will swap places when the read buffer is exhausted (by reading from it.) Before this patch, it was internally implemented as two Vector<u8> that we would swap between when the reader side had exhausted the data in the read buffer. Now instead we preallocate a large KBuffer (64KB*2) on DoubleBuffer construction and use that throughout its lifetime. This removes all the kmalloc heap traffic caused by DoubleBuffers :^)
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-05-02Kernel: Assign Lock names in class member initializers.Andreas Kling
2019-03-16Move Lock from AK to Kernel, since it only works inside the kernel.Andreas Kling
2019-02-25Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.Andreas Kling
Dealing with the unsigned overflow propagation here just seems unreasonably error prone. Let's limit ourselves to 2GB buffer sizes instead.
2019-02-07Kernel: When a lock is busy, donate remaining process ticks to lock holder.Andreas Kling
Since we know who's holding the lock, and we're gonna have to yield anyway, we can just ask the scheduler to donate any remaining ticks to that process.
2019-01-17Rename SpinLock to Lock. It hasn't been a SpinLock for some time.Andreas Kling
I'm pretty happy with the mechanism of AK::Lock for now.
2019-01-15Add internal locking to DoubleBuffer.Andreas Kling
2019-01-15Allow character devices to block write attempts until there is more space.Andreas Kling
2018-12-21Yet another pass of style fixes.Andreas Kling
2018-12-03Move DoubleBuffer to its own files.Andreas Kling