Changeset c7c0b89b in mainline for generic


Ignore:
Timestamp:
2006-04-22T18:05:16Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
613bc54
Parents:
68091bd
Message:

Added uspace call to enable/disable interrupts.

Location:
generic
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • generic/include/ddi/ddi.h

    r68091bd rc7c0b89b  
    4040 * Interface to be implemented by all architectures.
    4141 */
     42extern __native ddi_int_control_arch(__native enable, __native *flags);
     43extern __native ddi_int_control(__native enable, __native *flags);
    4244extern int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size);
    4345
  • generic/include/security/cap.h

    r68091bd rc7c0b89b  
    5858#define CAP_IO_MANAGER          (1<<2)
    5959
     60/**
     61 * CAP_INT_CONTROL allows its holder to disable interrupts
     62 */
     63#define CAP_INT_CONTROL         (1<<3)
     64
    6065typedef __u32 cap_t;
    6166
  • generic/include/syscall/syscall.h

    r68091bd rc7c0b89b  
    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 */
    3536        SYS_THREAD_CREATE,
    3637        SYS_THREAD_EXIT,
  • generic/src/ddi/ddi.c

    r68091bd rc7c0b89b  
    195195        return (__native) ddi_enable_iospace((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);
    196196}
     197
     198__native ddi_int_control(__native enable, __native *flags)
     199{
     200        if (! cap_get(TASK) & CAP_INT_CONTROL)
     201                return EPERM;
     202        return ddi_int_control_arch(enable, flags);
     203}
     204
  • generic/src/syscall/syscall.c

    r68091bd rc7c0b89b  
    6565}
    6666
     67static __native sys_int_control(int enable)
     68{
     69        panic("Not implemented.");
     70}
     71
    6772/** Dispatch system call */
    6873__native syscall_handler(__native a1, __native a2, __native a3,
     
    7883        sys_io,
    7984        sys_tls_set,
     85        sys_int_control,
    8086        sys_thread_create,
    8187        sys_thread_exit,
Note: See TracChangeset for help on using the changeset viewer.