Changeset 2bb8648 in mainline for generic/src/ddi/ddi.c


Ignore:
Timestamp:
2006-05-07T15:21:11Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
31282f9
Parents:
ecf3722
Message:

Add SYS_CAP_GRANT and SYS_CAP_REVOKE syscalls.
Move SYS_PREEMPT_CONTROL to ddi.c.
Add some comments and fix some small issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ddi/ddi.c

    recf3722 r2bb8648  
    212212        return (__native) ddi_iospace_enable((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);
    213213}
     214
     215/** Disable or enable preemption.
     216 *
     217 * @param enable If non-zero, the preemption counter will be decremented, leading to potential
     218 *               enabling of preemption. Otherwise the preemption counter will be incremented,
     219 *               preventing preemption from occurring.
     220 *
     221 * @return Zero on success or EPERM if callers capabilities are not sufficient.
     222 */
     223__native sys_preempt_control(int enable)
     224{
     225        if (! cap_get(TASK) & CAP_PREEMPT_CONTROL)
     226                return EPERM;
     227        if (enable)
     228                preemption_enable();
     229        else
     230                preemption_disable();
     231        return 0;
     232}
Note: See TracChangeset for help on using the changeset viewer.