Subversion Repositories shark

Rev

Rev 838 | Rev 876 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
221 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Trimarchi Michael   <trimarchi@gandalf.sssup.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/*
20
 * Copyright (C) 2000 Paolo Gai
21
 *
22
 * This program is free software; you can redistribute it and/or modify
23
 * it under the terms of the GNU General Public License as published by
24
 * the Free Software Foundation; either version 2 of the License, or
25
 * (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARR2ANTY; without even the implied waRR2anty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
 *
36
 */
37
 
38
 
39
#include <ll/stdio.h>
40
#include <ll/string.h>
41
#include <kernel/model.h>
42
#include <kernel/descr.h>
43
#include <kernel/var.h>
44
#include <kernel/func.h>
45
#include "posixstar.h"
867 trimarchi 46
#include "fsf_configuration_parameters.h"
47
#include "fsf_core.h"
241 giacomo 48
#include "fsf_server.h"
221 giacomo 49
 
822 trimarchi 50
//#define POSIXSTAR_DEBUG
221 giacomo 51
 
52
/*+ Status used in the level +*/
53
#define POSIXSTAR_READY   MODULE_STATUS_BASE
54
 
55
#define POSIXSTAR_CHANGE_LEVEL 1
56
 
815 trimarchi 57
/* flags */
58
#define POSIXSTAR_FLAG_NOPREEMPT   4 
59
 
221 giacomo 60
/*+ the level redefinition for the Round Robin level +*/
61
typedef struct {
62
  level_des l;          /*+ the standard level descriptor          +*/
63
 
64
  int nact[MAX_PROC];   /*+ number of pending activations          +*/
65
 
66
  int priority[MAX_PROC]; /*+ priority of each task                +*/
67
 
68
  IQUEUE *ready;        /*+ the ready queue array                  +*/
69
 
70
  int slice;            /*+ the level's time slice                 +*/
71
 
72
  int maxpriority;      /*+ the priority are from 0 to maxpriority
73
                            (i.e 0 to 31)                          +*/
74
 
75
  int yielding;         /*+ equal to 1 when a sched_yield is called +*/
76
 
77
  int budget[MAX_PROC];
78
 
815 trimarchi 79
  int flag[MAX_PROC];
80
 
221 giacomo 81
  PID activated;
82
  int scheduling_level;
296 trimarchi 83
  int cap_lev;
84
  struct timespec cap_lasttime;
221 giacomo 85
 
86
} POSIXSTAR_level_des;
87
 
296 trimarchi 88
static void capacity_handler(void *l)
89
{
90
  POSIXSTAR_level_des *lev = l;
91
  lev->cap_lev = NIL;
92
  event_need_reschedule();
93
}
221 giacomo 94
/* the private scheduler choice a task and insert in cbsstar module */
95
/* This is not efficient but very fair :-)
96
   The need of all this stuff is because if a task execute a long time
97
   due to (shadow!) priority inheritance, then the task shall go to the
98
   tail of the queue many times... */
99
 
100
static void POSIXSTAR_private_scheduler(POSIXSTAR_level_des * lev)
101
{
102
  /* the old posix scheduler select the private job for CBS */
103
  PID p = NIL;
104
 
105
  int prio;
106
 
815 trimarchi 107
 
221 giacomo 108
  prio = lev->maxpriority;
109
 
110
  for (;;) {
111
    p = iq_query_first(&lev->ready[prio]);
112
    if (p == NIL) {
113
      if (prio) {
114
        prio--;
115
        continue;
116
      }
117
      else {
118
        p=NIL;
119
        break;
120
      }
121
    }
122
 
393 giacomo 123
    if (proc_table[p].avail_time <= 0) {
298 giacomo 124
      while (proc_table[p].avail_time<=0)
221 giacomo 125
        proc_table[p].avail_time += proc_table[p].wcet;
126
      iq_extract(p,&lev->ready[prio]);
127
      iq_insertlast(p,&lev->ready[prio]);
128
    }
129
    else {
130
      break;
131
    }
132
  }
828 trimarchi 133
 
134
  /* check if the task is preempteble or not */
835 trimarchi 135
  if (lev->activated != NIL && (lev->flag[lev->activated] & POSIXSTAR_FLAG_NOPREEMPT)) return;
828 trimarchi 136
 
221 giacomo 137
  if (p!=lev->activated) {
138
    if (lev->activated != NIL )  {
139
     level_table[ lev->scheduling_level ]->
140
       private_extract(lev->scheduling_level, lev->activated);
141
   }
142
   lev->activated = p;
143
 
144
   if (p != NIL) {
145
     BUDGET_TASK_MODEL b;
146
     budget_task_default_model(b, lev->budget[p]);
147
     #ifdef POSIXSTAR_DEBUG
148
       kern_printf("(PS:SchAct:%d:%d)",p,lev->budget[p]);
149
     #endif
150
     level_table[ lev->scheduling_level ]->
151
       private_insert(lev->scheduling_level, p, (TASK_MODEL *)&b);
152
   }
153
 }
154
}
155
 
