Changeset b6911069 in rtems
- Timestamp:
- 05/29/12 16:02:52 (11 years ago)
- Branches:
- 4.11, 5, 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)
- Files:
-
- 14 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 -
cpukit/sapi/include/confdefs.h
rbb08c0c8 rb6911069 1226 1226 RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT 1227 1227 #endif 1228 #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE 1229 #define CONFIGURE_BDBUF_TASK_STACK_SIZE \ 1230 RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT 1231 #endif 1228 1232 #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE 1229 1233 #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \ … … 1247 1251 CONFIGURE_SWAPOUT_WORKER_TASKS, 1248 1252 CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY, 1253 CONFIGURE_BDBUF_TASK_STACK_SIZE, 1249 1254 CONFIGURE_BDBUF_CACHE_MEMORY_SIZE, 1250 1255 CONFIGURE_BDBUF_BUFFER_MIN_SIZE, … … 1252 1257 }; 1253 1258 #endif 1259 1260 #define CONFIGURE_LIBBLOCK_TASKS (1 + CONFIGURE_SWAPOUT_WORKER_TASKS) 1261 1262 #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \ 1263 (CONFIGURE_LIBBLOCK_TASKS * \ 1264 (CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \ 1265 0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)) 1254 1266 1255 1267 /* … … 1270 1282 #endif 1271 1283 #else 1284 #define CONFIGURE_LIBBLOCK_TASKS 0 1285 #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS 0 1272 1286 #define CONFIGURE_LIBBLOCK_SEMAPHORES 0 1273 1287 #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ … … 1456 1470 #define CONFIGURE_MAXIMUM_TASKS 0 1457 1471 #endif 1472 1473 #define CONFIGURE_TASKS \ 1474 (CONFIGURE_MAXIMUM_TASKS + CONFIGURE_LIBBLOCK_TASKS) 1458 1475 1459 1476 #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS … … 2074 2091 */ 2075 2092 #define CONFIGURE_TOTAL_TASKS_AND_THREADS \ 2076 (CONFIGURE_ MAXIMUM_TASKS + \2093 (CONFIGURE_TASKS + \ 2077 2094 CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \ 2078 2095 CONFIGURE_MAXIMUM_GOROUTINES) … … 2177 2194 2178 2195 #define CONFIGURE_TASKS_STACK \ 2179 (_Configure_Max_Objects( CONFIGURE_ MAXIMUM_TASKS ) * \2196 (_Configure_Max_Objects( CONFIGURE_TASKS ) * \ 2180 2197 _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) ) 2181 2198 … … 2220 2237 CONFIGURE_ADA_TASKS_STACK + \ 2221 2238 CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \ 2239 CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \ 2222 2240 CONFIGURE_EXTRA_TASK_STACKS \ 2223 2241 ) … … 2228 2246 */ 2229 2247 rtems_api_configuration_table Configuration_RTEMS_API = { 2230 CONFIGURE_ MAXIMUM_TASKS,2248 CONFIGURE_TASKS, 2231 2249 CONFIGURE_NOTEPADS_ENABLED, 2232 2250 CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER, -
testsuites/libtests/block01/init.c
rbb08c0c8 rb6911069 254 254 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 255 255 256 #define CONFIGURE_MAXIMUM_TASKS 2256 #define CONFIGURE_MAXIMUM_TASKS 1 257 257 #define CONFIGURE_MAXIMUM_DRIVERS 2 258 #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)259 258 260 259 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -
testsuites/libtests/block02/init.c
rbb08c0c8 rb6911069 200 200 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 201 201 202 #define CONFIGURE_MAXIMUM_TASKS 5202 #define CONFIGURE_MAXIMUM_TASKS 3 203 203 #define CONFIGURE_MAXIMUM_DRIVERS 3 204 204 -
testsuites/libtests/block03/init.c
rbb08c0c8 rb6911069 187 187 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 188 188 189 #define CONFIGURE_MAXIMUM_TASKS 5189 #define CONFIGURE_MAXIMUM_TASKS 3 190 190 #define CONFIGURE_MAXIMUM_DRIVERS 2 191 191 -
testsuites/libtests/block04/init.c
rbb08c0c8 rb6911069 159 159 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 160 160 161 #define CONFIGURE_MAXIMUM_TASKS 5161 #define CONFIGURE_MAXIMUM_TASKS 3 162 162 #define CONFIGURE_MAXIMUM_DRIVERS 2 163 163 -
testsuites/libtests/block05/init.c
rbb08c0c8 rb6911069 517 517 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 518 518 519 #define CONFIGURE_MAXIMUM_TASKS 6519 #define CONFIGURE_MAXIMUM_TASKS 4 520 520 #define CONFIGURE_MAXIMUM_DRIVERS 4 521 521 -
testsuites/libtests/block06/init.c
rbb08c0c8 rb6911069 113 113 114 114 #define BDBUF_TEST_TASKS (3) 115 116 #define BDBUF_TEST_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE) 115 117 116 118 /** … … 650 652 tc->name[2], tc->name[3]), 651 653 priority, 652 8 * 1024,654 BDBUF_TEST_STACK_SIZE, 653 655 RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, 654 656 RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, … … 1843 1845 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 1844 1846 1845 #define CONFIGURE_MAXIMUM_TASKS 81847 #define CONFIGURE_MAXIMUM_TASKS (1 + BDBUF_TEST_TASKS) 1846 1848 #define CONFIGURE_MAXIMUM_DRIVERS 3 1847 1849 #define CONFIGURE_MAXIMUM_SEMAPHORES 2 1848 1850 1849 #define CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE) 1850 1851 #define CONFIGURE_EXTRA_TASK_STACKS \ 1852 (BDBUF_TEST_TASKS * BDBUF_TEST_STACK_SIZE) 1853 1854 #define CONFIGURE_INIT_TASK_STACK_SIZE BDBUF_TEST_STACK_SIZE 1851 1855 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE 1852 1856 -
testsuites/libtests/block07/init.c
rbb08c0c8 rb6911069 263 263 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 264 264 265 #define CONFIGURE_MAXIMUM_TASKS 6265 #define CONFIGURE_MAXIMUM_TASKS 4 266 266 #define CONFIGURE_MAXIMUM_DRIVERS 2 267 267 -
testsuites/libtests/block09/init.c
rbb08c0c8 rb6911069 229 229 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 230 230 231 #define CONFIGURE_MAXIMUM_TASKS 3231 #define CONFIGURE_MAXIMUM_TASKS 1 232 232 #define CONFIGURE_MAXIMUM_DRIVERS 4 233 233 -
testsuites/libtests/block10/init.c
rbb08c0c8 rb6911069 474 474 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 475 475 476 #define CONFIGURE_MAXIMUM_TASKS 5476 #define CONFIGURE_MAXIMUM_TASKS 3 477 477 #define CONFIGURE_MAXIMUM_DRIVERS 4 478 478 -
testsuites/libtests/block11/init.c
rbb08c0c8 rb6911069 397 397 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5 398 398 399 #define CONFIGURE_MAXIMUM_TASKS 2399 #define CONFIGURE_MAXIMUM_TASKS 1 400 400 #define CONFIGURE_MAXIMUM_DRIVERS 2 401 #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)402 401 403 402 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -
testsuites/libtests/block12/init.c
rbb08c0c8 rb6911069 143 143 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM 144 144 145 #define CONFIGURE_MAXIMUM_TASKS 2 146 147 #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024) 145 #define CONFIGURE_MAXIMUM_TASKS 1 148 146 149 147 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
Note: See TracChangeset
for help on using the changeset viewer.