Changeset e308b3a7 in rtems
- Timestamp:
- May 31, 2012, 9:06:50 AM (9 years ago)
- Children:
- 6b24b88
- Parents:
- 486f8b84 (diff), f164ae75 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/pc386/startup/linkcmds
r486f8b84 re308b3a7 80 80 *(set_domain_*); 81 81 *(set_pseudo_*); 82 _bsd__start_set_modmetadata_set = .; 83 *(_bsd_set_modmetadata_set); 84 _bsd__stop_set_modmetadata_set = .; 85 _bsd__start_set_sysctl_set = .; 86 *(_bsd_set_sysctl_set); 87 _bsd__stop_set_sysctl_set = .; 88 _bsd__start_set_sysinit_set = .; 89 *(_bsd_set_sysinit_*); 90 _bsd__stop_set_sysinit_set = .; 91 92 bsp_section_rodata_end = .; 82 93 83 94 } =0x90909090 -
cpukit/libblock/Makefile.am
r486f8b84 re308b3a7 9 9 src/blkdev-ops.c \ 10 10 src/diskdevs.c \ 11 src/diskdevs-init.c \ 11 12 src/flashdisk.c \ 12 13 src/ramdisk-driver.c \ -
cpukit/libblock/include/rtems/bdbuf.h
r486f8b84 re308b3a7 142 142 * to another requester until released back to the cache. The same goes to a 143 143 * buffer in the transfer state. The transfer state means being read or 144 * written. If the file system has modif ed the block and releases it as144 * written. If the file system has modified the block and releases it as 145 145 * modified it placed on the cache's modified list and a hold timer 146 146 * initialised. The buffer is held for the hold time before being written to … … 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 /** … … 456 463 /** 457 464 * Get block buffer for data to be written into. The buffers is set to the 458 * access or modif ed access state. If the buffer is in the cache and modified465 * access or modified access state. If the buffer is in the cache and modified 459 466 * the state is access modified else the state is access. This buffer contents 460 467 * are not initialised if the buffer is not already in the cache. If the block … … 484 491 rtems_status_code 485 492 rtems_bdbuf_get ( 486 constrtems_disk_device *dd,493 rtems_disk_device *dd, 487 494 rtems_blkdev_bnum block, 488 495 rtems_bdbuf_buffer** bd … … 492 499 * Get the block buffer and if not already in the cache read from the disk. If 493 500 * specified block already cached return. The buffer is set to the access or 494 * modif ed access state. If the buffer is in the cache and modified the state501 * modified access state. If the buffer is in the cache and modified the state 495 502 * is access modified else the state is access. If block is already being read 496 503 * from disk for being written to disk this call blocks. If the buffer is … … 518 525 rtems_status_code 519 526 rtems_bdbuf_read ( 520 constrtems_disk_device *dd,527 rtems_disk_device *dd, 521 528 rtems_blkdev_bnum block, 522 529 rtems_bdbuf_buffer** bd … … 595 602 * Synchronize all modified buffers for this device with the disk and wait 596 603 * until the transfers have completed. The sync mutex for the cache is locked 597 * stopping the addition of any further modif ed buffers. It is only the604 * stopping the addition of any further modified buffers. It is only the 598 605 * currently modified buffers that are written. 599 606 * … … 610 617 */ 611 618 rtems_status_code 612 rtems_bdbuf_syncdev ( constrtems_disk_device *dd);619 rtems_bdbuf_syncdev (rtems_disk_device *dd); 613 620 614 621 /** … … 624 631 */ 625 632 void 626 rtems_bdbuf_purge_dev ( constrtems_disk_device *dd);633 rtems_bdbuf_purge_dev (rtems_disk_device *dd); 627 634 628 635 /** 629 636 * @brief Sets the block size of a disk device. 630 637 * 631 * This will also change the block_to_media_block_shift and bds_per_group 632 * fields of the disk device. 638 * This will set the block size derived fields of the disk device. 633 639 * 634 640 * Before you can use this function, the rtems_bdbuf_init() routine must be -
cpukit/libblock/include/rtems/bdpart.h
r486f8b84 re308b3a7 401 401 const char *disk_name, 402 402 int *fd_ptr, 403 constrtems_disk_device **dd_ptr,403 rtems_disk_device **dd_ptr, 404 404 rtems_blkdev_bnum *disk_end 405 405 ); -
cpukit/libblock/include/rtems/blkdev.h
r486f8b84 re308b3a7 193 193 static inline int rtems_disk_fd_get_disk_device( 194 194 int fd, 195 constrtems_disk_device **dd_ptr195 rtems_disk_device **dd_ptr 196 196 ) 197 197 { -
cpukit/libblock/include/rtems/diskdevs.h
r486f8b84 re308b3a7 93 93 94 94 /** 95 * @brief Start block number.96 * 97 * Equals zero for physical devices. It is a block offset to the related98 * physical device for logical device.95 * @brief Start media block number. 96 * 97 * Equals zero for physical devices. It is a media block offset to the 98 * related physical device for logical device. 99 99 */ 100 100 rtems_blkdev_bnum start; 101 101 102 102 /** 103 * @brief Size of the physical or logical disk in blocks.103 * @brief Size of the physical or logical disk in media blocks. 104 104 */ 105 105 rtems_blkdev_bnum size; 106 106 107 107 /** 108 * @brief Device block size in bytes. 109 * 110 * This is the minimum transfer unit. It must be positive. 108 * @brief Media block size in bytes. 109 * 110 * This is the media transfer unit the hardware defaults to. 111 */ 112 uint32_t media_block_size; 113 114 /** 115 * @brief Block size in bytes. 116 * 117 * This is the minimum transfer unit. It may be a multiple of the media 118 * block size. It must be positive. 111 119 * 112 120 * @see rtems_bdbuf_set_block_size(). … … 115 123 116 124 /** 117 * @brief Device media block size in bytes. 118 * 119 * This is the media transfer unit the hardware defaults to. 120 */ 121 uint32_t media_block_size; 125 * @brief Block count. 126 * 127 * @see rtems_bdbuf_set_block_size(). 128 */ 129 rtems_blkdev_bnum block_count; 130 131 /** 132 * @brief Media blocks per device blocks. 133 * 134 * @see rtems_bdbuf_set_block_size(). 135 */ 136 uint32_t media_blocks_per_block; 122 137 123 138 /** … … 260 275 * A logical disk manages a subset of consecutive blocks contained in the 261 276 * physical disk with identifier @a phys. The start block index of the logical 262 * disk device is @a b egin_block. The block count of the logcal disk will be277 * disk device is @a block_begin. The block count of the logcal disk will be 263 278 * @a block_count. The blocks must be within the range of blocks managed by 264 279 * the associated physical disk device. A device node will be registered in … … 279 294 dev_t dev, 280 295 dev_t phys, 281 rtems_blkdev_bnum b egin_block,296 rtems_blkdev_bnum block_begin, 282 297 rtems_blkdev_bnum block_count, 283 298 const char *name … … 374 389 rtems_disk_device *rtems_disk_next(dev_t dev); 375 390 391 /* Internal function, do not use */ 392 rtems_status_code rtems_disk_init_phys( 393 rtems_disk_device *dd, 394 uint32_t block_size, 395 rtems_blkdev_bnum block_count, 396 rtems_block_device_ioctl handler, 397 void *driver_data 398 ); 399 400 /* Internal function, do not use */ 401 rtems_status_code rtems_disk_init_log( 402 rtems_disk_device *dd, 403 rtems_disk_device *phys_dd, 404 rtems_blkdev_bnum block_begin, 405 rtems_blkdev_bnum block_count 406 ); 407 376 408 #ifdef __cplusplus 377 409 } -
cpukit/libblock/src/bdbuf.c
r486f8b84 re308b3a7 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 /** … … 1244 1237 static rtems_bdbuf_buffer * 1245 1238 rtems_bdbuf_get_buffer_from_lru_list (const rtems_disk_device *dd, 1246 rtems_blkdev_bnum block, 1247 size_t bds_per_group) 1239 rtems_blkdev_bnum block) 1248 1240 { 1249 1241 rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru); … … 1258 1250 bd - bdbuf_cache.bds, 1259 1251 bd->group - bdbuf_cache.groups, bd->group->users, 1260 bd->group->bds_per_group, bds_per_group);1252 bd->group->bds_per_group, dd->bds_per_group); 1261 1253 1262 1254 /* … … 1265 1257 if (bd->waiters == 0) 1266 1258 { 1267 if (bd->group->bds_per_group == bds_per_group)1259 if (bd->group->bds_per_group == dd->bds_per_group) 1268 1260 { 1269 1261 rtems_bdbuf_remove_from_tree_and_lru_list (bd); … … 1272 1264 } 1273 1265 else if (bd->group->users == 0) 1274 empty_bd = rtems_bdbuf_group_realloc (bd->group, bds_per_group);1266 empty_bd = rtems_bdbuf_group_realloc (bd->group, dd->bds_per_group); 1275 1267 } 1276 1268 … … 1286 1278 1287 1279 return NULL; 1280 } 1281 1282 static rtems_status_code 1283 rtems_bdbuf_create_task( 1284 rtems_name name, 1285 rtems_task_priority priority, 1286 rtems_task_priority default_priority, 1287 rtems_task_entry entry, 1288 rtems_task_argument arg, 1289 rtems_id *id 1290 ) 1291 { 1292 rtems_status_code sc; 1293 size_t stack_size = bdbuf_config.task_stack_size ? 1294 bdbuf_config.task_stack_size : RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT; 1295 1296 priority = priority != 0 ? priority : default_priority; 1297 1298 sc = rtems_task_create (name, 1299 priority, 1300 stack_size, 1301 RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, 1302 RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT, 1303 id); 1304 1305 if (sc == RTEMS_SUCCESSFUL) 1306 sc = rtems_task_start (*id, entry, arg); 1307 1308 return sc; 1288 1309 } 1289 1310 … … 1457 1478 bdbuf_cache.swapout_enabled = true; 1458 1479 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); 1480 sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'), 1481 bdbuf_config.swapout_priority, 1482 RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT, 1483 rtems_bdbuf_swapout_task, 1484 0, 1485 &bdbuf_cache.swapout); 1473 1486 if (sc != RTEMS_SUCCESSFUL) 1474 1487 goto error; … … 1675 1688 static rtems_bdbuf_buffer * 1676 1689 rtems_bdbuf_get_buffer_for_read_ahead (const rtems_disk_device *dd, 1677 rtems_blkdev_bnum block, 1678 size_t bds_per_group) 1690 rtems_blkdev_bnum block) 1679 1691 { 1680 1692 rtems_bdbuf_buffer *bd = NULL; … … 1684 1696 if (bd == NULL) 1685 1697 { 1686 bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block , bds_per_group);1698 bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block); 1687 1699 1688 1700 if (bd != NULL) … … 1701 1713 static rtems_bdbuf_buffer * 1702 1714 rtems_bdbuf_get_buffer_for_access (const rtems_disk_device *dd, 1703 rtems_blkdev_bnum block, 1704 size_t bds_per_group) 1715 rtems_blkdev_bnum block) 1705 1716 { 1706 1717 rtems_bdbuf_buffer *bd = NULL; … … 1712 1723 if (bd != NULL) 1713 1724 { 1714 if (bd->group->bds_per_group != bds_per_group)1725 if (bd->group->bds_per_group != dd->bds_per_group) 1715 1726 { 1716 1727 if (rtems_bdbuf_wait_for_recycle (bd)) … … 1725 1736 else 1726 1737 { 1727 bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block , bds_per_group);1738 bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block); 1728 1739 1729 1740 if (bd == NULL) … … 1744 1755 rtems_blkdev_bnum *media_block_ptr) 1745 1756 { 1746 /* 1747 * Compute the media block number. Drivers work with media block number not 1748 * the block number a BD may have as this depends on the block size set by 1749 * the user. 1750 */ 1751 rtems_blkdev_bnum mb = rtems_bdbuf_media_block (dd, block); 1752 if (mb >= dd->size) 1753 { 1754 return RTEMS_INVALID_ID; 1755 } 1756 1757 *media_block_ptr = mb + dd->start; 1758 1759 return RTEMS_SUCCESSFUL; 1757 rtems_status_code sc = RTEMS_SUCCESSFUL; 1758 1759 if (block < dd->block_count) 1760 { 1761 /* 1762 * Compute the media block number. Drivers work with media block number not 1763 * the block number a BD may have as this depends on the block size set by 1764 * the user. 1765 */ 1766 *media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start; 1767 } 1768 else 1769 { 1770 sc = RTEMS_INVALID_ID; 1771 } 1772 1773 return sc; 1760 1774 } 1761 1775 1762 1776 rtems_status_code 1763 rtems_bdbuf_get ( const rtems_disk_device*dd,1777 rtems_bdbuf_get (rtems_disk_device *dd, 1764 1778 rtems_blkdev_bnum block, 1765 1779 rtems_bdbuf_buffer **bd_ptr) … … 1767 1781 rtems_status_code sc = RTEMS_SUCCESSFUL; 1768 1782 rtems_bdbuf_buffer *bd = NULL; 1769 rtems_blkdev_bnum media_block = 0; 1783 rtems_blkdev_bnum media_block; 1784 1785 rtems_bdbuf_lock_cache (); 1770 1786 1771 1787 sc = rtems_bdbuf_get_media_block (dd, block, &media_block); 1772 if (sc != RTEMS_SUCCESSFUL) 1773 return sc; 1774 1775 rtems_bdbuf_lock_cache (); 1776 1777 /* 1778 * Print the block index relative to the physical disk. 1779 */ 1780 if (rtems_bdbuf_tracer) 1781 printf ("bdbuf:get: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n", 1782 media_block, block, (unsigned) dd->dev); 1783 1784 bd = rtems_bdbuf_get_buffer_for_access (dd, media_block, dd->bds_per_group); 1785 1786 switch (bd->state) 1787 { 1788 case RTEMS_BDBUF_STATE_CACHED: 1789 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED); 1790 break; 1791 case RTEMS_BDBUF_STATE_EMPTY: 1792 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_EMPTY); 1793 break; 1794 case RTEMS_BDBUF_STATE_MODIFIED: 1795 /* 1796 * To get a modified buffer could be considered a bug in the caller 1797 * because you should not be getting an already modified buffer but user 1798 * may have modified a byte in a block then decided to seek the start and 1799 * write the whole block and the file system will have no record of this 1800 * so just gets the block to fill. 1801 */ 1802 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED); 1803 break; 1804 default: 1805 rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_2); 1806 break; 1807 } 1808 1809 if (rtems_bdbuf_tracer) 1810 { 1811 rtems_bdbuf_show_users ("get", bd); 1812 rtems_bdbuf_show_usage (); 1788 if (sc == RTEMS_SUCCESSFUL) 1789 { 1790 /* 1791 * Print the block index relative to the physical disk. 1792 */ 1793 if (rtems_bdbuf_tracer) 1794 printf ("bdbuf:get: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n", 1795 media_block, block, (unsigned) dd->dev); 1796 1797 bd = rtems_bdbuf_get_buffer_for_access (dd, media_block); 1798 1799 switch (bd->state) 1800 { 1801 case RTEMS_BDBUF_STATE_CACHED: 1802 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED); 1803 break; 1804 case RTEMS_BDBUF_STATE_EMPTY: 1805 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_EMPTY); 1806 break; 1807 case RTEMS_BDBUF_STATE_MODIFIED: 1808 /* 1809 * To get a modified buffer could be considered a bug in the caller 1810 * because you should not be getting an already modified buffer but 1811 * user may have modified a byte in a block then decided to seek the 1812 * start and write the whole block and the file system will have no 1813 * record of this so just gets the block to fill. 1814 */ 1815 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED); 1816 break; 1817 default: 1818 rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_2); 1819 break; 1820 } 1821 1822 if (rtems_bdbuf_tracer) 1823 { 1824 rtems_bdbuf_show_users ("get", bd); 1825 rtems_bdbuf_show_usage (); 1826 } 1813 1827 } 1814 1828 … … 1817 1831 *bd_ptr = bd; 1818 1832 1819 return RTEMS_SUCCESSFUL;1833 return sc; 1820 1834 } 1821 1835 … … 1842 1856 rtems_bdbuf_create_read_request (const rtems_disk_device *dd, 1843 1857 rtems_blkdev_bnum media_block, 1844 size_t bds_per_group,1845 1858 rtems_blkdev_request *req, 1846 1859 rtems_bdbuf_buffer **bd_ptr) … … 1865 1878 req->bufnum = 0; 1866 1879 1867 bd = rtems_bdbuf_get_buffer_for_access (dd, media_block , bds_per_group);1880 bd = rtems_bdbuf_get_buffer_for_access (dd, media_block); 1868 1881 1869 1882 *bd_ptr = bd; … … 1894 1907 media_block += media_block_count; 1895 1908 1896 bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block, 1897 bds_per_group); 1909 bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block); 1898 1910 1899 1911 if (bd == NULL) … … 1979 1991 1980 1992 rtems_status_code 1981 rtems_bdbuf_read ( const rtems_disk_device*dd,1993 rtems_bdbuf_read (rtems_disk_device *dd, 1982 1994 rtems_blkdev_bnum block, 1983 1995 rtems_bdbuf_buffer **bd_ptr) … … 1986 1998 rtems_blkdev_request *req = NULL; 1987 1999 rtems_bdbuf_buffer *bd = NULL; 1988 rtems_blkdev_bnum media_block = 0; 1989 1990 sc = rtems_bdbuf_get_media_block (dd, block, &media_block); 1991 if (sc != RTEMS_SUCCESSFUL) 1992 return sc; 2000 rtems_blkdev_bnum media_block; 1993 2001 1994 2002 /* … … 2001 2009 (bdbuf_config.max_read_ahead_blocks + 1)); 2002 2010 2003 if (rtems_bdbuf_tracer)2004 printf ("bdbuf:read: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",2005 media_block + dd->start, block, (unsigned) dd->dev);2006 2007 2011 rtems_bdbuf_lock_cache (); 2008 rtems_bdbuf_create_read_request (dd, media_block, dd->bds_per_group, req, &bd); 2009 2010 if (req->bufnum > 0) 2011 { 2012 sc = rtems_bdbuf_execute_transfer_request (dd, req, true); 2012 2013 sc = rtems_bdbuf_get_media_block (dd, block, &media_block); 2014 if (sc == RTEMS_SUCCESSFUL) 2015 { 2016 if (rtems_bdbuf_tracer) 2017 printf ("bdbuf:read: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n", 2018 media_block + dd->start, block, (unsigned) dd->dev); 2019 2020 rtems_bdbuf_create_read_request (dd, media_block, req, &bd); 2021 2022 if (req->bufnum > 0) 2023 { 2024 sc = rtems_bdbuf_execute_transfer_request (dd, req, true); 2025 if (sc == RTEMS_SUCCESSFUL) 2026 { 2027 rtems_chain_extract_unprotected (&bd->link); 2028 rtems_bdbuf_group_obtain (bd); 2029 } 2030 } 2031 2013 2032 if (sc == RTEMS_SUCCESSFUL) 2014 2033 { 2015 rtems_chain_extract_unprotected (&bd->link); 2016 rtems_bdbuf_group_obtain (bd); 2017 } 2018 } 2019 2020 if (sc == RTEMS_SUCCESSFUL) 2021 { 2022 switch (bd->state) 2023 { 2024 case RTEMS_BDBUF_STATE_CACHED: 2025 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED); 2026 break; 2027 case RTEMS_BDBUF_STATE_MODIFIED: 2028 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED); 2029 break; 2030 default: 2031 rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_4); 2032 break; 2033 } 2034 2035 if (rtems_bdbuf_tracer) 2036 { 2037 rtems_bdbuf_show_users ("read", bd); 2038 rtems_bdbuf_show_usage (); 2039 } 2040 2041 *bd_ptr = bd; 2042 } 2043 else 2044 *bd_ptr = NULL; 2034 switch (bd->state) 2035 { 2036 case RTEMS_BDBUF_STATE_CACHED: 2037 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED); 2038 break; 2039 case RTEMS_BDBUF_STATE_MODIFIED: 2040 rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED); 2041 break; 2042 default: 2043 rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_4); 2044 break; 2045 } 2046 2047 if (rtems_bdbuf_tracer) 2048 { 2049 rtems_bdbuf_show_users ("read", bd); 2050 rtems_bdbuf_show_usage (); 2051 } 2052 } 2053 else 2054 { 2055 bd = NULL; 2056 } 2057 } 2045 2058 2046 2059 rtems_bdbuf_unlock_cache (); 2060 2061 *bd_ptr = bd; 2047 2062 2048 2063 return sc; … … 2163 2178 2164 2179 rtems_status_code 2165 rtems_bdbuf_syncdev ( constrtems_disk_device *dd)2180 rtems_bdbuf_syncdev (rtems_disk_device *dd) 2166 2181 { 2167 2182 if (rtems_bdbuf_tracer) … … 2640 2655 worker->transfer.dd = BDBUF_INVALID_DEV; 2641 2656 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); 2657 sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w), 2658 bdbuf_config.swapout_worker_priority, 2659 RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT, 2660 rtems_bdbuf_swapout_worker_task, 2661 (rtems_task_argument) worker, 2662 &worker->id); 2650 2663 if (sc != RTEMS_SUCCESSFUL) 2651 2664 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 2665 } 2659 2666 … … 2872 2879 2873 2880 void 2874 rtems_bdbuf_purge_dev ( constrtems_disk_device *dd)2881 rtems_bdbuf_purge_dev (rtems_disk_device *dd) 2875 2882 { 2876 2883 rtems_chain_control purge_list; … … 2909 2916 2910 2917 dd->block_size = block_size; 2918 dd->block_count = dd->size / media_blocks_per_block; 2919 dd->media_blocks_per_block = media_blocks_per_block; 2911 2920 dd->block_to_media_block_shift = block_to_media_block_shift; 2912 2921 dd->bds_per_group = bds_per_group; -
cpukit/libblock/src/bdpart-read.c
r486f8b84 re308b3a7 69 69 const char *disk_name, 70 70 int *fd_ptr, 71 constrtems_disk_device **dd_ptr,71 rtems_disk_device **dd_ptr, 72 72 rtems_blkdev_bnum *disk_end 73 73 ) … … 76 76 int rv = 0; 77 77 int fd = -1; 78 constrtems_disk_device *dd = NULL;78 rtems_disk_device *dd = NULL; 79 79 rtems_blkdev_bnum disk_begin = 0; 80 80 rtems_blkdev_bnum block_size = 0; … … 186 186 187 187 static rtems_status_code rtems_bdpart_read_record( 188 constrtems_disk_device *dd,188 rtems_disk_device *dd, 189 189 rtems_blkdev_bnum index, 190 190 rtems_bdbuf_buffer **block … … 238 238 const uint8_t *data = NULL; 239 239 int fd = -1; 240 constrtems_disk_device *dd = NULL;240 rtems_disk_device *dd = NULL; 241 241 242 242 /* Check parameter */ -
cpukit/libblock/src/bdpart-register.c
r486f8b84 re308b3a7 49 49 size_t i = 0; 50 50 int fd = -1; 51 constrtems_disk_device *dd = NULL;51 rtems_disk_device *dd = NULL; 52 52 53 53 /* Get disk data */ … … 140 140 size_t i = 0; 141 141 int fd = -1; 142 constrtems_disk_device *dd = NULL;142 rtems_disk_device *dd = NULL; 143 143 144 144 /* Get disk data */ -
cpukit/libblock/src/bdpart-write.c
r486f8b84 re308b3a7 46 46 47 47 static rtems_status_code rtems_bdpart_new_record( 48 constrtems_disk_device *dd,48 rtems_disk_device *dd, 49 49 rtems_blkdev_bnum index, 50 50 rtems_bdbuf_buffer **block … … 104 104 uint8_t *data = NULL; 105 105 int fd = -1; 106 constrtems_disk_device *dd = NULL;106 rtems_disk_device *dd = NULL; 107 107 108 108 /* Check if we have something to do */ -
cpukit/libblock/src/blkdev-imfs.c
r486f8b84 re308b3a7 39 39 { 40 40 int rv; 41 constrtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);42 constrtems_disk_device *dd = &ctx->dd;41 rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); 42 rtems_disk_device *dd = &ctx->dd; 43 43 ssize_t remaining = (ssize_t) count; 44 44 off_t offset = iop->offset; … … 93 93 { 94 94 int rv; 95 constrtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);96 constrtems_disk_device *dd = &ctx->dd;95 rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); 96 rtems_disk_device *dd = &ctx->dd; 97 97 ssize_t remaining = (ssize_t) count; 98 98 off_t offset = iop->offset; … … 175 175 ) 176 176 { 177 constrtems_blkdev_imfs_context *ctx =177 rtems_blkdev_imfs_context *ctx = 178 178 IMFS_generic_get_context_by_location(loc); 179 constrtems_disk_device *dd = &ctx->dd;179 rtems_disk_device *dd = &ctx->dd; 180 180 181 181 buf->st_rdev = rtems_disk_get_device_identifier(dd); … … 191 191 { 192 192 int rv = 0; 193 constrtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);194 constrtems_disk_device *dd = &ctx->dd;193 rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); 194 rtems_disk_device *dd = &ctx->dd; 195 195 rtems_status_code sc = rtems_bdbuf_syncdev(dd); 196 196 … … 270 270 { 271 271 rtems_status_code sc = RTEMS_SUCCESSFUL; 272 273 if (block_count > 0) { 274 rtems_blkdev_imfs_context *ctx = calloc(1, sizeof(*ctx)); 275 276 if (ctx != NULL) { 277 rtems_disk_device *dd = &ctx->dd; 278 279 ctx->fd = -1; 280 281 dd->phys_dev = dd; 282 dd->size = block_count; 283 dd->media_block_size = block_size; 284 dd->ioctl = handler; 285 dd->driver_data = driver_data; 286 287 if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) != 0) { 288 dd->capabilities = 0; 289 } 290 291 sc = rtems_bdbuf_set_block_size(dd, block_size); 292 if (sc == RTEMS_SUCCESSFUL) { 293 int rv = IMFS_make_generic_node( 294 device, 295 S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO, 296 &rtems_blkdev_imfs_control, 297 ctx 298 ); 299 300 if (rv != 0) { 301 free(ctx); 302 sc = RTEMS_UNSATISFIED; 303 } 304 } else { 272 rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx)); 273 274 if (ctx != NULL) { 275 sc = rtems_disk_init_phys( 276 &ctx->dd, 277 block_size, 278 block_count, 279 handler, 280 driver_data 281 ); 282 283 ctx->fd = -1; 284 285 if (sc == RTEMS_SUCCESSFUL) { 286 int rv = IMFS_make_generic_node( 287 device, 288 S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO, 289 &rtems_blkdev_imfs_control, 290 ctx 291 ); 292 293 if (rv != 0) { 305 294 free(ctx); 306 } 307 } else { 308 sc = RTEMS_NO_MEMORY; 309 } 310 } else { 311 sc = RTEMS_INVALID_NUMBER; 295 sc = RTEMS_UNSATISFIED; 296 } 297 } else { 298 free(ctx); 299 } 300 } else { 301 sc = RTEMS_NO_MEMORY; 312 302 } 313 303 … … 331 321 rv = fstat(fd, &st); 332 322 if (rv == 0 && S_ISBLK(st.st_mode)) { 333 rtems_disk_device * dd;334 335 rv = ioctl(fd, RTEMS_BLKIO_GETDISKDEV, &dd);323 rtems_disk_device *phys_dd; 324 325 rv = rtems_disk_fd_get_disk_device(fd, &phys_dd); 336 326 if (rv == 0) { 337 rtems_blkdev_bnum device_block_count = rtems_disk_get_block_count(dd); 338 339 if ( 340 block_begin < device_block_count 341 && block_count > 0 342 && block_count <= device_block_count - block_begin 343 ) { 344 rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx)); 345 346 if (ctx != NULL) { 347 memcpy(&ctx->dd, dd, sizeof(ctx->dd)); 348 349 ctx->dd.start = block_begin; 350 ctx->dd.size = block_count; 327 rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx)); 328 329 if (ctx != NULL) { 330 sc = rtems_disk_init_log( 331 &ctx->dd, 332 phys_dd, 333 block_begin, 334 block_count 335 ); 336 337 if (sc == RTEMS_SUCCESSFUL) { 351 338 ctx->fd = fd; 352 339 … … 363 350 } 364 351 } else { 365 sc = RTEMS_NO_MEMORY;352 free(ctx); 366 353 } 367 354 } else { 368 sc = RTEMS_ INVALID_NUMBER;355 sc = RTEMS_NO_MEMORY; 369 356 } 370 357 } else { -
cpukit/libblock/src/diskdevs.c
r486f8b84 re308b3a7 11 11 * Author: Victor V. Vengerov <vvv@oktet.ru> 12 12 * 13 * Copyright (c) 2009 embedded brains GmbH.13 * Copyright (c) 2009-2012 embedded brains GmbH. 14 14 */ 15 15 … … 171 171 172 172 static rtems_status_code 173 create_disk(dev_t dev, const char *name, rtems_disk_device **dd_ptr) 173 create_disk( 174 dev_t dev, 175 const char *name, 176 rtems_disk_device **dd_ptr, 177 char **alloc_name_ptr 178 ) 174 179 { 175 180 rtems_disk_device **dd_entry = create_disk_table_entry(dev); … … 208 213 } 209 214 210 dd->dev = dev;211 dd->name = alloc_name;212 dd->uses = 0;213 dd->deleted = false;214 215 215 *dd_entry = dd; 216 216 *dd_ptr = dd; 217 *alloc_name_ptr = alloc_name; 217 218 218 219 return RTEMS_SUCCESSFUL; … … 239 240 rtems_disk_device *dd = NULL; 240 241 rtems_status_code sc = RTEMS_SUCCESSFUL; 242 char *alloc_name = NULL; 241 243 242 244 if (handler == NULL) { … … 249 251 } 250 252 251 sc = create_disk(dev, name, &dd );253 sc = create_disk(dev, name, &dd, &alloc_name); 252 254 if (sc != RTEMS_SUCCESSFUL) { 253 255 disk_unlock(); … … 256 258 } 257 259 258 dd->phys_dev = dd; 259 dd->start = 0; 260 dd->size = block_count; 261 dd->media_block_size = block_size; 262 dd->ioctl = handler; 263 dd->driver_data = driver_data; 264 265 if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) < 0) { 266 dd->capabilities = 0; 267 } 268 269 sc = rtems_bdbuf_set_block_size(dd, block_size); 260 sc = rtems_disk_init_phys( 261 dd, 262 block_size, 263 block_count, 264 handler, 265 driver_data 266 ); 267 268 dd->dev = dev; 269 dd->name = alloc_name; 270 270 271 if (sc != RTEMS_SUCCESSFUL) { 271 272 dd->ioctl = null_handler; … … 290 291 dev_t dev, 291 292 dev_t phys, 292 rtems_blkdev_bnum b egin_block,293 rtems_blkdev_bnum block_begin, 293 294 rtems_blkdev_bnum block_count, 294 295 const char *name … … 296 297 { 297 298 rtems_status_code sc = RTEMS_SUCCESSFUL; 298 rtems_disk_device *phys ical_disk= NULL;299 rtems_disk_device *phys_dd = NULL; 299 300 rtems_disk_device *dd = NULL; 300 rtems_blkdev_bnum end_block = begin_block + block_count;301 char *alloc_name = NULL; 301 302 302 303 sc = disk_lock(); … … 305 306 } 306 307 307 phys ical_disk= get_disk_entry(phys, true);308 if (phys ical_disk == NULL || !is_physical_disk(physical_disk)) {308 phys_dd = get_disk_entry(phys, true); 309 if (phys_dd == NULL) { 309 310 disk_unlock(); 310 311 … … 312 313 } 313 314 314 if ( 315 begin_block >= physical_disk->size 316 || end_block <= begin_block 317 || end_block > physical_disk->size 318 ) { 315 sc = create_disk(dev, name, &dd, &alloc_name); 316 if (sc != RTEMS_SUCCESSFUL) { 319 317 disk_unlock(); 320 318 321 return RTEMS_INVALID_NUMBER; 322 } 323 324 sc = create_disk(dev, name, &dd); 325 if (sc != RTEMS_SUCCESSFUL) { 319 return sc; 320 } 321 322 sc = rtems_disk_init_log( 323 dd, 324 phys_dd, 325 block_begin, 326 block_count 327 ); 328 329 dd->dev = dev; 330 dd->name = alloc_name; 331 332 ++phys_dd->uses; 333 334 if (sc != RTEMS_SUCCESSFUL) { 335 dd->ioctl = null_handler; 336 rtems_disk_delete(dev); 326 337 disk_unlock(); 327 338 328 339 return sc; 329 340 } 330 331 dd->phys_dev = physical_disk;332 dd->start = begin_block;333 dd->size = block_count;334 dd->block_size = physical_disk->block_size;335 dd->media_block_size = physical_disk->media_block_size;336 dd->block_to_media_block_shift = physical_disk->block_to_media_block_shift;337 dd->bds_per_group = physical_disk->bds_per_group;338 dd->ioctl = physical_disk->ioctl;339 dd->driver_data = physical_disk->driver_data;340 341 ++physical_disk->uses;342 341 343 342 disk_unlock(); -
cpukit/sapi/include/confdefs.h
r486f8b84 re308b3a7 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/fstests/fsbdpart01/init.c
r486f8b84 re308b3a7 81 81 82 82 if (exists) { 83 constrtems_disk_device *dd = NULL;83 rtems_disk_device *dd = NULL; 84 84 int rv = 0; 85 85 -
testsuites/libtests/block01/init.c
r486f8b84 re308b3a7 49 49 rtems_status_code sc = RTEMS_SUCCESSFUL; 50 50 rtems_disk_device *dd = NULL; 51 constrtems_disk_device *fd_dd = NULL;51 rtems_disk_device *fd_dd = NULL; 52 52 int fd = -1; 53 53 int rv = -1; … … 184 184 ASSERT_SC_EQ(sc, RTEMS_RESOURCE_IN_USE); 185 185 186 sc = rtems_disk_create_log(logical_2_dev, logical_dev, 0, 1, "/dev/rda 1");186 sc = rtems_disk_create_log(logical_2_dev, logical_dev, 0, 1, "/dev/rda2"); 187 187 ASSERT_SC_EQ(sc, RTEMS_INVALID_ID); 188 188 … … 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
r486f8b84 re308b3a7 53 53 #define BLOCK_COUNT_B 1 54 54 55 static constrtems_disk_device *dd_a;56 57 static constrtems_disk_device *dd_b;55 static rtems_disk_device *dd_a; 56 57 static rtems_disk_device *dd_b; 58 58 59 59 static volatile bool sync_done = false; … … 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
r486f8b84 re308b3a7 49 49 #define BLOCK_COUNT 2 50 50 51 static constrtems_disk_device *dd;51 static rtems_disk_device *dd; 52 52 53 53 static volatile bool sync_done = false; … … 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
r486f8b84 re308b3a7 49 49 #define BLOCK_COUNT 1 50 50 51 static constrtems_disk_device *dd;51 static rtems_disk_device *dd; 52 52 53 53 static rtems_id task_id_low; … … 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
r486f8b84 re308b3a7 61 61 static unsigned output_level = 0; 62 62 63 static constrtems_disk_device *dd_a;64 65 static constrtems_disk_device *dd_b;63 static rtems_disk_device *dd_a; 64 65 static rtems_disk_device *dd_b; 66 66 67 67 static rtems_id task_id_init; … … 394 394 uint32_t block_size, 395 395 rtems_blkdev_bnum block_count, 396 constrtems_disk_device **dd_ptr396 rtems_disk_device **dd_ptr 397 397 ) 398 398 { … … 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
r486f8b84 re308b3a7 109 109 rtems_device_minor_number minor; 110 110 bool passed; 111 const rtems_disk_device*dd;111 rtems_disk_device *dd; 112 112 } bdbuf_task_control; 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 /** … … 344 346 rtems_id master, 345 347 rtems_device_major_number major, 346 const rtems_disk_device*dd)348 rtems_disk_device *dd) 347 349 { 348 350 char name[6]; … … 613 615 614 616 static bool 615 bdbuf_tests_setup_disk (rtems_device_major_number *major,616 const rtems_disk_device**dd_ptr)617 bdbuf_tests_setup_disk (rtems_device_major_number *major, 618 rtems_disk_device **dd_ptr) 617 619 { 618 620 rtems_status_code sc; … … 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, … … 1764 1766 int t; 1765 1767 bool passed = true; 1766 const rtems_disk_device*dd;1768 rtems_disk_device *dd; 1767 1769 1768 1770 /* … … 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
r486f8b84 re308b3a7 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/block08/bdbuf_tests.c
r486f8b84 re308b3a7 48 48 49 49 /** Device ID used for testing */ 50 constrtems_disk_device *test_dd = NULL;50 rtems_disk_device *test_dd = NULL; 51 51 52 52 /** Test result variable */ -
testsuites/libtests/block08/bdbuf_tests.h
r486f8b84 re308b3a7 151 151 152 152 /** Device ID used for testing */ 153 extern constrtems_disk_device *test_dd;153 extern rtems_disk_device *test_dd; 154 154 155 155 /** -
testsuites/libtests/block09/init.c
r486f8b84 re308b3a7 144 144 145 145 static void check_read( 146 constrtems_disk_device *dd,146 rtems_disk_device *dd, 147 147 rtems_blkdev_bnum block, 148 148 rtems_status_code expected_sc … … 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
r486f8b84 re308b3a7 56 56 typedef void (*release_func)(char task, rtems_bdbuf_buffer *bd); 57 57 58 static constrtems_disk_device *dd;58 static rtems_disk_device *dd; 59 59 60 60 static rtems_id task_id_init; … … 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
r486f8b84 re308b3a7 158 158 ramdisk *rd; 159 159 int fd; 160 constrtems_disk_device *dd;160 rtems_disk_device *dd; 161 161 struct stat st; 162 162 … … 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
r486f8b84 re308b3a7 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.