156
static int POSIXSTAR_public_eligible(LEVEL l, PID p)
157
{
158
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
296 trimarchi 159
  return level_table[ lev->scheduling_level ]->
221 giacomo 160
      private_eligible(lev->scheduling_level,p);
296 trimarchi 161
 
221 giacomo 162
  return 0;
163
}
164
 
296 trimarchi 165
 
166
static void POSIXSTAR_account_capacity(POSIXSTAR_level_des *lev, PID p)
167
{
393 giacomo 168
  struct timespec ty;
169
  TIME tx;
296 trimarchi 170
 
393 giacomo 171
  SUBTIMESPEC(&schedule_time, &lev->cap_lasttime, &ty);
172
  tx = TIMESPEC2USEC(&ty);
296 trimarchi 173
 
393 giacomo 174
  proc_table[p].avail_time -= tx;
296 trimarchi 175
 
176
}
177
 
221 giacomo 178
static int POSIXSTAR_public_create(LEVEL l, PID p, TASK_MODEL *m)
179
{
180
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
181
  NRT_TASK_MODEL *nrt;
182
 
183
  /* DEBUG */
184
  #ifdef POSIXSTAR_DEBUG
185
    kern_printf("(PS:Crt:%d)",p);
186
  #endif
187
 
188
  if (m->pclass != NRT_PCLASS) return -1;
189
  if (m->level != 0 && m->level != l) return -1;
190
 
191
  nrt = (NRT_TASK_MODEL *)m;
192
 
193
  /* the task state is set at SLEEP by the general task_create */
194
 
195
  /* I used the wcet field because using wcet can account if a task
196
     consume more than the timeslice... */
197
 
198
  if (nrt->inherit == NRT_INHERIT_SCHED &&
199
      proc_table[exec_shadow].task_level == l) {
200
    /* We inherit the scheduling properties if the scheduling level
201
       *is* the same */
202
    lev->priority[p] = lev->priority[exec_shadow];
203
 
204
    proc_table[p].avail_time = proc_table[exec_shadow].avail_time;
205
    proc_table[p].wcet       = proc_table[exec_shadow].wcet;
206
 
207
    lev->nact[p] = (lev->nact[exec_shadow] == -1) ? -1 : 0;
208
  }
209
  else {
210
    if (nrt->weight<=lev->maxpriority)
211
      lev->priority[p] = nrt->weight;
212
    else lev->priority[p]=lev->maxpriority;
213
 
214
    if (nrt->slice) {
215
      proc_table[p].avail_time = nrt->slice;
216
      proc_table[p].wcet       = nrt->slice;
217
    }
218
    else {
219
      proc_table[p].avail_time = lev->slice;
220
      proc_table[p].wcet       = lev->slice;
221
    }
815 trimarchi 222
 
392 trimarchi 223
    #if defined POSIXSTAR_DEBUG
224
        kern_printf("(slice %d)", proc_table[p].wcet);
225
    #endif 
221 giacomo 226
    if (nrt->arrivals == SAVE_ARRIVALS)
227
      lev->nact[p] = 0;
228
    else
229
      lev->nact[p] = -1;
230
 
231
  }
232
 
834 trimarchi 233
  lev->flag[p] = 0;
393 giacomo 234
  proc_table[p].control = (proc_table[p].control & ~CONTROL_CAP);
235
 
236
  return 0;
237
 
221 giacomo 238
}
239
 
