Changeset ffccdff0 in mainline for boot/generic/src/balloc.c


Ignore:
Timestamp:
2020-06-15T13:29:29Z (4 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f663f3e
Parents:
128359eb
Message:

Unify alignment handling

Use the C11 alignof() operator. Make sure the allocation alignment is
sufficient.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/src/balloc.c

    r128359eb rffccdff0  
    2828
    2929#include <balloc.h>
     30#include <stdalign.h>
    3031#include <stddef.h>
    3132#include <align.h>
     
    5152
    5253        /* Enforce minimal alignment. */
    53         alignment = ALIGN_UP(alignment, 4);
     54        alignment = ALIGN_UP(alignment, alignof(max_align_t));
    5455
    5556        uintptr_t addr = phys_base + ALIGN_UP(ballocs->size, alignment);
Note: See TracChangeset for help on using the changeset viewer.