Changes in / [76e1121f:5203efb1] in mainline


Ignore:
Files:
10 edited

Legend:

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

    r76e1121f r5203efb1  
    5454extern unative_t sys_physmem_map(unative_t, unative_t, unative_t, unative_t);
    5555extern unative_t sys_iospace_enable(ddi_ioarg_t *);
    56 extern unative_t sys_preempt_control(int);
    5756
    5857/*
  • kernel/generic/include/security/cap.h

    r76e1121f r5203efb1  
    7070
    7171/**
    72  * CAP_PREEMPT_CONTROL allows its holder to disable/enable preemption.
    73  */
    74 #define CAP_PREEMPT_CONTROL     (1<<3)
    75 
    76 /**
    7772 * CAP_IRQ_REG entitles its holder to register IRQ handlers.
    7873 */
    79 #define CAP_IRQ_REG             (1<<4)
     74#define CAP_IRQ_REG             (1<<3)
    8075
    8176typedef uint32_t cap_t;
  • kernel/generic/include/syscall/syscall.h

    r76e1121f r5203efb1  
    8080        SYS_PHYSMEM_MAP,
    8181        SYS_IOSPACE_ENABLE,
    82         SYS_PREEMPT_CONTROL,
    8382       
    8483        SYS_SYSINFO_GET_TAG,
  • kernel/generic/src/ddi/ddi.c

    r76e1121f r5203efb1  
    258258}
    259259
    260 /** Disable or enable preemption.
    261  *
    262  * @param enable If non-zero, the preemption counter will be decremented,
    263  *               leading to potential enabling of preemption. Otherwise
    264  *               the preemption counter will be incremented, preventing
    265  *               preemption from occurring.
    266  *
    267  * @return Zero on success or EPERM if callers capabilities are not sufficient.
    268  *
    269  */
    270 unative_t sys_preempt_control(int enable)
    271 {
    272         if (!(cap_get(TASK) & CAP_PREEMPT_CONTROL))
    273                 return EPERM;
    274        
    275         if (enable)
    276                 preemption_enable();
    277         else
    278                 preemption_disable();
    279        
    280         return 0;
    281 }
    282 
    283260/** @}
    284261 */
  • kernel/generic/src/main/kinit.c

    r76e1121f r5203efb1  
    208208                         */
    209209                        cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER |
    210                             CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG);
     210                            CAP_IO_MANAGER | CAP_IRQ_REG);
    211211                       
    212212                        if (!ipc_phone_0)
  • kernel/generic/src/syscall/syscall.c

    r76e1121f r5203efb1  
    159159        (syshandler_t) sys_physmem_map,
    160160        (syshandler_t) sys_iospace_enable,
    161         (syshandler_t) sys_preempt_control,
    162161       
    163162        /* Sysinfo syscalls */
  • uspace/app/trace/syscalls.c

    r76e1121f r5203efb1  
    7373    [SYS_PHYSMEM_MAP] = { "physmem_map",                4,      V_ERRNO },
    7474    [SYS_IOSPACE_ENABLE] = { "iospace_enable",          1,      V_ERRNO },
    75     [SYS_PREEMPT_CONTROL] = { "preempt_control",        1,      V_ERRNO },
    7675
    7776    [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag",                2,      V_INTEGER },
  • uspace/lib/c/generic/ddi.c

    r76e1121f r5203efb1  
    9696}
    9797
    98 /** Interrupt control
    99  *
    100  * @param enable        1 - enable interrupts, 0 - disable interrupts
    101  */
    102 int preemption_control(int enable)
    103 {
    104         return __SYSCALL1(SYS_PREEMPT_CONTROL, (sysarg_t) enable);
    105 }
    106 
    10798/** Enable PIO for specified I/O range.
    10899 *
  • uspace/lib/c/include/ddi.h

    r76e1121f r5203efb1  
    4141extern int physmem_map(void *, void *, unsigned long, int);
    4242extern int iospace_enable(task_id_t, void *, unsigned long);
    43 extern int preemption_control(int);
    4443extern int pio_enable(void *, size_t, void **);
    4544
  • uspace/srv/fs/fat/fat_fat.c

    r76e1121f r5203efb1  
    545545        dev_handle_t dev_handle = nodep->idx->dev_handle;
    546546        fat_cluster_t lastc;
    547         uint16_t numc;
    548547        uint8_t fatno;
    549548        int rc;
    550549
    551         if (nodep->lastc_cached_valid) {
    552                 lastc = nodep->lastc_cached_value;
    553                 nodep->lastc_cached_valid = false;
     550        if (nodep->firstc == FAT_CLST_RES0) {
     551                /* No clusters allocated to the node yet. */
     552                nodep->firstc = mcl;
     553                nodep->dirty = true;    /* need to sync node */
    554554        } else {
    555                 rc = fat_cluster_walk(bs, dev_handle, nodep->firstc, &lastc,
    556                     &numc, (uint16_t) -1);
    557                 if (rc != EOK)
    558                         return rc;
    559 
    560                 if (numc == 0) {
    561                         /* No clusters allocated to the node yet. */
    562                         nodep->firstc = mcl;
    563                         nodep->dirty = true;    /* need to sync node */
    564                         return EOK;
     555                if (nodep->lastc_cached_valid) {
     556                        lastc = nodep->lastc_cached_value;
     557                        nodep->lastc_cached_valid = false;
     558                } else {
     559                        rc = fat_cluster_walk(bs, dev_handle, nodep->firstc,
     560                            &lastc, NULL, (uint16_t) -1);
     561                        if (rc != EOK)
     562                                return rc;
    565563                }
    566         }
    567 
    568         for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
    569                 rc = fat_set_cluster(bs, nodep->idx->dev_handle, fatno, lastc,
    570                     mcl);
    571                 if (rc != EOK)
    572                         return rc;
     564
     565                for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
     566                        rc = fat_set_cluster(bs, nodep->idx->dev_handle, fatno,
     567                            lastc, mcl);
     568                        if (rc != EOK)
     569                                return rc;
     570                }
    573571        }
    574572
Note: See TracChangeset for help on using the changeset viewer.