Changeset c030818 in mainline


Ignore:
Timestamp:
2023-02-05T14:43:59Z (22 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
33a3be8
Parents:
c1b073b7
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-20 12:17:49)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 14:43:59)
Message:

Move saved interrupt level from context_t to thread_t

Unlike the rest of the context structure, ipl is not
a register, and is (re)stored using a separate mechanism from
context_set()/_restore(). Therefore, it does not belong there.

Location:
kernel
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/arch/context.h

    rc1b073b7 rc030818  
    4949        uintptr_t sp;
    5050        uintptr_t pc;
    51         ipl_t ipl;
    5251} context_t;
    5352
  • kernel/arch/abs32le/include/arch/context_offset.h

    rc1b073b7 rc030818  
    3737
    3838#define OFFSET_PC  0x00
    39 #define OFFSET_IPL 0x04
    4039
    4140#endif
  • kernel/arch/amd64/include/arch/context_struct.h

    rc1b073b7 rc030818  
    3939#define CONTEXT_OFFSET_R15  0x38
    4040#define CONTEXT_OFFSET_TP   0x40
    41 #define CONTEXT_OFFSET_IPL  0x48
    42 #define CONTEXT_SIZE        0x50
     41#define CONTEXT_SIZE        0x48
    4342
    4443#ifndef __ASSEMBLER__
     
    6059        uint64_t r15;
    6160        uint64_t tp;
    62         ipl_t ipl;
    6361} context_t;
    6462
  • kernel/arch/arm64/include/arch/context_struct.h

    rc1b073b7 rc030818  
    4343#define CONTEXT_OFFSET_X28  0x58
    4444#define CONTEXT_OFFSET_X29  0x60
    45 #define CONTEXT_OFFSET_IPL  0x68
    46 #define CONTEXT_SIZE        0x70
     45#define CONTEXT_SIZE        0x68
    4746
    4847#ifndef __ASSEMBLER__
     
    6867        uint64_t x28;
    6968        uint64_t x29;
    70         ipl_t ipl;
    7169} context_t;
    7270
  • kernel/arch/ia32/include/arch/context_struct.h

    rc1b073b7 rc030818  
    3737#define CONTEXT_OFFSET_EBP  0x14
    3838#define CONTEXT_OFFSET_TP   0x18
    39 #define CONTEXT_OFFSET_IPL  0x1c
    40 #define CONTEXT_SIZE        0x20
     39#define CONTEXT_SIZE        0x1c
    4140
    4241#ifndef __ASSEMBLER__
     
    5352        uint32_t ebp;
    5453        uint32_t tp;
    55         ipl_t ipl;
    5654} context_t;
    5755
  • kernel/arch/ia64/include/arch/context_struct.h

    rc1b073b7 rc030818  
    7272#define CONTEXT_OFFSET_F30             0x1d0
    7373#define CONTEXT_OFFSET_F31             0x1e0
    74 #define CONTEXT_OFFSET_IPL             0x1f0
    75 #define CONTEXT_SIZE                   0x200
     74#define CONTEXT_SIZE                   0x1f0
    7675
    7776#ifndef __ASSEMBLER__
     
    136135        uint128_t f30;
    137136        uint128_t f31;
    138 
    139         ipl_t ipl;
    140137} context_t;
    141138
  • kernel/arch/mips32/include/arch/context_struct.h

    rc1b073b7 rc030818  
    4343#define CONTEXT_OFFSET_GP  0x2c
    4444#define CONTEXT_OFFSET_TP  0x30
    45 #define CONTEXT_OFFSET_IPL 0x34
    46 #define CONTEXT_SIZE       0x38
     45#define CONTEXT_SIZE       0x34
    4746
    4847#ifndef __ASSEMBLER__
     
    6665        /* We use the K1 register for userspace thread pointer. */
    6766        uint32_t tp;
    68         ipl_t ipl;
    6967} context_t;
    7068
  • kernel/arch/ppc32/include/arch/context_struct.h

    rc1b073b7 rc030818  
    5353#define CONTEXT_OFFSET_R31  0x54
    5454#define CONTEXT_OFFSET_CR   0x58
    55 #define CONTEXT_OFFSET_IPL  0x5c
    56 #define CONTEXT_SIZE        0x60
     55#define CONTEXT_SIZE        0x5c
    5756
    5857#ifndef __ASSEMBLER__
     
    8483        uint32_t r31;
    8584        uint32_t cr;
    86         ipl_t ipl;
    8785} context_t;
    8886
  • kernel/arch/riscv64/include/arch/context_struct.h

    rc1b073b7 rc030818  
    4646#define CONTEXT_OFFSET_S10  0x70
    4747#define CONTEXT_OFFSET_S11  0x78
    48 #define CONTEXT_OFFSET_IPL  0x80
    49 #define CONTEXT_SIZE        0x88
     48#define CONTEXT_SIZE        0x80
    5049
    5150#ifndef __ASSEMBLER__
     
    7069        uint64_t s10;
    7170        uint64_t s11;
    72         ipl_t ipl;
    7371} context_t;
    7472
  • kernel/arch/sparc64/include/arch/context_struct.h

    rc1b073b7 rc030818  
    4949#define CONTEXT_OFFSET_L7   0x88
    5050#define CONTEXT_OFFSET_TP   0x90
    51 #define CONTEXT_OFFSET_IPL  0x98
    52 #define CONTEXT_SIZE        0xa0
     51#define CONTEXT_SIZE        0x98
    5352
    5453#ifndef __ASSEMBLER__
     
    7675        uint64_t l7;
    7776        uint64_t tp;  // %g7
    78         ipl_t ipl;
    7977} context_t;
    8078
  • kernel/generic/include/proc/thread.h

    rc1b073b7 rc030818  
    9595         */
    9696        context_t saved_context;
     97        ipl_t saved_ipl;
    9798
    9899        /**
  • kernel/generic/src/proc/scheduler.c

    rc1b073b7 rc030818  
    336336
    337337                        irq_spinlock_unlock(&THREAD->lock, false);
    338                         interrupts_restore(THREAD->saved_context.ipl);
     338                        interrupts_restore(THREAD->saved_ipl);
    339339
    340340                        return;
     
    347347                 *
    348348                 */
    349                 THREAD->saved_context.ipl = ipl;
     349                THREAD->saved_ipl = ipl;
    350350        }
    351351
  • kernel/generic/src/proc/thread.c

    rc1b073b7 rc030818  
    365365
    366366        ipl_t ipl = interrupts_disable();
    367         thread->saved_context.ipl = interrupts_read();
     367        thread->saved_ipl = interrupts_read();
    368368        interrupts_restore(ipl);
    369369
Note: See TracChangeset for help on using the changeset viewer.