diff options
Diffstat (limited to 'kernel/src/utils')
| -rw-r--r-- | kernel/src/utils/align.hpp | 4 | ||||
| -rw-r--r-- | kernel/src/utils/ringbuffer.hpp | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/kernel/src/utils/align.hpp b/kernel/src/utils/align.hpp index 2f2c665..f361185 100644 --- a/kernel/src/utils/align.hpp +++ b/kernel/src/utils/align.hpp @@ -1,2 +1,4 @@ #define ALIGNUP(VALUE, c) ((VALUE + c - 1) & ~(c - 1)) -#define ALIGNDOWN(VALUE, c) ((VALUE / c) * c)
\ No newline at end of file +#define ALIGNDOWN(VALUE, c) ((VALUE / c) * c) +#define ALIGNPAGEUP(VALUE) ALIGNUP(VALUE, 4096) +#define ALIGNPAGEDOWN(VALUE) ALIGNDOWN(VALUE, 4096)
\ No newline at end of file diff --git a/kernel/src/utils/ringbuffer.hpp b/kernel/src/utils/ringbuffer.hpp index d6f6c2c..12b2ef2 100644 --- a/kernel/src/utils/ringbuffer.hpp +++ b/kernel/src/utils/ringbuffer.hpp @@ -46,8 +46,6 @@ namespace utils { objs[tail].cycle = cycle; objs[tail].data = item; - write_counter++; - if (++tail == size) { tail = 0; cycle = !cycle; @@ -69,7 +67,6 @@ namespace utils { while (count < max && objs[q].cycle == (std::uint32_t)c) { out[count] = objs[q].data; - read_counter++; if (++q == size) { q = 0; @@ -85,7 +82,6 @@ namespace utils { return count; } - std::uint64_t get_write_count() const { return write_counter; } }; }
\ No newline at end of file |
