Changeset b6911069 in rtems for cpukit/libblock
- Timestamp:
- May 29, 2012, 4:02:52 PM (8 years ago)
- Branches:
- 4.11, master
- Children:
- 40284de
- Parents:
- bb08c0c8
- git-author:
- Sebastian Huber <sebastian.huber@…> (05/29/12 16:02:52)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (05/31/12 09:05:48)
- Location:
- cpukit/libblock
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libblock/include/rtems/bdbuf.h
rbb08c0c8 rb6911069 364 364 rtems_task_priority swapout_priority; /**< Priority of the swap out 365 365 * task. */ 366 uint32_t swapout_period; /**< Period swap out checks buf366 uint32_t swapout_period; /**< Period swap-out checks buf 367 367 * timers. */ 368 368 uint32_t swap_block_hold; /**< Period a buffer is held. */ 369 369 size_t swapout_workers; /**< The number of worker 370 * threads for the swap out370 * threads for the swap-out 371 371 * task. */ 372 372 rtems_task_priority swapout_worker_priority; /**< Priority of the swap out 373 373 * task. */ 374 size_t task_stack_size; /**< Task stack size for swap-out 375 * task and worker threads. */ 374 376 size_t size; /**< Size of memory in the 375 377 * cache */ … … 419 421 420 422 /** 421 * Default swap-out worker task priority. The same as the swap out task.423 * Default swap-out worker task priority. The same as the swap-out task. 422 424 */ 423 425 #define RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT \ 424 426 RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT 427 428 /** 429 * Default task stack size for swap-out and worker tasks. 430 */ 431 #define RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT RTEMS_MINIMUM_STACK_SIZE 425 432 426 433 /** -
cpukit/libblock/src/bdbuf.c
rbb08c0c8 rb6911069 174 174 #define RTEMS_BLKDEV_FATAL_BDBUF_SO_NOMEM RTEMS_BLKDEV_FATAL_ERROR(21) 175 175 #define RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_CREATE RTEMS_BLKDEV_FATAL_ERROR(22) 176 #define RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_START RTEMS_BLKDEV_FATAL_ERROR(23)177 176 #define BLKDEV_FATAL_BDBUF_SWAPOUT_RE RTEMS_BLKDEV_FATAL_ERROR(24) 178 177 #define BLKDEV_FATAL_BDBUF_SWAPOUT_TS RTEMS_BLKDEV_FATAL_ERROR(25) … … 189 188 #define RTEMS_BDBUF_TRANSFER_SYNC RTEMS_EVENT_1 190 189 #define RTEMS_BDBUF_SWAPOUT_SYNC RTEMS_EVENT_2 191 192 /**193 * The swap out task size. Should be more than enough for most drivers with194 * tracing turned on.195 */196 #define SWAPOUT_TASK_STACK_SIZE (8 * 1024)197 190 198 191 /** … … 1288 1281 } 1289 1282 1283 static rtems_status_code 1284 rtems_bdbuf_create_task( 1285 rtems_name name, 1286 rtems_task_priority priority, 1287 rtems_task_priority default_priority, 1288 rtems_task_entry entry, 1289 rtems_task_argument arg, 1290 rtems_id *id 1291 ) 1292 { 1293 rtems_status_code sc; 1294 size_t stack_size = bdbuf_config.task_stack_size ? 1295 bdbuf_config.task_stack_size : RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT; 1296 1297 priority = priority != 0 ? priority : default_priority; 1298 1299 sc = rtems_task_create (name, 1300 priority, 1301 stack_size, 1302 RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, 1303 RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT, 1304 id); 1305 1306 if (sc == RTEMS_SUCCESSFUL) 1307 sc = rtems_task_start (*id, entry, arg); 1308 1309 return sc; 1310 } 1311 1290 1312 /** 1291 1313 * Initialise the cache. … … 1457 1479 bdbuf_cache.swapout_enabled = true; 1458 1480 1459 sc = rtems_task_create (rtems_build_name('B', 'S', 'W', 'P'), 1460 bdbuf_config.swapout_priority ? 1461 bdbuf_config.swapout_priority : 1462 RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT, 1463 SWAPOUT_TASK_STACK_SIZE, 1464 RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, 1465 RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT, 1466 &bdbuf_cache.swapout); 1467 if (sc != RTEMS_SUCCESSFUL) 1468 goto error; 1469 1470 sc = rtems_task_start (bdbuf_cache.swapout, 1471 rtems_bdbuf_swapout_task, 1472 (rtems_task_argument) &bdbuf_cache); 1481 sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'), 1482 bdbuf_config.swapout_priority, 1483 RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT, 1484 rtems_bdbuf_swapout_task, 1485 0, 1486 &bdbuf_cache.swapout); 1473 1487 if (sc != RTEMS_SUCCESSFUL) 1474 1488 goto error; … … 2640 2654 worker->transfer.dd = BDBUF_INVALID_DEV; 2641 2655 2642 sc = rtems_task_create (rtems_build_name('B', 'D', 'o', 'a' + w), 2643 (bdbuf_config.swapout_priority ? 2644 bdbuf_config.swapout_priority : 2645 RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT), 2646 SWAPOUT_TASK_STACK_SIZE, 2647 RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, 2648 RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT, 2649 &worker->id); 2656 sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w), 2657 bdbuf_config.swapout_worker_priority, 2658 RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT, 2659 rtems_bdbuf_swapout_worker_task, 2660 (rtems_task_argument) worker, 2661 &worker->id); 2650 2662 if (sc != RTEMS_SUCCESSFUL) 2651 2663 rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_CREATE); 2652 2653 sc = rtems_task_start (worker->id,2654 rtems_bdbuf_swapout_worker_task,2655 (rtems_task_argument) worker);2656 if (sc != RTEMS_SUCCESSFUL)2657 rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_START);2658 2664 } 2659 2665
Note: See TracChangeset
for help on using the changeset viewer.