Ignore:
Timestamp:
2023-02-07T16:49:43Z (15 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
78acbc72
Parents:
1eaead4
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-14 14:08:42)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-07 16:49:43)
Message:

Avoid separate allocation for FPU context

With _Alignas, we can encode alignment in the type itself and
include it directly as a member of thread_t, thus removing
the need for a separate allocation.

The alignment requirement is never more than 16 bytes,
so this adds only minimal extra padding to the structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/include/arch/fpu_context.h

    r1eaead4 r0366d09d  
    3838#include <stdint.h>
    3939
    40 #define FPU_CONTEXT_ALIGN  16
    41 
    4240typedef struct {
    43         uint8_t fpu[512];  /* FXSAVE & FXRSTOR storage area */
     41        _Alignas(16) uint8_t fpu[512];  /* FXSAVE & FXRSTOR storage area */
    4442} fpu_context_t;
    4543
Note: See TracChangeset for help on using the changeset viewer.