Changeset 738ad2e in mainline


Ignore:
Timestamp:
2006-05-02T18:19:43Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
281224a
Parents:
e34a141
Message:

Changed interrupt_control to preemption_control.

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/asm_utils.S

    re34a141 r738ad2e  
    245245        movq %r9, %rcx      # Exchange last parameter as a third
    246246       
    247         cmp $2, %r8          # Is this SYS_INT_CONTROL
    248         je sys_int_ctrl
    249        
    250247        call syscall_handler
    251 sys_end:       
    252248        cli                 # We will be touching stack pointer
    253249               
     
    256252        movq 0(%rsp), %rsp
    257253        sysretq
    258        
    259 sys_int_ctrl:
    260         mov %rsp, %rsi      # Pointer to flags
    261         call ddi_int_control
    262         jmp sys_end
    263        
     254               
    264255               
    265256.data
  • arch/amd64/src/ddi/ddi.c

    re34a141 r738ad2e  
    101101}
    102102
    103 /** Enable/disable interrupts form syscall
    104  *
    105  * @param enable If non-zero, interrupts are enabled, otherwise disabled
    106  * @param flags RFLAGS register
    107  */
    108 __native ddi_int_control_arch(__native enable, __native *flags)
    109 {
    110         if (enable)
    111                 *flags |= RFLAGS_IF;
    112         else
    113                 *flags &= ~RFLAGS_IF;
    114         return 0;
    115 }
    116 
    117103/** Install I/O Permission bitmap.
    118104 *
  • arch/ia32/src/asm.S

    re34a141 r738ad2e  
    8787# and call exc_dispatch().
    8888#
    89 #define INTERRUPT_ALIGN 128
     89#define INTERRUPT_ALIGN 64
    9090.macro handler i n
    9191
     
    109109       
    110110        sti
    111         cmp $2, %edi           # Is this SYS_INT_CONTROL?
    112         je sys_int_ctrl
    113111       
    114112        call syscall_handler   # syscall_handler(ax,cx,dx,si,di)
    115 sysc_end:               
    116113        cli
    117114        addl $20, %esp         # clean-up of parameters
     
    124121        CLEAR_NT_FLAG
    125122        iret
    126 sys_int_ctrl:               # Interrupt control
    127         mov %esp, %eax
    128         add $44, %eax
    129         mov %eax, 4(%esp)   # Pointer to flags - 2nd argument
    130         call ddi_int_control
    131         jmp sysc_end
    132123.else   
    133124        /*
  • arch/ia32/src/ddi/ddi.c

    re34a141 r738ad2e  
    102102}
    103103
    104 /** Enable/disable interrupts for syscall
    105  *
    106  * @param enable If non-zero, interrupts are enabled, otherwise disabled
    107  * @param flags EFLAGS flags register
    108  */
    109 __native ddi_int_control_arch(__native enable, __native *flags)
    110 {
    111         if (enable)
    112                 *flags |= EFLAGS_IF;
    113         else
    114                 *flags &= ~EFLAGS_IF;
    115         return 0;
    116 }
    117 
    118104/** Install I/O Permission bitmap.
    119105 *
  • arch/mips32/src/ddi/ddi.c

    re34a141 r738ad2e  
    4949        return 0;
    5050}
    51 
    52 /** Enable/disable interrupts for syscall
    53  *
    54  * @param enable If non-zero, interrupts are enabled, otherwise disabled
    55  * @param flags CP0 status register
    56  */
    57 __native ddi_int_control_arch(__native enable, __native *flags)
    58 {
    59         if (enable)
    60                 *flags |= cp0_status_ie_enabled_bit;
    61         else
    62                 *flags &= ~cp0_status_ie_enabled_bit;
    63         return 0;
    64 }
  • arch/mips32/src/start.S

    re34a141 r738ad2e  
    254254        mtc0 $t0, $status
    255255
    256         li $t4, 2                   # SYS_INT_CONTROL
    257         beq $t4, $v0, sysc_int_control
    258         nop
    259        
    260256        # CALL Syscall handler
    261257        jal syscall_handler
    262258        sw $v0, SS_ARG4($sp)        # save v0 - arg4 to stack
    263259
    264 sysc_exit:     
    265260        # restore status
    266261        mfc0 $t0, $status
     
    282277       
    283278        eret
    284        
    285 sysc_int_control:
    286         jal ddi_int_control
    287         addi $a1, $sp, SS_STATUS
    288        
    289         j sysc_exit
    290         nop
    291        
     279               
    292280tlb_refill_handler:
    293281        KERNEL_STACK_TO_K0
  • generic/include/ddi/ddi.h

    re34a141 r738ad2e  
    4040 * Interface to be implemented by all architectures.
    4141 */
    42 extern __native ddi_int_control_arch(__native enable, __native *flags);
    43 extern __native ddi_int_control(__native enable, __native *flags);
    4442extern int ddi_iospace_enable_arch(task_t *task, __address ioaddr, size_t size);
    4543
  • generic/include/security/cap.h

    re34a141 r738ad2e  
    6464
    6565/**
    66  * CAP_INT_CONTROL allows its holder to disable interrupts
     66 * CAP_PREEMPT_CONTROL allows its holder to disable interrupts
    6767 */
    68 #define CAP_INT_CONTROL         (1<<3)
     68#define CAP_PREEMPT_CONTROL         (1<<3)
    6969
    7070typedef __u32 cap_t;
  • generic/include/syscall/syscall.h

    re34a141 r738ad2e  
    3333        SYS_IO = 0,
    3434        SYS_TLS_SET = 1, /* Hardcoded in AMD64,IA32 uspace - psthread.S */
    35         SYS_INT_CONTROL = 2, /* Hardcoded in all SYSCALL handlers */
     35        SYS_PREEMPT_CONTROL,
    3636        SYS_THREAD_CREATE,
    3737        SYS_THREAD_EXIT,
  • generic/src/ddi/ddi.c

    re34a141 r738ad2e  
    204204        return (__native) ddi_iospace_enable((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);
    205205}
    206 
    207 __native ddi_int_control(__native enable, __native *flags)
    208 {
    209         if (! cap_get(TASK) & CAP_INT_CONTROL)
    210                 return EPERM;
    211         return ddi_int_control_arch(enable, flags);
    212 }
  • generic/src/syscall/syscall.c

    re34a141 r738ad2e  
    5757}
    5858
    59 static __native sys_int_control(int enable)
     59static __native sys_preempt_control(int enable)
    6060{
    61         panic("Not implemented.");
     61        if (! cap_get(TASK) & CAP_PREEMPT_CONTROL)
     62                return EPERM;
     63        if (enable)
     64                preemption_enable();
     65        else
     66                preemption_disable();
     67        return 0;
    6268}
    6369
     
    7581        sys_io,
    7682        sys_tls_set,
    77         sys_int_control,
     83        sys_preempt_control,
    7884
    7985        /* Thread and task related syscalls. */
Note: See TracChangeset for help on using the changeset viewer.