240
static void POSIXSTAR_public_dispatch(LEVEL l, PID p, int nostop)
241
{
242
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
296 trimarchi 243
  struct timespec ty;
221 giacomo 244
  /* the task state is set EXE by the scheduler()
245
     we extract the task from the ready queue
246
     NB: we can't assume that p is the first task in the queue!!! */
247
 
248
  #ifdef POSIXSTAR_DEBUG
296 trimarchi 249
     if( !nostop) kern_printf("(PS:Dsp:%d)",p); else
250
         kern_printf("(PS:Dsp_shad:%d)",p);
221 giacomo 251
  #endif
383 trimarchi 252
 
384 trimarchi 253
  if (!nostop || proc_table[exec].task_level==l) {
254
    TIMESPEC_ASSIGN(&ty, &schedule_time);
255
    TIMESPEC_ASSIGN(&lev->cap_lasttime, &schedule_time);
383 trimarchi 256
 
257
  /* ...and finally, we have to post a capacity event on exec task because the shadow_task consume
258
   *        capacity on exe task always */
392 trimarchi 259
    ADDUSEC2TIMESPEC(proc_table[exec].avail_time, &ty);
384 trimarchi 260
 
261
    lev->cap_lev = kern_event_post(&ty,capacity_handler, lev);
221 giacomo 262
    level_table[lev->scheduling_level]->private_dispatch(lev->scheduling_level, p, nostop);
296 trimarchi 263
  }
264
  else
384 trimarchi 265
    level_table[proc_table[exec].task_level]->public_dispatch(proc_table[exec].task_level, p, nostop);
266
 
221 giacomo 267
}
268
 
226 giacomo 269
static void POSIXSTAR_public_epilogue(LEVEL l, PID p)
270
{
271
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
402 giacomo 272
 
226 giacomo 273
  #ifdef POSIXSTAR_DEBUG
274
    kern_printf("(PS:Epi:%d)",p);
275
  #endif 
276
 
296 trimarchi 277
 if (lev->cap_lev!=NIL) {
393 giacomo 278
   kern_event_delete(lev->cap_lev);
279
   lev->cap_lev=NIL;
296 trimarchi 280
 }
281
 
393 giacomo 282
 if (proc_table[exec].task_level==l ) {
283
 
828 trimarchi 284
   POSIXSTAR_account_capacity(lev,exec);
221 giacomo 285
 
393 giacomo 286
   if (lev->yielding) {
287
     lev->yielding = 0;
288
     iq_extract(p,&lev->ready[lev->priority[exec]]);
289
     iq_insertlast(p,&lev->ready[lev->priority[exec]]);
402 giacomo 290
   } else {
291
 
292
     if (proc_table[exec].avail_time <= 0) {
293
 
294
       POSIXSTAR_private_scheduler(lev);
838 giacomo 295
 
836 trimarchi 296
       if (exec==lev->activated) {
402 giacomo 297
         level_table[lev->scheduling_level]->private_epilogue(lev->scheduling_level,p);  
298
       }
299
 
300
     } else  {
301
 
302
       level_table[lev->scheduling_level]->private_epilogue(lev->scheduling_level,p);
303
 
304
     }
305
 
393 giacomo 306
   }
307
 
402 giacomo 308
   proc_table[exec].status = POSIXSTAR_READY;
221 giacomo 309
 
402 giacomo 310
 } else {
311
 
312
   level_table[proc_table[exec].task_level]->public_epilogue(proc_table[exec].task_level,p);
313
 
314
 }
315
 
221 giacomo 316
}
317
 
318
static void POSIXSTAR_internal_activate(POSIXSTAR_level_des *lev, PID p)
319
{
320
 
321
  /* Insert task in the correct position */
322
  proc_table[p].status = POSIXSTAR_READY;
323
  iq_insertlast(p,&lev->ready[lev->priority[p]]);
324
 
325
}
326
 
327
 
783 giacomo 328
static void POSIXSTAR_public_activate(LEVEL l, PID p, struct timespec *t)
221 giacomo 329
{
330
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
331
 
332
  /* Test if we are trying to activate a non sleeping task    */
333
  /* save activation (only if needed...) */
334
  if (proc_table[p].status != SLEEP) {
335
    if (lev->nact[p] != -1)
336
      lev->nact[p]++;
337
    return;
338
  }
339
 
340
  #ifdef POSIXSTAR_DEBUG 
341
    kern_printf("(PS:Act:%d)",p);
342
  #endif
343
 
344
  POSIXSTAR_internal_activate(lev, p);
345
  POSIXSTAR_private_scheduler(lev);
346
 
347
}
348
 
349
 
350
static void POSIXSTAR_public_unblock(LEVEL l, PID p)
351
{
352
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
353
 
354
  /* Similar to POSIX_task_activate, but we don't check in what state
355
     the task is */
356
 
357
  #ifdef POSIXSTAR_DEBUG
358
    kern_printf("(PS:UnBlk:%d)",p);
359
  #endif
360
  /* Insert task in the coPOSIXect position */
361
  proc_table[p].status = POSIXSTAR_READY;
362
  iq_insertlast(p,&lev->ready[lev->priority[p]]);
363
  POSIXSTAR_private_scheduler(lev);
364
 
365
}
366
 
