diff options
| author | Simon Rettberg | 2026-01-28 12:53:53 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2026-01-28 12:53:53 +0100 |
| commit | 8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch) | |
| tree | a8b359e59196be5b2e3862bed189107f4bc9975f /src/tests/iobuf_test.c | |
| parent | Merge branch 'master' into openslx (diff) | |
| parent | [prefix] Make unlzma.S compatible with 386 class CPUs (diff) | |
| download | ipxe-openslx.tar.gz ipxe-openslx.tar.xz ipxe-openslx.zip | |
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/tests/iobuf_test.c')
| -rw-r--r-- | src/tests/iobuf_test.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tests/iobuf_test.c b/src/tests/iobuf_test.c index a417c2e8c..27fbccf0d 100644 --- a/src/tests/iobuf_test.c +++ b/src/tests/iobuf_test.c @@ -62,7 +62,7 @@ static inline void alloc_iob_okx ( size_t len, size_t align, size_t offset, "offset %#zx\n", iobuf, virt_to_phys ( iobuf->data ), iob_tailroom ( iobuf ), len, align, offset ); - /* Validate requested length and alignment */ + /* Validate requested length and data alignment */ okx ( ( ( ( intptr_t ) iobuf ) & ( __alignof__ ( *iobuf ) - 1 ) ) == 0, file, line ); okx ( iob_tailroom ( iobuf ) >= len, file, line ); @@ -70,6 +70,12 @@ static inline void alloc_iob_okx ( size_t len, size_t align, size_t offset, ( ( virt_to_phys ( iobuf->data ) & ( align - 1 ) ) == ( offset & ( align - 1 ) ) ) ), file, line ); + /* Validate overall buffer alignment */ + okx ( ( ( ( intptr_t ) iobuf->head ) & ( IOB_ZLEN - 1 ) ) == 0, + file, line ); + okx ( ( ( ( intptr_t ) iobuf->end ) & ( IOB_ZLEN - 1 ) ) == 0, + file, line ); + /* Overwrite entire content of I/O buffer (for Valgrind) */ memset ( iob_put ( iobuf, len ), 0x55, len ); |