367
static void POSIXSTAR_public_block(LEVEL l, PID p)
368
{  
369
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
370
 
371
  /* Extract the running task from the level
372
     . we have already extract it from the ready queue at the dispatch time.
373
     . the capacity event have to be removed by the generic kernel
374
     . the wcet don't need modification...
375
     . the state of the task is set by the calling function
376
 
377
     So, we do nothing!!!
378
  */
379
 
380
  #ifdef POSIXSTAR_DEBUG
381
    kern_printf("(PS:Blk:%d)", p);     
382
  #endif
383
 
384
  iq_extract(p,&lev->ready[lev->priority[p]]);
385
  POSIXSTAR_private_scheduler(lev);
386
 
387
}
388
 
389
static int POSIXSTAR_public_message(LEVEL l, PID p, void *m)
390
{
391
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
392
 
393
  #ifdef POSIXSTAR_DEBUG
394
    kern_printf("(PS:Msg:%d)",p);
395
  #endif
396
 
397
  switch ((long)(m)) {
398
 
399
    /* Task EndCycle */
400
    case (long)(NULL):
401
 
402
      if (lev->nact[p] > 0) {
403
        /* continue!!!! */
404
        lev->nact[p]--;
405
        iq_extract(p,&lev->ready[lev->priority[p]]);
406
        iq_insertfirst(p,&lev->ready[lev->priority[p]]);
407
        proc_table[p].status = POSIXSTAR_READY;
408
      }
409
      else {
410
        proc_table[p].status = SLEEP;
411
        iq_extract(p,&lev->ready[lev->priority[p]]);
412
      }
413
 
414
      jet_update_endcycle(); /* Update the Jet data... */
415
      POSIXSTAR_private_scheduler(lev);
416
 
417
      break;
418
 
419
    /* Task Disable */
420
    case (long)(1):
421
 
422
      break;
423
 
424
    default:
425
 
241 giacomo 426
      break;
221 giacomo 427
 
428
  }
429
 
430
  return 0;
431
 
432
}
433
 
434
static void POSIXSTAR_public_end(LEVEL l, PID p)
435
{
436
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
437
 
438
  #ifdef POSIXSTAR_DEBUG
439
    kern_printf("(PS:End:%d)", p);
440
  #endif
441
 
442
  lev->nact[p] = -1;
348 trimarchi 443
  /* extract task from the queue */
444
  iq_extract(p,&lev->ready[lev->priority[p]]);
221 giacomo 445
 
446
  /* then, we insert the task in the free queue */
447
  proc_table[p].status = FREE;
448
  iq_priority_insert(p,NULL);
449
  POSIXSTAR_private_scheduler(lev);
450
 
451
}
452
 
453
/* Registration functions */
454
 
455
/*+ Registration function:
456
    TIME slice                the slice for the Round Robin queue +*/
457
LEVEL POSIXSTAR_register_level(int master, TIME slice,
458
                       int prioritylevels)
459
{
460
  LEVEL l;            /* the level that we register */
461
  POSIXSTAR_level_des *lev;  /* for readableness only */
462
  PID i;              /* a counter */
463
  int x;              /* a counter */
464
 
465
  #ifdef POSIXSTRA_DEBUG
466
    kern_printf("POSIXSTAR_register_level\n");
467
  #endif
468
 
469
  l = level_alloc_descriptor(sizeof(POSIXSTAR_level_des));
470
 
471
  lev = (POSIXSTAR_level_des *)level_table[l];
472
 
270 giacomo 473
  lev->l.public_guarantee = NULL;
221 giacomo 474
  lev->l.public_create    = POSIXSTAR_public_create;
475
  lev->l.public_end       = POSIXSTAR_public_end;
476
  lev->l.public_dispatch  = POSIXSTAR_public_dispatch;
477
  lev->l.public_epilogue  = POSIXSTAR_public_epilogue;
478
  lev->l.public_activate  = POSIXSTAR_public_activate;
479
  lev->l.public_unblock   = POSIXSTAR_public_unblock;
480
  lev->l.public_block     = POSIXSTAR_public_block;
481
  lev->l.public_message   = POSIXSTAR_public_message;
482
  lev->l.public_eligible  = POSIXSTAR_public_eligible;
483
 
484
  /* fill the POSIX descriptor part */
485
  for (i = 0; i < MAX_PROC; i++) {
486
    lev->nact[i] = -1;
487
    lev->budget[i] = -1;
488
  }
489
 
490
  lev->maxpriority = prioritylevels - 1;
491
 
492
  lev->ready = (IQUEUE *)kern_alloc(sizeof(IQUEUE) * prioritylevels);
493
 
494
  for (x = 0; x < prioritylevels; x++)
495
    iq_init(&lev->ready[x], NULL, 0);
496
 
497
  if (slice < POSIXSTAR_MINIMUM_SLICE) slice = POSIXSTAR_MINIMUM_SLICE;
498
  if (slice > POSIXSTAR_MAXIMUM_SLICE) slice = POSIXSTAR_MAXIMUM_SLICE;
499
  lev->slice = slice;
500
  lev->activated = NIL;
501
  lev->scheduling_level = master;
298 giacomo 502
  lev->cap_lev = NIL;
838 giacomo 503
  lev->yielding = 0;
296 trimarchi 504
  NULL_TIMESPEC(&lev->cap_lasttime);
505
 
221 giacomo 506
  return l;
507
 
508
}
509
 
510
int POSIXSTAR_setbudget(LEVEL l, PID p, int budget)
511
{
512
 
513
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
514
 
515
  lev->budget[p] = budget;
516
 
517
  return 0;
518
 
519
}
520
 
521
int POSIXSTAR_getbudget(LEVEL l, PID p)
522
{
523
 
524
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
525
 
526
  return lev->budget[p];
527
 
528
}
529
 
530
int POSIXSTAR_budget_has_thread(LEVEL l, int budget)
531
{
532
 
533
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
534
  int i;
535
 
536
  for(i = 0; i< MAX_PROC; i++)
537
    if (lev->budget[i] == budget) return 1;
538
 
539
  return 0;
540
 
541
}
542
 
543
/*+ this function forces the running task to go to his queue tail;
544
    (it works only on the POSIX level) +*/
545
int POSIXSTAR_sched_yield(LEVEL l)
546
{
547
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
548
 
549
  if (proc_table[exec_shadow].task_level != l)
550
    return -1;
551
 
552
  proc_table[exec_shadow].context = kern_context_save();
553
  lev->yielding = 1;
554
  scheduler();
555
  kern_context_load(proc_table[exec_shadow].context);
556
  return 0;
557
}
558
 
559
/*+ this function returns the maximum level allowed for the POSIX level +*/
560
int POSIXSTAR_get_priority_max(LEVEL l)
561
{
562
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
563
  return lev->maxpriority;
564
}
565
 
566
/*+ this function returns the default timeslice for the POSIX level +*/
567
int POSIXSTAR_rr_get_interval(LEVEL l)
568
{
569
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
570
  return lev->slice;
571
}
572
 
573
/*+ this functions returns some paramaters of a task;
574
    policy must be NRT_RR_POLICY or NRT_FIFO_POLICY;
575
    priority must be in the range [0..prioritylevels]
576
    returns ENOSYS or ESRCH if there are problems +*/
577
int POSIXSTAR_getschedparam(LEVEL l, PID p, int *policy, int *priority)
578
{
579
  if (p<0 || p>= MAX_PROC || proc_table[p].status == FREE)
580
    return ESRCH;
581
 
582
  if (proc_table[p].task_level != l)
583
    return ENOSYS;
584
 
393 giacomo 585
  *policy = NRT_RR_POLICY;
221 giacomo 586
  *priority = ((POSIXSTAR_level_des *)(level_table[l]))->priority[p];
587
 
588
  return 0;
589
}
590
 
591
/*+ this functions sets paramaters of a task +*/
592
int POSIXSTAR_setschedparam(LEVEL l, PID p, int policy, int priority)
593
{
594
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
595
 
596
  if (p<0 || p>= MAX_PROC || proc_table[p].status == FREE)
597
    return ESRCH;
598
 
599
  if (proc_table[p].task_level != l)
600
    return ENOSYS;
601
  if (lev->priority[p] != priority) {
602
    if (proc_table[p].status == POSIXSTAR_READY) {
603
      iq_extract(p,&lev->ready[lev->priority[p]]);
604
      lev->priority[p] = priority;
605
      iq_insertlast(p,&lev->ready[priority]);
606
    }
607
    else
608
      lev->priority[p] = priority;
609
  }
610
 
611
  return 0;
612
}
613
 
815 trimarchi 614
 
615
void POSIXSTAR_set_nopreemtive_current(LEVEL l) {
616
 
617
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
618
 
619
  lev->flag[lev->activated]|=POSIXSTAR_FLAG_NOPREEMPT;
620
}
621
 
622
void POSIXSTAR_unset_nopreemtive_current(LEVEL l) {
623
 
624
  POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
625
 
626
  lev->flag[lev->activated]&=~POSIXSTAR_FLAG_NOPREEMPT;
627
}