Whitespace removal.

This commit is contained in:
Ralf Corsepius
2009-11-30 03:33:25 +00:00
parent 44b06ca617
commit b1274bd94c
116 changed files with 428 additions and 428 deletions

View File

@@ -340,7 +340,7 @@ bdbuf_task_control_init (int task,
{ {
char name[6]; char name[6];
sprintf (name, "bdt%d", task); sprintf (name, "bdt%d", task);
tc->die = false; tc->die = false;
tc->name = strdup (name); /* leaks */ tc->name = strdup (name); /* leaks */
tc->task = 0; tc->task = 0;
@@ -366,7 +366,7 @@ bdbuf_disk_ioctl_watcher (bdbuf_disk* bdd, int update)
else else
bdd->watch_count = 0; bdd->watch_count = 0;
} }
if (bdd->watch_count == 0) if (bdd->watch_count == 0)
{ {
bdbuf_send_watch_event (bdd->watcher_name, bdbuf_send_watch_event (bdd->watcher_name,
@@ -375,7 +375,7 @@ bdbuf_disk_ioctl_watcher (bdbuf_disk* bdd, int update)
bdd->watcher = 0; bdd->watcher = 0;
} }
} }
return true; return true;
} }
@@ -385,7 +385,7 @@ bdbuf_disk_ioctl_process (bdbuf_disk* bdd, rtems_blkdev_request* req)
{ {
bool result = true; bool result = true;
int b; int b;
/* /*
* Perform the requested action. * Perform the requested action.
*/ */
@@ -393,7 +393,7 @@ bdbuf_disk_ioctl_process (bdbuf_disk* bdd, rtems_blkdev_request* req)
{ {
case BDBUF_DISK_NOOP: case BDBUF_DISK_NOOP:
break; break;
case BDBUF_DISK_WAIT: case BDBUF_DISK_WAIT:
if (bdd->waiting) if (bdd->waiting)
bdbuf_test_printf ("disk ioctl: bad waiter: %s:%08x\n", bdbuf_test_printf ("disk ioctl: bad waiter: %s:%08x\n",
@@ -445,7 +445,7 @@ bdbuf_disk_ioctl_leave (bdbuf_disk* bdd, int buffer_count)
* Handle the watcher. * Handle the watcher.
*/ */
bdbuf_disk_ioctl_watcher (bdd, buffer_count); bdbuf_disk_ioctl_watcher (bdd, buffer_count);
return true; return true;
} }
@@ -464,7 +464,7 @@ bdbuf_disk_ioctl (rtems_disk_device *dd, uint32_t req, void* argp)
bdbuf_disk *bdd = rtems_disk_driver_data (dd); bdbuf_disk *bdd = rtems_disk_driver_data (dd);
errno = 0; errno = 0;
if (!bdbuf_disk_lock (bdd)) if (!bdbuf_disk_lock (bdd))
{ {
errno = EIO; errno = EIO;
@@ -505,14 +505,14 @@ bdbuf_disk_ioctl (rtems_disk_device *dd, uint32_t req, void* argp)
} }
bdbuf_disk_ioctl_leave (bdd, r->bufnum); bdbuf_disk_ioctl_leave (bdd, r->bufnum);
break; break;
case RTEMS_BLKDEV_REQ_WRITE: case RTEMS_BLKDEV_REQ_WRITE:
if (!bdbuf_disk_ioctl_process (bdd, r)) if (!bdbuf_disk_ioctl_process (bdd, r))
errno = EIO; errno = EIO;
r->req_done (r->done_arg, RTEMS_SUCCESSFUL, 0); r->req_done (r->done_arg, RTEMS_SUCCESSFUL, 0);
bdbuf_disk_ioctl_leave (bdd, r->bufnum); bdbuf_disk_ioctl_leave (bdd, r->bufnum);
break; break;
default: default:
errno = EBADRQC; errno = EBADRQC;
break; break;
@@ -544,12 +544,12 @@ bdbuf_disk_initialize (rtems_device_major_number major,
void* arg) void* arg)
{ {
rtems_status_code sc; rtems_status_code sc;
bdbuf_test_printf ("disk io init: "); bdbuf_test_printf ("disk io init: ");
sc = rtems_disk_io_initialize (); sc = rtems_disk_io_initialize ();
if (!bdbuf_test_print_sc (sc, true)) if (!bdbuf_test_print_sc (sc, true))
return sc; return sc;
for (minor = 0; minor < BDBUF_DISKS; minor++) for (minor = 0; minor < BDBUF_DISKS; minor++)
{ {
char name[sizeof (BDBUF_DISK_DEVICE_BASE_NAME) + 10]; char name[sizeof (BDBUF_DISK_DEVICE_BASE_NAME) + 10];
@@ -560,7 +560,7 @@ bdbuf_disk_initialize (rtems_device_major_number major,
BDBUF_DISK_DEVICE_BASE_NAME "%" PRIu32, minor); BDBUF_DISK_DEVICE_BASE_NAME "%" PRIu32, minor);
bdd->name = strdup (name); bdd->name = strdup (name);
bdbuf_test_printf ("disk init: %s\n", bdd->name); bdbuf_test_printf ("disk init: %s\n", bdd->name);
bdbuf_test_printf ("disk lock: "); bdbuf_test_printf ("disk lock: ");
@@ -582,7 +582,7 @@ bdbuf_disk_initialize (rtems_device_major_number major,
bdbuf_test_print_sc (sc, true); bdbuf_test_print_sc (sc, true);
return sc; return sc;
} }
} }
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
@@ -607,7 +607,7 @@ static bool
bdbuf_tests_setup_disk (rtems_device_major_number* major) bdbuf_tests_setup_disk (rtems_device_major_number* major)
{ {
rtems_status_code sc; rtems_status_code sc;
/* /*
* Register the disk driver. * Register the disk driver.
*/ */
@@ -616,7 +616,7 @@ bdbuf_tests_setup_disk (rtems_device_major_number* major)
sc = rtems_io_register_driver (RTEMS_DRIVER_AUTO_MAJOR, sc = rtems_io_register_driver (RTEMS_DRIVER_AUTO_MAJOR,
&bdbuf_disk_io_ops, &bdbuf_disk_io_ops,
major); major);
return sc == RTEMS_SUCCESSFUL; return sc == RTEMS_SUCCESSFUL;
} }
@@ -629,7 +629,7 @@ bdbuf_tests_create_task (bdbuf_task_control* tc,
bdbuf_test_printf ("creating task: %s: priority: %d: ", bdbuf_test_printf ("creating task: %s: priority: %d: ",
tc->name, priority); tc->name, priority);
sc = rtems_task_create (rtems_build_name (tc->name[0], tc->name[1], sc = rtems_task_create (rtems_build_name (tc->name[0], tc->name[1],
tc->name[2], tc->name[3]), tc->name[2], tc->name[3]),
priority, priority,
@@ -639,9 +639,9 @@ bdbuf_tests_create_task (bdbuf_task_control* tc,
&tc->task); &tc->task);
if (!bdbuf_test_print_sc (sc, true)) if (!bdbuf_test_print_sc (sc, true))
return false; return false;
bdbuf_test_printf ("starting task: %s: ", tc->name); bdbuf_test_printf ("starting task: %s: ", tc->name);
sc = rtems_task_start (tc->task, entry_point, (rtems_task_argument) tc); sc = rtems_task_start (tc->task, entry_point, (rtems_task_argument) tc);
return bdbuf_test_print_sc (sc, true); return bdbuf_test_print_sc (sc, true);
@@ -659,7 +659,7 @@ bdbuf_tests_task_0_test_1 (bdbuf_task_control* tc)
bool passed; bool passed;
int i; int i;
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
@@ -677,7 +677,7 @@ bdbuf_tests_task_0_test_1 (bdbuf_task_control* tc)
passed = false; passed = false;
break; break;
} }
bdbuf_test_printf ("%s: rtems_bdbuf_release[0]: ", tc->name); bdbuf_test_printf ("%s: rtems_bdbuf_release[0]: ", tc->name);
sc = rtems_bdbuf_release (bd); sc = rtems_bdbuf_release (bd);
if (!bdbuf_test_print_sc (sc, true)) if (!bdbuf_test_print_sc (sc, true))
@@ -686,7 +686,7 @@ bdbuf_tests_task_0_test_1 (bdbuf_task_control* tc)
break; break;
} }
} }
tc->passed = passed; tc->passed = passed;
tc->test = 0; tc->test = 0;
} }
@@ -704,18 +704,18 @@ bdbuf_tests_task_0_test_2 (bdbuf_task_control* tc)
int i; int i;
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
rtems_chain_control buffers; rtems_chain_control buffers;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
tc->passed = false; tc->passed = false;
passed = true; passed = true;
/* /*
* Get the blocks 0 -> 4 and hold them. * Get the blocks 0 -> 4 and hold them.
*/ */
rtems_chain_initialize_empty (&buffers); rtems_chain_initialize_empty (&buffers);
for (i = 0; (i < 5) && passed; i++) for (i = 0; (i < 5) && passed; i++)
{ {
dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor); dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor);
@@ -732,7 +732,7 @@ bdbuf_tests_task_0_test_2 (bdbuf_task_control* tc)
* Wake the master to tell it we have the buffers. * Wake the master to tell it we have the buffers.
*/ */
bdbuf_send_wait_event (tc->name, "wake master", tc->master); bdbuf_send_wait_event (tc->name, "wake master", tc->master);
if (passed) if (passed)
{ {
/* /*
@@ -765,7 +765,7 @@ bdbuf_tests_task_0_test_2 (bdbuf_task_control* tc)
} }
} }
} }
tc->passed = passed; tc->passed = passed;
tc->test = 0; tc->test = 0;
} }
@@ -780,7 +780,7 @@ bdbuf_tests_task_0_test_3 (bdbuf_task_control* tc)
bool passed; bool passed;
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
dev_t device; dev_t device;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
@@ -847,24 +847,24 @@ bdbuf_tests_task_0_test_4 (bdbuf_task_control* tc)
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
rtems_chain_control buffers; rtems_chain_control buffers;
size_t num = bdbuf_test_buffer_count (); size_t num = bdbuf_test_buffer_count ();
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
tc->passed = false; tc->passed = false;
passed = true; passed = true;
/* /*
* Clear any disk settings. * Clear any disk settings.
*/ */
bdbuf_clear_disk_driver_watch (tc); bdbuf_clear_disk_driver_watch (tc);
bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP); bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP);
/* /*
* Get the blocks 0 -> 4 and hold them. * Get the blocks 0 -> 4 and hold them.
*/ */
rtems_chain_initialize_empty (&buffers); rtems_chain_initialize_empty (&buffers);
for (i = 0; (i < num) && passed; i++) for (i = 0; (i < num) && passed; i++)
{ {
dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor); dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor);
@@ -881,7 +881,7 @@ bdbuf_tests_task_0_test_4 (bdbuf_task_control* tc)
* Wake the master to tell it we have the buffers. * Wake the master to tell it we have the buffers.
*/ */
bdbuf_send_wait_event (tc->name, "wake master", tc->master); bdbuf_send_wait_event (tc->name, "wake master", tc->master);
if (passed) if (passed)
{ {
bdbuf_sleep (250); bdbuf_sleep (250);
@@ -893,7 +893,7 @@ bdbuf_tests_task_0_test_4 (bdbuf_task_control* tc)
* remainder. This tests the swap out timer on each buffer. * remainder. This tests the swap out timer on each buffer.
*/ */
bdbuf_test_printf ("%s: rtems_bdbuf_release_modified[0]: unblocks task 1\n", bdbuf_test_printf ("%s: rtems_bdbuf_release_modified[0]: unblocks task 1\n",
tc->name); tc->name);
bd = (rtems_bdbuf_buffer*) rtems_chain_get (&buffers); bd = (rtems_bdbuf_buffer*) rtems_chain_get (&buffers);
sc = rtems_bdbuf_release_modified (bd); sc = rtems_bdbuf_release_modified (bd);
bdbuf_test_printf ("%s: rtems_bdbuf_release_modified[0]: ", tc->name); bdbuf_test_printf ("%s: rtems_bdbuf_release_modified[0]: ", tc->name);
@@ -922,7 +922,7 @@ bdbuf_tests_task_0_test_4 (bdbuf_task_control* tc)
bdbuf_sleep (500); bdbuf_sleep (500);
bdbuf_set_disk_driver_watch (tc, num / 2); bdbuf_set_disk_driver_watch (tc, num / 2);
for (i = 0; (i < (num / 2)) && passed; i++) for (i = 0; (i < (num / 2)) && passed; i++)
{ {
bdbuf_test_printf ("%s: rtems_bdbuf_release_modified[%d]: ", bdbuf_test_printf ("%s: rtems_bdbuf_release_modified[%d]: ",
@@ -948,7 +948,7 @@ bdbuf_tests_task_0_test_4 (bdbuf_task_control* tc)
} }
} }
} }
tc->passed = passed; tc->passed = passed;
tc->test = 0; tc->test = 0;
} }
@@ -967,24 +967,24 @@ bdbuf_tests_task_0_test_6 (bdbuf_task_control* tc)
int i; int i;
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
rtems_chain_control buffers; rtems_chain_control buffers;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
tc->passed = false; tc->passed = false;
passed = true; passed = true;
/* /*
* Clear any disk settings. * Clear any disk settings.
*/ */
bdbuf_clear_disk_driver_watch (tc); bdbuf_clear_disk_driver_watch (tc);
bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP); bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP);
/* /*
* Get the blocks 0 -> 4 and hold them. * Get the blocks 0 -> 4 and hold them.
*/ */
rtems_chain_initialize_empty (&buffers); rtems_chain_initialize_empty (&buffers);
for (i = 0; (i < 5) && passed; i++) for (i = 0; (i < 5) && passed; i++)
{ {
dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor); dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor);
@@ -1013,7 +1013,7 @@ bdbuf_tests_task_0_test_6 (bdbuf_task_control* tc)
passed = bdbuf_test_print_sc (rtems_bdbuf_sync (bd), true); passed = bdbuf_test_print_sc (rtems_bdbuf_sync (bd), true);
} }
tc->passed = passed; tc->passed = passed;
tc->test = 0; tc->test = 0;
} }
@@ -1027,13 +1027,13 @@ bdbuf_tests_task_0_test_7 (bdbuf_task_control* tc)
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
rtems_chain_control buffers; rtems_chain_control buffers;
dev_t device; dev_t device;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
tc->passed = false; tc->passed = false;
passed = true; passed = true;
/* /*
* Clear any disk settings. * Clear any disk settings.
*/ */
@@ -1041,12 +1041,12 @@ bdbuf_tests_task_0_test_7 (bdbuf_task_control* tc)
bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP); bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP);
device = rtems_filesystem_make_dev_t (tc->major, tc->minor); device = rtems_filesystem_make_dev_t (tc->major, tc->minor);
/* /*
* Get the blocks 0 -> 4 and hold them. * Get the blocks 0 -> 4 and hold them.
*/ */
rtems_chain_initialize_empty (&buffers); rtems_chain_initialize_empty (&buffers);
for (i = 0; (i < 5) && passed; i++) for (i = 0; (i < 5) && passed; i++)
{ {
bdbuf_test_printf ("%s: rtems_bdbuf_read[%d]: ", tc->name, i); bdbuf_test_printf ("%s: rtems_bdbuf_read[%d]: ", tc->name, i);
@@ -1074,7 +1074,7 @@ bdbuf_tests_task_0_test_7 (bdbuf_task_control* tc)
rtems_filesystem_dev_minor_t (device)); rtems_filesystem_dev_minor_t (device));
passed = bdbuf_test_print_sc (rtems_bdbuf_syncdev (device), true); passed = bdbuf_test_print_sc (rtems_bdbuf_syncdev (device), true);
} }
tc->passed = passed; tc->passed = passed;
tc->test = 0; tc->test = 0;
} }
@@ -1090,13 +1090,13 @@ bdbuf_tests_task_0_test_8 (bdbuf_task_control* tc)
rtems_chain_node* node; rtems_chain_node* node;
rtems_chain_node* pnode; rtems_chain_node* pnode;
dev_t device; dev_t device;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
tc->passed = false; tc->passed = false;
passed = true; passed = true;
/* /*
* Clear any disk settings. * Clear any disk settings.
*/ */
@@ -1104,12 +1104,12 @@ bdbuf_tests_task_0_test_8 (bdbuf_task_control* tc)
bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP); bdbuf_set_disk_driver_action (tc, BDBUF_DISK_NOOP);
device = rtems_filesystem_make_dev_t (tc->major, tc->minor); device = rtems_filesystem_make_dev_t (tc->major, tc->minor);
/* /*
* Get the blocks 0 -> 4 and hold them. * Get the blocks 0 -> 4 and hold them.
*/ */
rtems_chain_initialize_empty (&buffers); rtems_chain_initialize_empty (&buffers);
for (i = 0; (i < 5) && passed; i++) for (i = 0; (i < 5) && passed; i++)
{ {
bdbuf_test_printf ("%s: rtems_bdbuf_read[%d]: ", tc->name, i); bdbuf_test_printf ("%s: rtems_bdbuf_read[%d]: ", tc->name, i);
@@ -1152,7 +1152,7 @@ bdbuf_tests_task_0_test_8 (bdbuf_task_control* tc)
* Check the block order. * Check the block order.
*/ */
bdbuf_set_disk_driver_action (tc, BDBUF_DISK_BLOCKS_INORDER); bdbuf_set_disk_driver_action (tc, BDBUF_DISK_BLOCKS_INORDER);
bdbuf_test_printf ("%s: rtems_bdbuf_syncdev[%d:%d]: checking order\n", bdbuf_test_printf ("%s: rtems_bdbuf_syncdev[%d:%d]: checking order\n",
tc->name, i, tc->name, i,
rtems_filesystem_dev_major_t (device), rtems_filesystem_dev_major_t (device),
@@ -1173,7 +1173,7 @@ static void
bdbuf_tests_task_0 (rtems_task_argument arg) bdbuf_tests_task_0 (rtems_task_argument arg)
{ {
bdbuf_task_control* tc = (bdbuf_task_control*) arg; bdbuf_task_control* tc = (bdbuf_task_control*) arg;
while (!tc->die) while (!tc->die)
{ {
switch (tc->test) switch (tc->test)
@@ -1188,7 +1188,7 @@ bdbuf_tests_task_0 (rtems_task_argument arg)
case 1: case 1:
bdbuf_tests_task_0_test_1 (tc); bdbuf_tests_task_0_test_1 (tc);
break; break;
case 2: case 2:
bdbuf_tests_task_0_test_2 (tc); bdbuf_tests_task_0_test_2 (tc);
break; break;
@@ -1246,7 +1246,7 @@ bdbuf_tests_ranged_get_release (bdbuf_task_control* tc,
bool passed; bool passed;
int i; int i;
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
/* /*
* Set task control's passed to false to handle a timeout. * Set task control's passed to false to handle a timeout.
*/ */
@@ -1256,7 +1256,7 @@ bdbuf_tests_ranged_get_release (bdbuf_task_control* tc,
for (i = lower; (i < upper) && passed; i++) for (i = lower; (i < upper) && passed; i++)
{ {
dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor); dev_t device = rtems_filesystem_make_dev_t (tc->major, tc->minor);
bdbuf_test_printf ("%s: rtems_bdbuf_get[%d]: blocking ...\n", tc->name, i); bdbuf_test_printf ("%s: rtems_bdbuf_get[%d]: blocking ...\n", tc->name, i);
sc = rtems_bdbuf_get (device, i, &bd); sc = rtems_bdbuf_get (device, i, &bd);
bdbuf_test_printf ("%s: rtems_bdbuf_get[%d]: ", tc->name, i); bdbuf_test_printf ("%s: rtems_bdbuf_get[%d]: ", tc->name, i);
@@ -1280,7 +1280,7 @@ bdbuf_tests_ranged_get_release (bdbuf_task_control* tc,
if (wake_master) if (wake_master)
bdbuf_send_wait_event (tc->name, "wake master", tc->master); bdbuf_send_wait_event (tc->name, "wake master", tc->master);
} }
tc->passed = passed; tc->passed = passed;
tc->test = 0; tc->test = 0;
} }
@@ -1345,7 +1345,7 @@ static void
bdbuf_tests_task_2 (rtems_task_argument arg) bdbuf_tests_task_2 (rtems_task_argument arg)
{ {
bdbuf_task_control* tc = (bdbuf_task_control*) arg; bdbuf_task_control* tc = (bdbuf_task_control*) arg;
while (!tc->die) while (!tc->die)
{ {
switch (tc->test) switch (tc->test)
@@ -1385,7 +1385,7 @@ static rtems_task_entry bdbuf_test_tasks[] =
bdbuf_tests_task_1, bdbuf_tests_task_1,
bdbuf_tests_task_2 bdbuf_tests_task_2
}; };
#define BDBUF_TESTS_PRI_HIGH (30) #define BDBUF_TESTS_PRI_HIGH (30)
/** /**
@@ -1403,7 +1403,7 @@ bdbuf_tests_finished (bdbuf_task_control* tasks)
int t; int t;
finished = true; finished = true;
for (t = 0; t < BDBUF_TEST_TASKS; t++) for (t = 0; t < BDBUF_TEST_TASKS; t++)
if (tasks[t].test) if (tasks[t].test)
{ {
@@ -1413,7 +1413,7 @@ bdbuf_tests_finished (bdbuf_task_control* tasks)
if (finished) if (finished)
break; break;
bdbuf_sleep (250); bdbuf_sleep (250);
time++; time++;
} }
@@ -1430,7 +1430,7 @@ bdbuf_tests_finished (bdbuf_task_control* tasks)
break; break;
} }
} }
return finished; return finished;
} }
@@ -1446,9 +1446,9 @@ bdbuf_test_1 (bdbuf_task_control* tasks)
/* /*
* Use pool 0. * Use pool 0.
*/ */
tasks[0].minor = 0; tasks[0].minor = 0;
bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task); bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task);
return bdbuf_tests_finished (tasks); return bdbuf_tests_finished (tasks);
@@ -1465,7 +1465,7 @@ static bool
bdbuf_test_2 (bdbuf_task_control* tasks) bdbuf_test_2 (bdbuf_task_control* tasks)
{ {
int i; int i;
tasks[0].test = 2; tasks[0].test = 2;
tasks[1].test = 2; tasks[1].test = 2;
tasks[2].test = 2; tasks[2].test = 2;
@@ -1493,21 +1493,21 @@ bdbuf_test_2 (bdbuf_task_control* tasks)
* Wake task 2. * Wake task 2.
*/ */
bdbuf_send_wait_event ("master", "wake task 2", tasks[2].task); bdbuf_send_wait_event ("master", "wake task 2", tasks[2].task);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
/* /*
* Wake task 0 and watch task 2 then task 1 get the released buffer. * Wake task 0 and watch task 2 then task 1 get the released buffer.
*/ */
bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task); bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task);
/* /*
* Wait until task 2 has the buffer. * Wait until task 2 has the buffer.
*/ */
if (bdbuf_wait ("master", BDBUF_SECONDS (5)) != RTEMS_SUCCESSFUL) if (bdbuf_wait ("master", BDBUF_SECONDS (5)) != RTEMS_SUCCESSFUL)
return false; return false;
} }
/* /*
* Wait for the tests to finish. * Wait for the tests to finish.
*/ */
@@ -1534,7 +1534,7 @@ bdbuf_test_3 (bdbuf_task_control* tasks)
* Wake task 0. * Wake task 0.
*/ */
bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task); bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task);
return bdbuf_tests_finished (tasks); return bdbuf_tests_finished (tasks);
} }
@@ -1580,7 +1580,7 @@ bdbuf_test_4 (bdbuf_task_control* tasks)
* Wake task 0 to release it buffers. * Wake task 0 to release it buffers.
*/ */
bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task); bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task);
return bdbuf_tests_finished (tasks); return bdbuf_tests_finished (tasks);
} }
@@ -1626,7 +1626,7 @@ bdbuf_test_5 (bdbuf_task_control* tasks)
* Wake task 0 to release it buffers. * Wake task 0 to release it buffers.
*/ */
bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task); bdbuf_send_wait_event ("master", "wake task 0", tasks[0].task);
return bdbuf_tests_finished (tasks); return bdbuf_tests_finished (tasks);
} }
@@ -1712,7 +1712,7 @@ typedef struct bdbuf_test_ident
const char* label; const char* label;
bdbuf_test test; bdbuf_test test;
} bdbuf_test_ident; } bdbuf_test_ident;
/** /**
* Table of tests. * Table of tests.
*/ */
@@ -1775,7 +1775,7 @@ bdbuf_tester (void)
BDBUF_TESTS_PRI_HIGH + 1, BDBUF_TESTS_PRI_HIGH + 1,
&old_priority), &old_priority),
true); true);
/* /*
* This sets up the buffer pools. * This sets up the buffer pools.
*/ */
@@ -1795,13 +1795,13 @@ bdbuf_tester (void)
/* /*
* Start the test tasks used to test the threading parts * Start the test tasks used to test the threading parts
* of the bdbuf code. * of the bdbuf code.
*/ */
for (t = 0; t < BDBUF_TEST_TASKS; t++) for (t = 0; t < BDBUF_TEST_TASKS; t++)
{ {
bdbuf_task_control_init (t, &tasks[t], bdbuf_task_control_init (t, &tasks[t],
rtems_task_self (), rtems_task_self (),
major); major);
if (!bdbuf_tests_create_task (&tasks[t], if (!bdbuf_tests_create_task (&tasks[t],
BDBUF_TESTS_PRI_HIGH - t, BDBUF_TESTS_PRI_HIGH - t,
bdbuf_test_tasks[t])) bdbuf_test_tasks[t]))

View File

@@ -38,7 +38,7 @@ void test_errors(void)
assert( p == NULL ); assert( p == NULL );
bsp_boot_cmdline = NULL; bsp_boot_cmdline = NULL;
puts( "rtems_bsp_cmdline_get_param - bsp_boot_cmdline=NULL - returns NULL" ); puts( "rtems_bsp_cmdline_get_param - bsp_boot_cmdline=NULL - returns NULL" );
p = rtems_bsp_cmdline_get_param( "name", result, 5 ); p = rtems_bsp_cmdline_get_param( "name", result, 5 );
assert( p == NULL ); assert( p == NULL );
@@ -83,7 +83,7 @@ void test_search(
printf( "rtems_bsp_cmdline_get_param_raw(%s) returned (%s)\n", param, p ); printf( "rtems_bsp_cmdline_get_param_raw(%s) returned (%s)\n", param, p );
else else
printf( "rtems_bsp_cmdline_get_param_raw(%s) returned NULL\n", param ); printf( "rtems_bsp_cmdline_get_param_raw(%s) returned NULL\n", param );
assert( p ); assert( p );
} }

View File

@@ -42,7 +42,7 @@ void test_errors(void)
assert( p == NULL ); assert( p == NULL );
bsp_boot_cmdline = NULL; bsp_boot_cmdline = NULL;
puts( "bsp_cmdline_get_param - bsp_boot_cmdline=NULL - returns NULL" ); puts( "bsp_cmdline_get_param - bsp_boot_cmdline=NULL - returns NULL" );
p = bsp_cmdline_get_param( "name", result, 5 ); p = bsp_cmdline_get_param( "name", result, 5 );
assert( p == NULL ); assert( p == NULL );
@@ -86,7 +86,7 @@ void test_search(
printf( "bsp_cmdline_get_param_raw(%s) returned (%s)\n", param, p ); printf( "bsp_cmdline_get_param_raw(%s) returned (%s)\n", param, p );
else else
printf( "bsp_cmdline_get_param_raw(%s) returned NULL\n", param ); printf( "bsp_cmdline_get_param_raw(%s) returned NULL\n", param );
assert( p ); assert( p );
} }
@@ -116,7 +116,7 @@ void test_search(
void test_cmdline(void) void test_cmdline(void)
{ {
puts( "\n\n*** TEST OF PARSING BOOT COMMAND STRING ***" ); puts( "\n\n*** TEST OF PARSING BOOT COMMAND STRING ***" );
puts( "Test Parameter Error Conditions" ); puts( "Test Parameter Error Conditions" );

View File

@@ -204,7 +204,7 @@ static void test_main_loop(void)
Heap_Block *next_block = NULL; Heap_Block *next_block = NULL;
puts( "Test the main loop" ); puts( "Test the main loop" );
puts( "\tset the blocksize so, that the next block is outside the heap" ); puts( "\tset the blocksize so, that the next block is outside the heap" );
test_heap_init_custom(); test_heap_init_custom();
/* use all blocks */ /* use all blocks */
@@ -270,7 +270,7 @@ static void test_check_free_block(void)
Heap_Block *first_free_block = NULL; Heap_Block *first_free_block = NULL;
Heap_Block *secound_free_block = NULL; Heap_Block *secound_free_block = NULL;
void *p1 = NULL; void *p1 = NULL;
puts( "test the _Heap_Walk_check_free_block() function" ); puts( "test the _Heap_Walk_check_free_block() function" );
puts( "\tset a previous size for the next block which is not equal to the size of the actual block" ); puts( "\tset a previous size for the next block which is not equal to the size of the actual block" );

View File

@@ -139,7 +139,7 @@ static void test_heap_cases_1(void)
/* /*
* Another odd case. What we are trying to do from Sergei * Another odd case. What we are trying to do from Sergei
* *
* 32-bit CPU when CPU_ALIGNMENT = 4 (most targets have 8) with the * 32-bit CPU when CPU_ALIGNMENT = 4 (most targets have 8) with the
* code like this: * code like this:
*/ */
@@ -165,15 +165,15 @@ static void test_heap_cases_1(void)
/* XXX what should we expect */ /* XXX what should we expect */
test_free( p3 ); test_free( p3 );
test_free( p1 ); test_free( p1 );
/* /*
* To tackle a special case of resizing a block in order to cover the * To tackle a special case of resizing a block in order to cover the
* code in heapresizeblock.c * code in heapresizeblock.c
* *
* Re-initialise the heap, so that the blocks created from now on * Re-initialise the heap, so that the blocks created from now on
* are contiguous. * are contiguous.
*/ */
test_heap_default_init(); test_heap_default_init();
puts( "Heap Initialized" ); puts( "Heap Initialized" );
p1 = _Heap_Allocate( &TestHeap, 400 ); p1 = _Heap_Allocate( &TestHeap, 400 );
rtems_test_assert( p1 != NULL ); rtems_test_assert( p1 != NULL );
@@ -182,7 +182,7 @@ static void test_heap_cases_1(void)
rsc = _Heap_Resize_block( &TestHeap, p1, 256, &u1, &u2 ); rsc = _Heap_Resize_block( &TestHeap, p1, 256, &u1, &u2 );
rtems_test_assert( rsc == HEAP_RESIZE_SUCCESSFUL ); rtems_test_assert( rsc == HEAP_RESIZE_SUCCESSFUL );
test_free( p1 ); test_free( p1 );
test_free( p2 ); test_free( p2 );
} }
#define TEST_DEFAULT_PAGE_SIZE 128 #define TEST_DEFAULT_PAGE_SIZE 128
@@ -506,23 +506,23 @@ static void test_heap_allocate(void)
/* Force the page size to a small enough value */ /* Force the page size to a small enough value */
TestHeap.page_size = page_size; TestHeap.page_size = page_size;
alignment = first_page_begin - sizeof(uintptr_t); alignment = first_page_begin - sizeof(uintptr_t);
p1 = test_alloc( alloc_size, alignment, boundary, NULL ); p1 = test_alloc( alloc_size, alignment, boundary, NULL );
first_page_begin = ((uintptr_t) TestHeap.first_block ) + HEAP_BLOCK_HEADER_SIZE; first_page_begin = ((uintptr_t) TestHeap.first_block ) + HEAP_BLOCK_HEADER_SIZE;
alignment = first_page_begin + sizeof(uintptr_t); alignment = first_page_begin + sizeof(uintptr_t);
p1 = test_alloc( alloc_size, alignment, boundary, NULL ); p1 = test_alloc( alloc_size, alignment, boundary, NULL );
first_page_begin = ((uintptr_t) TestHeap.first_block ) first_page_begin = ((uintptr_t) TestHeap.first_block )
+ HEAP_BLOCK_HEADER_SIZE; + HEAP_BLOCK_HEADER_SIZE;
alignment = first_page_begin; alignment = first_page_begin;
p1 = test_alloc_simple( alloc_size, alignment, boundary ); p1 = test_alloc_simple( alloc_size, alignment, boundary );
puts( "\tallocate last block with different boundarys" ); puts( "\tallocate last block with different boundarys" );
page_size = TEST_DEFAULT_PAGE_SIZE; page_size = TEST_DEFAULT_PAGE_SIZE;
test_heap_init( page_size ); test_heap_init( page_size );
previous_last_block_begin = ((uintptr_t) TestHeap.last_block ) previous_last_block_begin = ((uintptr_t) TestHeap.last_block )
- TestHeap.min_block_size; - TestHeap.min_block_size;
previous_last_page_begin = previous_last_block_begin previous_last_page_begin = previous_last_block_begin
+ HEAP_BLOCK_HEADER_SIZE; + HEAP_BLOCK_HEADER_SIZE;
@@ -530,7 +530,7 @@ static void test_heap_allocate(void)
alignment = sizeof(uintptr_t); alignment = sizeof(uintptr_t);
boundary = 0; boundary = 0;
p1 = test_alloc( alloc_size, alignment, boundary, (void *) (previous_last_page_begin + sizeof(uintptr_t))); p1 = test_alloc( alloc_size, alignment, boundary, (void *) (previous_last_page_begin + sizeof(uintptr_t)));
test_heap_init( page_size ); test_heap_init( page_size );
boundary = ((uintptr_t) TestHeap.last_block ); boundary = ((uintptr_t) TestHeap.last_block );
p1 = test_alloc( alloc_size, alignment, boundary, (void *) previous_last_page_begin ); p1 = test_alloc( alloc_size, alignment, boundary, (void *) previous_last_page_begin );
@@ -561,15 +561,15 @@ static void test_heap_allocate(void)
boundary = (uintptr_t) TestHeap.last_block; boundary = (uintptr_t) TestHeap.last_block;
p1 = test_alloc( alloc_size, alignment, boundary, NULL ); p1 = test_alloc( alloc_size, alignment, boundary, NULL );
alloc_size = 0; alloc_size = 0;
p1 = test_alloc( alloc_size, alignment, boundary, NULL ); p1 = test_alloc( alloc_size, alignment, boundary, NULL );
alloc_size = 1; alloc_size = 1;
alignment = sizeof(uintptr_t); alignment = sizeof(uintptr_t);
boundary = 0; boundary = 0;
p1 = test_alloc_simple( alloc_size, alignment, boundary ); p1 = test_alloc_simple( alloc_size, alignment, boundary );
puts( "\ttry to create a block, which is not possible because of the alignment and boundary" ); puts( "\ttry to create a block, which is not possible because of the alignment and boundary" );
alloc_size = 2; alloc_size = 2;
@@ -597,13 +597,13 @@ static void test_block_alloc(
int free_variant, int free_variant,
int alloc_variant, int alloc_variant,
uintptr_t alloc_begin, uintptr_t alloc_begin,
uintptr_t alloc_size uintptr_t alloc_size
) )
{ {
void *p1 = NULL; void *p1 = NULL;
void *p2 = NULL; void *p2 = NULL;
void *p3 = NULL; void *p3 = NULL;
uintptr_t size_fresh_heap = 0; uintptr_t size_fresh_heap = 0;
uintptr_t pages_per_default_block = 0; uintptr_t pages_per_default_block = 0;
uint32_t exp_free_pages = 0; uint32_t exp_free_pages = 0;
@@ -611,16 +611,16 @@ static void test_block_alloc(
uint32_t exp_used_blocks = 0; uint32_t exp_used_blocks = 0;
test_heap_init( TEST_DEFAULT_PAGE_SIZE ); test_heap_init( TEST_DEFAULT_PAGE_SIZE );
size_fresh_heap = _Heap_Get_size( &TestHeap ); size_fresh_heap = _Heap_Get_size( &TestHeap );
exp_free_pages = size_fresh_heap / TestHeap.page_size; exp_free_pages = size_fresh_heap / TestHeap.page_size;
p1 = test_create_used_block(); p1 = test_create_used_block();
p2 = test_create_used_block(); p2 = test_create_used_block();
p3 = test_create_used_block(); p3 = test_create_used_block();
pages_per_default_block = _Heap_Block_size( pages_per_default_block = _Heap_Block_size(
_Heap_Block_of_alloc_area( (uintptr_t) p1, TestHeap.page_size ) _Heap_Block_of_alloc_area( (uintptr_t) p1, TestHeap.page_size )
) / TestHeap.page_size; ) / TestHeap.page_size;
if (free_variant == 1) { if (free_variant == 1) {
@@ -640,13 +640,13 @@ static void test_block_alloc(
); );
test_check_alloc_simple( (void *) alloc_begin, alloc_size, 0, 0 ); test_check_alloc_simple( (void *) alloc_begin, alloc_size, 0, 0 );
/* check statistics */ /* check statistics */
switch( free_variant ) { switch( free_variant ) {
case 1: case 1:
exp_free_pages = exp_free_pages - 2 * pages_per_default_block; exp_free_pages = exp_free_pages - 2 * pages_per_default_block;
exp_used_blocks = 2; exp_used_blocks = 2;
switch( alloc_variant ) { switch( alloc_variant ) {
case 1: case 1:
/* allocate block full space */ /* allocate block full space */
@@ -672,7 +672,7 @@ static void test_block_alloc(
case 2: case 2:
exp_free_pages = exp_free_pages - 2 * pages_per_default_block; exp_free_pages = exp_free_pages - 2 * pages_per_default_block;
exp_used_blocks = 2; exp_used_blocks = 2;
switch( alloc_variant ) { switch( alloc_variant ) {
case 1: case 1:
/* allocate block full space */ /* allocate block full space */
@@ -698,7 +698,7 @@ static void test_block_alloc(
case 3: case 3:
exp_free_pages = exp_free_pages - pages_per_default_block; exp_free_pages = exp_free_pages - pages_per_default_block;
exp_used_blocks = 2; exp_used_blocks = 2;
switch( alloc_variant ) { switch( alloc_variant ) {
case 1: case 1:
/* allocate block full space */ /* allocate block full space */
@@ -725,7 +725,7 @@ static void test_block_alloc(
default: default:
exp_free_pages = exp_free_pages - 3 * pages_per_default_block; exp_free_pages = exp_free_pages - 3 * pages_per_default_block;
exp_used_blocks = 3; exp_used_blocks = 3;
switch( alloc_variant ) { switch( alloc_variant ) {
case 1: case 1:
/* allocate block full space */ /* allocate block full space */
@@ -767,7 +767,7 @@ static void test_heap_do_block_allocate( int variant, void *p2 )
alloc_begin = alloc_box_begin; alloc_begin = alloc_box_begin;
alloc_size = 0; alloc_size = 0;
test_block_alloc( variant, 0, alloc_begin, alloc_size ); test_block_alloc( variant, 0, alloc_begin, alloc_size );
puts( "\tallocate block full space"); puts( "\tallocate block full space");
alloc_begin = alloc_box_begin; alloc_begin = alloc_box_begin;
alloc_size = alloc_box_size + HEAP_BLOCK_SIZE_OFFSET alloc_size = alloc_box_size + HEAP_BLOCK_SIZE_OFFSET
@@ -778,7 +778,7 @@ static void test_heap_do_block_allocate( int variant, void *p2 )
alloc_begin = alloc_box_begin + TEST_DEFAULT_PAGE_SIZE; alloc_begin = alloc_box_begin + TEST_DEFAULT_PAGE_SIZE;
alloc_size = 0; alloc_size = 0;
test_block_alloc( variant, 2, alloc_begin, alloc_size ); test_block_alloc( variant, 2, alloc_begin, alloc_size );
puts( "\tallocate block at the end"); puts( "\tallocate block at the end");
alloc_begin = alloc_box_end - TEST_DEFAULT_PAGE_SIZE; alloc_begin = alloc_box_end - TEST_DEFAULT_PAGE_SIZE;
alloc_size = TEST_DEFAULT_PAGE_SIZE + HEAP_BLOCK_SIZE_OFFSET alloc_size = TEST_DEFAULT_PAGE_SIZE + HEAP_BLOCK_SIZE_OFFSET
@@ -853,7 +853,7 @@ static void test_simple_resize_block(
{ {
uintptr_t old_size = 0; uintptr_t old_size = 0;
uintptr_t new_size = 0; uintptr_t new_size = 0;
Heap_Resize_status status = _Heap_Resize_block( Heap_Resize_status status = _Heap_Resize_block(
&TestHeap, &TestHeap,
alloc_pointer, alloc_pointer,
@@ -911,7 +911,7 @@ static void test_heap_resize_block(void)
test_simple_resize_block( p1, new_alloc_size, HEAP_RESIZE_SUCCESSFUL ); test_simple_resize_block( p1, new_alloc_size, HEAP_RESIZE_SUCCESSFUL );
puts( "\tdecrease size"); puts( "\tdecrease size");
puts( "\t\tdecrease a block with two pages to one page" ); puts( "\t\tdecrease a block with two pages to one page" );
test_heap_init( TEST_DEFAULT_PAGE_SIZE ); test_heap_init( TEST_DEFAULT_PAGE_SIZE );
p1 = test_alloc_two_pages(); p1 = test_alloc_two_pages();
@@ -931,7 +931,7 @@ static void test_heap_extend(void)
/* /*
* Easier to hit extend with a dedicated heap. * Easier to hit extend with a dedicated heap.
* *
*/ */
_Heap_Initialize( &TestHeap, TestHeapMemory, 512, 0 ); _Heap_Initialize( &TestHeap, TestHeapMemory, 512, 0 );
@@ -954,7 +954,7 @@ static void test_heap_info(void)
s1 = malloc_free_space(); s1 = malloc_free_space();
p1 = malloc( 512 ); p1 = malloc( 512 );
s2 = malloc_free_space(); s2 = malloc_free_space();
puts( "malloc_free_space - check malloc space drops after malloc" ); puts( "malloc_free_space - check malloc space drops after malloc" );
rtems_test_assert( s1 ); rtems_test_assert( s1 );
rtems_test_assert( s2 ); rtems_test_assert( s2 );
rtems_test_assert( s2 <= s1 ); rtems_test_assert( s2 <= s1 );

View File

@@ -14,7 +14,7 @@
*/ */
#include "system.h" #include "system.h"
#include <rtems/malloc.h> #include <rtems/malloc.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -23,7 +23,7 @@
/* /*
* HACK: API visibility violation * HACK: API visibility violation
* rtems_shell_main_monitor should better be declared in rtems/shell.h * rtems_shell_main_monitor should better be declared in rtems/shell.h
*/ */
extern int rtems_shell_main_monitor(int argc, char **argv); extern int rtems_shell_main_monitor(int argc, char **argv);
@@ -41,11 +41,11 @@ rtems_task Init(
int argc; int argc;
char *argv[MAX_ARGS]; char *argv[MAX_ARGS];
char tmp[256]; char tmp[256];
puts( "\n*** START OF MONITOR02 ***\n"); puts( "\n*** START OF MONITOR02 ***\n");
for (i=0; i < MAX_ARGS && Commands[i] ; i++) { for (i=0; i < MAX_ARGS && Commands[i] ; i++) {
strcpy( tmp, Commands[i] ); strcpy( tmp, Commands[i] );
if (!rtems_shell_make_args(tmp, &argc, argv, MAX_ARGS) ) { if (!rtems_shell_make_args(tmp, &argc, argv, MAX_ARGS) ) {
printf( "===> %s\n", Commands[i] ); printf( "===> %s\n", Commands[i] );
rtems_shell_main_monitor(argc, argv); rtems_shell_main_monitor(argc, argv);

View File

@@ -422,7 +422,7 @@ rtems_task Init(
/* /*
* Test character size * Test character size
*/ */
puts( puts(
"\n" "\n"
"Init - open - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK" "Init - open - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK"
@@ -444,7 +444,7 @@ rtems_task Init(
/* /*
* Test parity * Test parity
*/ */
puts( puts(
"\n" "\n"
"Init - open - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK" "Init - open - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK"
@@ -468,7 +468,7 @@ rtems_task Init(
/* /*
* Test stop bits * Test stop bits
*/ */
puts( puts(
"\n" "\n"
"Init - open - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK" "Init - open - " TERMIOS_TEST_DRIVER_DEVICE_NAME " - OK"

View File

@@ -44,7 +44,7 @@ extern "C" {
* @param[in] minor is the device driver minor number * @param[in] minor is the device driver minor number
* @param[in] arg is the parameters to this call * @param[in] arg is the parameters to this call
* *
* @return This method returns RTEMS_SUCCESSFUL when * @return This method returns RTEMS_SUCCESSFUL when
* the device driver is successfully initialized. * the device driver is successfully initialized.
*/ */
rtems_device_driver termios_test_driver_initialize( rtems_device_driver termios_test_driver_initialize(
@@ -52,7 +52,7 @@ rtems_device_driver termios_test_driver_initialize(
rtems_device_minor_number minor, rtems_device_minor_number minor,
void *arg void *arg
); );
/** /**
* @brief Console Open Entry Point * @brief Console Open Entry Point
* *
@@ -63,7 +63,7 @@ rtems_device_driver termios_test_driver_initialize(
* @param[in] minor is the device driver minor number * @param[in] minor is the device driver minor number
* @param[in] arg is the parameters to this call * @param[in] arg is the parameters to this call
* *
* @return This method returns RTEMS_SUCCESSFUL when * @return This method returns RTEMS_SUCCESSFUL when
* the device driver is successfully opened. * the device driver is successfully opened.
*/ */
rtems_device_driver termios_test_driver_open( rtems_device_driver termios_test_driver_open(
@@ -82,7 +82,7 @@ rtems_device_driver termios_test_driver_open(
* @param[in] minor is the device driver minor number * @param[in] minor is the device driver minor number
* @param[in] arg is the parameters to this call * @param[in] arg is the parameters to this call
* *
* @return This method returns RTEMS_SUCCESSFUL when * @return This method returns RTEMS_SUCCESSFUL when
* the device is successfully closed. * the device is successfully closed.
*/ */
rtems_device_driver termios_test_driver_close( rtems_device_driver termios_test_driver_close(
@@ -101,7 +101,7 @@ rtems_device_driver termios_test_driver_close(
* @param[in] minor is the device driver minor number * @param[in] minor is the device driver minor number
* @param[in] arg is the parameters to this call * @param[in] arg is the parameters to this call
* *
* @return This method returns RTEMS_SUCCESSFUL when * @return This method returns RTEMS_SUCCESSFUL when
* the device is successfully read from. * the device is successfully read from.
*/ */
rtems_device_driver termios_test_driver_read( rtems_device_driver termios_test_driver_read(
@@ -120,7 +120,7 @@ rtems_device_driver termios_test_driver_read(
* @param[in] minor is the device driver minor number * @param[in] minor is the device driver minor number
* @param[in] arg is the parameters to this call * @param[in] arg is the parameters to this call
* *
* @return This method returns RTEMS_SUCCESSFUL when * @return This method returns RTEMS_SUCCESSFUL when
* the device is successfully written. * the device is successfully written.
*/ */
rtems_device_driver termios_test_driver_write( rtems_device_driver termios_test_driver_write(
@@ -139,7 +139,7 @@ rtems_device_driver termios_test_driver_write(
* @param[in] minor is the device driver minor number * @param[in] minor is the device driver minor number
* @param[in] arg is the parameters to this call * @param[in] arg is the parameters to this call
* *
* @return This method returns RTEMS_SUCCESSFUL when * @return This method returns RTEMS_SUCCESSFUL when
* the device driver IO control operation is * the device driver IO control operation is
* successfully performed. * successfully performed.
*/ */

View File

@@ -1,4 +1,4 @@
/* /*
* This routine is the initialization task of test to exercise some * This routine is the initialization task of test to exercise some
* timezone functionality. * timezone functionality.
* *
@@ -45,7 +45,7 @@ rtems_task Init(
rtems_status_code status; rtems_status_code status;
puts( "\n\n*** TIMEZONE TEST ***" ); puts( "\n\n*** TIMEZONE TEST ***" );
build_time( &time, 3, 14, 2007, 15, 9, 26, 5 ); build_time( &time, 3, 14, 2007, 15, 9, 26, 5 );
status = rtems_clock_set( &time ); status = rtems_clock_set( &time );
directive_failed( status, "rtems_clock_set" ); directive_failed( status, "rtems_clock_set" );

View File

@@ -73,12 +73,12 @@ void *POSIX_Init(
status = sched_rr_get_interval( 4, &tr ); status = sched_rr_get_interval( 4, &tr );
rtems_test_assert( status == -1 ); rtems_test_assert( status == -1 );
rtems_test_assert( errno == ESRCH ); rtems_test_assert( errno == ESRCH );
puts( "Init: sched_rr_get_interval -- EINVAL (invalid interval pointer)" ); puts( "Init: sched_rr_get_interval -- EINVAL (invalid interval pointer)" );
status = sched_rr_get_interval( getpid(), NULL ); status = sched_rr_get_interval( getpid(), NULL );
rtems_test_assert( status == -1 ); rtems_test_assert( status == -1 );
rtems_test_assert( errno == EINVAL ); rtems_test_assert( errno == EINVAL );
/* print the round robin time quantum */ /* print the round robin time quantum */
status = sched_rr_get_interval( getpid(), &tr ); status = sched_rr_get_interval( getpid(), &tr );

View File

@@ -595,7 +595,7 @@ void *POSIX_Init(
priority = sched_get_priority_max( SCHED_FIFO ); priority = sched_get_priority_max( SCHED_FIFO );
priority = (priority == 254) ? 200 : 13; priority = (priority == 254) ? 200 : 13;
printf( "Init: pthread_mutex_setprioceiling - new ceiling = %d\n", priority ); printf( "Init: pthread_mutex_setprioceiling - new ceiling = %d\n", priority );
status = pthread_mutex_setprioceiling( &Mutex2_id, priority, &old_ceiling ); status = pthread_mutex_setprioceiling( &Mutex2_id, priority, &old_ceiling );
assert( !status ); assert( !status );
@@ -669,7 +669,7 @@ void *POSIX_Init(
status = pthread_mutex_destroy( &Mutex2_id ); status = pthread_mutex_destroy( &Mutex2_id );
if( status ) if( status )
printf( "status mutex destroy:%d\n", status ); printf( "status mutex destroy:%d\n", status );
status = pthread_mutexattr_init( &attr ); status = pthread_mutexattr_init( &attr );
if( status ) if( status )
printf( "status mutexattr:%d\n", status ); printf( "status mutexattr:%d\n", status );
@@ -679,7 +679,7 @@ void *POSIX_Init(
if ( status ) if ( status )
printf( "status recursive mutex :%d\n", status ); printf( "status recursive mutex :%d\n", status );
assert( !status ); assert( !status );
puts( "*** END OF POSIX TEST 5 ***" ); puts( "*** END OF POSIX TEST 5 ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );

View File

@@ -125,7 +125,7 @@ void *POSIX_Init(
/* reset all the fields */ /* reset all the fields */
status = pthread_attr_init( &attr ); status = pthread_attr_init( &attr );
posix_service_failed( status, "pthread_attr_init"); posix_service_failed( status, "pthread_attr_init");
attr.stacksize = rtems_configuration_get_work_space_size() * 10; attr.stacksize = rtems_configuration_get_work_space_size() * 10;
puts( "Init - pthread_create - EAGAIN (stacksize too large)" ); puts( "Init - pthread_create - EAGAIN (stacksize too large)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
@@ -192,7 +192,7 @@ void *POSIX_Init(
puts( "Init - pthread_create - ENOTSUP (unsupported system contention scope)" ); puts( "Init - pthread_create - ENOTSUP (unsupported system contention scope)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
fatal_directive_check_status_only( status, ENOTSUP, fatal_directive_check_status_only( status, ENOTSUP,
"unsupported system contention scope" ); "unsupported system contention scope" );
status = pthread_attr_init( &attr ); status = pthread_attr_init( &attr );

View File

@@ -46,7 +46,7 @@ void *Task_2(
*/ */
/* /*
* Consume time so the cpu budget callout will run. * Consume time so the cpu budget callout will run.
* *
* DO NOT BLOCK!!! * DO NOT BLOCK!!!
*/ */
@@ -56,7 +56,7 @@ void *Task_2(
now = time(&now); now = time(&now);
} while (start == now); } while (start == now);
start = time(&start); start = time(&start);
printf( "Time elapsed Task_2: %2d (seconds)\n", i++ ); printf( "Time elapsed Task_2: %2d (seconds)\n", i++ );
} }

View File

@@ -174,7 +174,7 @@ void *POSIX_Init(
} }
now = time( &now ); now = time( &now );
if ( now - start > 3 ) if ( now - start > 3 )
break; break;
priority = schedparam.sched_priority; priority = schedparam.sched_priority;

View File

@@ -31,7 +31,7 @@ void *POSIX_Init(
puts( "Setting current thread name to Justin" ); puts( "Setting current thread name to Justin" );
status = rtems_object_set_name( pthread_self(), "Justin" ); status = rtems_object_set_name( pthread_self(), "Justin" );
directive_failed( status, "rtems_object_set_name" ); directive_failed( status, "rtems_object_set_name" );
ptr = rtems_object_get_name( pthread_self(), 128, name ); ptr = rtems_object_get_name( pthread_self(), 128, name );
printf( "rtems_object_get_name returned (%s) for init thread\n", ptr ); printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
@@ -39,7 +39,7 @@ void *POSIX_Init(
puts( "Setting current thread name to Jordan" ); puts( "Setting current thread name to Jordan" );
status = rtems_object_set_name( pthread_self(), "Jordan" ); status = rtems_object_set_name( pthread_self(), "Jordan" );
directive_failed( status, "rtems_object_set_name" ); directive_failed( status, "rtems_object_set_name" );
ptr = rtems_object_get_name( pthread_self(), 128, name ); ptr = rtems_object_get_name( pthread_self(), 128, name );
printf( "rtems_object_get_name returned (%s) for init thread\n", ptr ); printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
@@ -52,7 +52,7 @@ void *POSIX_Init(
printf( "rtems_object_get_api_name(POSIX_API) = %s\n", printf( "rtems_object_get_api_name(POSIX_API) = %s\n",
rtems_object_get_api_name(OBJECTS_POSIX_API) ); rtems_object_get_api_name(OBJECTS_POSIX_API) );
printf("rtems_object_get_api_class_name(POSIX_API, POSIX_KEYS) = %s\n", printf("rtems_object_get_api_class_name(POSIX_API, POSIX_KEYS) = %s\n",
rtems_object_get_api_class_name( OBJECTS_POSIX_API, OBJECTS_POSIX_KEYS) rtems_object_get_api_class_name( OBJECTS_POSIX_API, OBJECTS_POSIX_KEYS)
); );

View File

@@ -34,7 +34,7 @@ void *POSIX_Init(
puts( "Init - pthread_mutex_lock - auto initialize - EINVAL" ); puts( "Init - pthread_mutex_lock - auto initialize - EINVAL" );
sc = pthread_mutex_lock( &mutex2 ); sc = pthread_mutex_lock( &mutex2 );
fatal_posix_service_status( sc, EINVAL, "mutex lock EINVAL" ); fatal_posix_service_status( sc, EINVAL, "mutex lock EINVAL" );
puts( "Init - pthread_mutex_unlock - OK" ); puts( "Init - pthread_mutex_unlock - OK" );
sc = pthread_mutex_unlock( &mutex1 ); sc = pthread_mutex_unlock( &mutex1 );
fatal_posix_service_status( sc, 0, "mutex unlock OK" ); fatal_posix_service_status( sc, 0, "mutex unlock OK" );
@@ -53,7 +53,7 @@ void *POSIX_Init(
puts( "Init - pthread_mutex_getprioceiling - auto initialize - EINVAL" ); puts( "Init - pthread_mutex_getprioceiling - auto initialize - EINVAL" );
sc = pthread_mutex_getprioceiling( &mutex2, &prioceiling ); sc = pthread_mutex_getprioceiling( &mutex2, &prioceiling );
fatal_posix_service_status( sc, EINVAL, "mutex getprioceiling EINVAL" ); fatal_posix_service_status( sc, EINVAL, "mutex getprioceiling EINVAL" );
puts( "Init - pthread_mutex_destroy - OK" ); puts( "Init - pthread_mutex_destroy - OK" );
sc = pthread_mutex_destroy( &mutex1 ); sc = pthread_mutex_destroy( &mutex1 );
fatal_posix_service_status( sc, 0, "mutex destroy OK" ); fatal_posix_service_status( sc, 0, "mutex destroy OK" );

View File

@@ -32,7 +32,7 @@ void *POSIX_Init(
puts( "Init - pthread_cond_broadcast - auto initialize - EINVAL" ); puts( "Init - pthread_cond_broadcast - auto initialize - EINVAL" );
sc = pthread_cond_broadcast( &cond2 ); sc = pthread_cond_broadcast( &cond2 );
fatal_posix_service_status( sc, EINVAL, "cond lock EINVAL" ); fatal_posix_service_status( sc, EINVAL, "cond lock EINVAL" );
puts( "Init - pthread_cond_destroy - OK" ); puts( "Init - pthread_cond_destroy - OK" );
sc = pthread_cond_destroy( &cond1 ); sc = pthread_cond_destroy( &cond1 );
fatal_posix_service_status( sc, 0, "cond destroy OK" ); fatal_posix_service_status( sc, 0, "cond destroy OK" );

View File

@@ -86,7 +86,7 @@ int main(
/*************** NOT INITIALIZED CHECKS *****************/ /*************** NOT INITIALIZED CHECKS *****************/
/* cheat visibility */ /* cheat visibility */
attr.is_initialized = 0; attr.is_initialized = 0;
puts( "pthread_barrierattr_setpshared( &attr, shared ) -- EINVAL" ); puts( "pthread_barrierattr_setpshared( &attr, shared ) -- EINVAL" );
status = pthread_barrierattr_setpshared( &attr, PTHREAD_PROCESS_SHARED ); status = pthread_barrierattr_setpshared( &attr, PTHREAD_PROCESS_SHARED );
assert( status == EINVAL ); assert( status == EINVAL );

View File

@@ -31,7 +31,7 @@ void *countTaskDeferred(void *ignored)
{ {
int i=0; int i=0;
int type,state; int type,state;
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &type); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &type);
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &state); pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &state);
while (1) { while (1) {

View File

@@ -155,7 +155,7 @@ void initialize_lock_t(lock_t *l)
{ {
pthread_mutexattr_t mutexattr; /* mutex attributes */ pthread_mutexattr_t mutexattr; /* mutex attributes */
pthread_condattr_t condattr; /* condition attributes */ pthread_condattr_t condattr; /* condition attributes */
if (pthread_mutexattr_init (&mutexattr) != 0) { if (pthread_mutexattr_init (&mutexattr) != 0) {
perror ("Error in mutex attribute init\n"); perror ("Error in mutex attribute init\n");
} }
@@ -250,12 +250,12 @@ void *POSIX_Init(
sleep(1); sleep(1);
/*************** ERROR CASES ***************/ /*************** ERROR CASES ***************/
puts("Call pthread_cleanup_push with NULL handler"); puts("Call pthread_cleanup_push with NULL handler");
pthread_cleanup_push(NULL, NULL); pthread_cleanup_push(NULL, NULL);
puts("Call pthread_cleanup_pop with no push"); puts("Call pthread_cleanup_pop with no push");
pthread_cleanup_pop(1); pthread_cleanup_pop(1);
/*************** END OF TEST *****************/ /*************** END OF TEST *****************/
puts( "*** END OF POSIX CLEANUP TEST ***\n" ); puts( "*** END OF POSIX CLEANUP TEST ***\n" );
rtems_test_exit(0); rtems_test_exit(0);

View File

@@ -61,5 +61,5 @@ void *task_c(
TEST_EXTERN pthread_t Init_id; TEST_EXTERN pthread_t Init_id;
TEST_EXTERN pthread_t Task_id; TEST_EXTERN pthread_t Task_id;
#undef TEST_EXTERN #undef TEST_EXTERN
/* end of include file */ /* end of include file */

View File

@@ -31,7 +31,7 @@ void *POSIX_Init(
puts( "Init - pthread_cleanup_pop - do not execute" ); puts( "Init - pthread_cleanup_pop - do not execute" );
pthread_cleanup_pop(0); pthread_cleanup_pop(0);
puts( "*** END OF POSIX CLEANUP TEST 01 ***\n" ); puts( "*** END OF POSIX CLEANUP TEST 01 ***\n" );
rtems_test_exit(0); rtems_test_exit(0);
} }

View File

@@ -17,7 +17,7 @@ void check_enosys(int status);
void check_enosys(int status) void check_enosys(int status)
{ {
if ( (status == -1) && (errno == ENOSYS) ) if ( (status == -1) && (errno == ENOSYS) )
return; return;
puts( "ERROR -- did not return ENOSYS as expected" ); puts( "ERROR -- did not return ENOSYS as expected" );
rtems_test_exit(0); rtems_test_exit(0);
@@ -106,7 +106,7 @@ rtems_task Init(
remaining = sleep( 3 ); remaining = sleep( 3 );
rtems_test_assert( !remaining ); rtems_test_assert( !remaining );
/* print new times to make sure it has changed and we can get the realtime */ /* print new times to make sure it has changed and we can get the realtime */
sc = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv ); sc = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv );
rtems_test_assert( !sc ); rtems_test_assert( !sc );
@@ -211,7 +211,7 @@ rtems_task Init(
delay_request.tv_nsec = 35000000; delay_request.tv_nsec = 35000000;
sc = nanosleep( &delay_request, NULL ); sc = nanosleep( &delay_request, NULL );
assert( !sc ); assert( !sc );
/* print the current real time again */ /* print the current real time again */
sc = clock_gettime( CLOCK_REALTIME, &tv ); sc = clock_gettime( CLOCK_REALTIME, &tv );
rtems_test_assert( !sc ); rtems_test_assert( !sc );

View File

@@ -54,7 +54,7 @@ void *POSIX_Init(
puts( "Init - pthread_create - OK" ); puts( "Init - pthread_create - OK" );
sc = pthread_create( &Thread, NULL, BlockingThread, NULL ); sc = pthread_create( &Thread, NULL, BlockingThread, NULL );
fatal_posix_service_status( sc, 0, "Thread create ok" ); fatal_posix_service_status( sc, 0, "Thread create ok" );
puts( "Init - sleep to let BlockingThread run" ); puts( "Init - sleep to let BlockingThread run" );
sleep(1); sleep(1);

View File

@@ -38,7 +38,7 @@ void check_enosys(int status);
void check_enosys(int status) void check_enosys(int status)
{ {
if ( (status == -1) && (errno == ENOSYS) ) if ( (status == -1) && (errno == ENOSYS) )
return; return;
puts( "ERROR -- did not return ENOSYS as expected" ); puts( "ERROR -- did not return ENOSYS as expected" );
rtems_test_exit(0); rtems_test_exit(0);

View File

@@ -142,7 +142,7 @@ void Fatal_extension(
else else
printk( "ERROR==> Fatal Extension is internal set to FALSE expected TRUE\n" ); printk( "ERROR==> Fatal Extension is internal set to FALSE expected TRUE\n" );
} }
if ( error != FATAL_ERROR_EXPECTED_ERROR ) { if ( error != FATAL_ERROR_EXPECTED_ERROR ) {
printk( "ERROR==> Fatal Error Expected ("); printk( "ERROR==> Fatal Error Expected (");
Put_Error( source, FATAL_ERROR_EXPECTED_ERROR ); Put_Error( source, FATAL_ERROR_EXPECTED_ERROR );

View File

@@ -43,12 +43,12 @@ void *POSIX_Init(
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id ); printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
Allocate_majority_of_workspace(84); Allocate_majority_of_workspace(84);
puts("Init: pthread_key_create - ENOMEM (Workspace not available)"); puts("Init: pthread_key_create - ENOMEM (Workspace not available)");
empty_line(); empty_line();
status = pthread_key_create( &Key_id[0], Key_destructor ); status = pthread_key_create( &Key_id[0], Key_destructor );
fatal_directive_check_status_only( status, ENOMEM, "no workspace available" ); fatal_directive_check_status_only( status, ENOMEM, "no workspace available" );
puts( "*** END OF POSIX KEY 01 TEST ***" ); puts( "*** END OF POSIX KEY 01 TEST ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );

View File

@@ -27,7 +27,7 @@ void *POSIX_Init(
void *alloced; void *alloced;
puts( "\n\n*** TEST KEY 02 ***" ); puts( "\n\n*** TEST KEY 02 ***" );
puts( "Init - rtems_workspace_get_information - OK" ); puts( "Init - rtems_workspace_get_information - OK" );
sb = rtems_workspace_get_information( &start ); sb = rtems_workspace_get_information( &start );
assert( sb ); assert( sb );
@@ -63,10 +63,10 @@ void *POSIX_Init(
puts( "Init - pthread_key_create - ENOMEM" ); puts( "Init - pthread_key_create - ENOMEM" );
while (1) { while (1) {
sb = rtems_workspace_allocate( to_alloc, &alloced ); sb = rtems_workspace_allocate( to_alloc, &alloced );
assert( sb ); assert( sb );
sc = pthread_key_create( &key, NULL ); sc = pthread_key_create( &key, NULL );
/* free the memory we snagged, then check the status */ /* free the memory we snagged, then check the status */

View File

@@ -31,7 +31,7 @@ void *Test_Thread(
puts( "Test_Thread - pthread_setspecific - OK" ); puts( "Test_Thread - pthread_setspecific - OK" );
sc = pthread_setspecific( Key, key_value ); sc = pthread_setspecific( Key, key_value );
assert( !sc ); assert( !sc );
puts( "Test_Thread - pthread_exit to run key destructors - OK" ); puts( "Test_Thread - pthread_exit to run key destructors - OK" );
return NULL; return NULL;
} }
@@ -45,13 +45,13 @@ void *POSIX_Init(
struct timespec delay_request; struct timespec delay_request;
puts( "\n\n*** TEST KEY 03 ***" ); puts( "\n\n*** TEST KEY 03 ***" );
/* /*
* Key with NULL destructor * Key with NULL destructor
*/ */
puts( "Init - pthread_key_create with NULL destructor - OK" ); puts( "Init - pthread_key_create with NULL destructor - OK" );
sc = pthread_key_create( &Key, NULL ); sc = pthread_key_create( &Key, NULL );
assert( !sc ); assert( !sc );
puts( "Init - pthread_create - OK" ); puts( "Init - pthread_create - OK" );
sc = pthread_create( &thread, NULL, Test_Thread, &sc ); sc = pthread_create( &thread, NULL, Test_Thread, &sc );
@@ -73,7 +73,7 @@ void *POSIX_Init(
destructor_ran = false; destructor_ran = false;
puts( "Init - pthread_key_create with non-NULL destructor - OK" ); puts( "Init - pthread_key_create with non-NULL destructor - OK" );
sc = pthread_key_create( &Key, destructor ); sc = pthread_key_create( &Key, destructor );
assert( !sc ); assert( !sc );
puts( "Init - pthread_create - OK" ); puts( "Init - pthread_create - OK" );
sc = pthread_create( &thread, NULL, Test_Thread, NULL ); sc = pthread_create( &thread, NULL, Test_Thread, NULL );

View File

@@ -104,7 +104,7 @@ void Validate_attributes(
#define Get_Queue_Name( i ) Test_q[i].name #define Get_Queue_Name( i ) Test_q[i].name
char *Build_Queue_Name( int i ) { char *Build_Queue_Name( int i ) {
static char Queue_Name[PATH_MAX + 2]; static char Queue_Name[PATH_MAX + 2];
sprintf(Queue_Name,"mq%d", i+1 ); sprintf(Queue_Name,"mq%d", i+1 );
return Queue_Name; return Queue_Name;
@@ -1248,7 +1248,7 @@ void *POSIX_Init(
verify_with_threads(); verify_with_threads();
verify_mq_receive(); verify_mq_receive();
verify_mq_send(); verify_mq_send();
puts( "*** END OF POSIX MESSAGE QUEUE TEST ***" ); puts( "*** END OF POSIX MESSAGE QUEUE TEST ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );

View File

@@ -45,12 +45,12 @@ void *POSIX_Init(
printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id ); printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
Allocate_majority_of_workspace(NAME_MAX); Allocate_majority_of_workspace(NAME_MAX);
attr.mq_maxmsg = MAXMSG; attr.mq_maxmsg = MAXMSG;
attr.mq_msgsize = MSGSIZE; attr.mq_msgsize = MSGSIZE;
puts("Init: mq_open - Workspace not available - ENOMEM"); puts("Init: mq_open - Workspace not available - ENOMEM");
mq = mq_open( Get_Longest_Name(), O_CREAT, 0x777, &attr ); mq = mq_open( Get_Longest_Name(), O_CREAT, 0x777, &attr );
fatal_posix_service_status_errno(mq, ENOMEM, "no workspace available"); fatal_posix_service_status_errno(mq, ENOMEM, "no workspace available");
puts( "*** END OF POSIX MESSAGE QUEUE 02 TEST ***" ); puts( "*** END OF POSIX MESSAGE QUEUE 02 TEST ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );

View File

@@ -98,7 +98,7 @@ void *POSIX_Init(
); );
rtems_test_exit( 0 ); rtems_test_exit( 0 );
} }
puts( "Init - mq_send from ISR returned correct status" ); puts( "Init - mq_send from ISR returned correct status" );
puts( "*** END OF POSIX MESSAGE QUEUE TEST 3 ***" ); puts( "*** END OF POSIX MESSAGE QUEUE TEST 3 ***" );

View File

@@ -92,7 +92,7 @@ void *POSIX_Init(
while ( attr.mq_msgsize > 0 ) { while ( attr.mq_msgsize > 0 ) {
sb = rtems_workspace_allocate( to_alloc, &alloced ); sb = rtems_workspace_allocate( to_alloc, &alloced );
assert( sb ); assert( sb );
second_Queue = mq_open(name,O_CREAT | O_RDWR, 0x777, &attr ); second_Queue = mq_open(name,O_CREAT | O_RDWR, 0x777, &attr );
/* free the memory we snagged, then check the status */ /* free the memory we snagged, then check the status */

View File

@@ -84,7 +84,7 @@ void *POSIX_Init(
printf( "Init - pthread_mutexattr_settype - %s\n", TypesToCheck[i].name ); printf( "Init - pthread_mutexattr_settype - %s\n", TypesToCheck[i].name );
sc = pthread_mutexattr_settype( &attr, TypesToCheck[i].type ); sc = pthread_mutexattr_settype( &attr, TypesToCheck[i].type );
rtems_test_assert( sc == TypesToCheck[i].status ); rtems_test_assert( sc == TypesToCheck[i].status );
type = -2; type = -2;
if ( TypesToCheck[i].status == 0 ) { if ( TypesToCheck[i].status == 0 ) {

View File

@@ -53,7 +53,7 @@ unsigned char ReadBuffer[MAX_BUFFER];
* *
* Fill the test buffer. * Fill the test buffer.
* *
* Returns: TRUE if buffer filled * Returns: TRUE if buffer filled
* FALSE if buffer failed to fill * FALSE if buffer failed to fill
* *
*/ */
@@ -88,7 +88,7 @@ int doFunctionalTest(void) {
struct iovec wrvec[4]; struct iovec wrvec[4];
int rc; int rc;
/* /*
* Setup the iovec * Setup the iovec
*/ */
@@ -216,7 +216,7 @@ int doErrorTest(void)
rc = writev(fd, NULL, 4); rc = writev(fd, NULL, 4);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "writev error 2: %d=%s\n", errno, strerror(errno) ); printf( "writev error 2: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -225,7 +225,7 @@ int doErrorTest(void)
rc = readv(fd, NULL, 4); rc = readv(fd, NULL, 4);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "readv error 2: %d=%s\n", errno, strerror(errno) ); printf( "readv error 2: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -234,7 +234,7 @@ int doErrorTest(void)
rc = writev(fd, vec, 0); rc = writev(fd, vec, 0);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "writev error 3: %d=%s\n", errno, strerror(errno) ); printf( "writev error 3: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -243,7 +243,7 @@ int doErrorTest(void)
rc = readv(fd, vec, 0); rc = readv(fd, vec, 0);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "readv error 3: %d=%s\n", errno, strerror(errno) ); printf( "readv error 3: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -252,7 +252,7 @@ int doErrorTest(void)
rc = writev(fd, vec, -2); rc = writev(fd, vec, -2);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "writev error 4: %d=%s\n", errno, strerror(errno) ); printf( "writev error 4: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -261,7 +261,7 @@ int doErrorTest(void)
rc = readv(fd, vec, -100); rc = readv(fd, vec, -100);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "readv error 4: %d=%s\n", errno, strerror(errno) ); printf( "readv error 4: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -274,7 +274,7 @@ int doErrorTest(void)
rc = writev(fd, vec, 2); rc = writev(fd, vec, 2);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "writev error 5: %d=%s\n", errno, strerror(errno) ); printf( "writev error 5: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -287,7 +287,7 @@ int doErrorTest(void)
rc = readv(fd, vec, 2); rc = readv(fd, vec, 2);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "readv error 5: %d=%s\n", errno, strerror(errno) ); printf( "readv error 5: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -300,7 +300,7 @@ int doErrorTest(void)
rc = writev(fd, vec, 2); rc = writev(fd, vec, 2);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "writev error 6: %d=%s\n", errno, strerror(errno) ); printf( "writev error 6: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -313,7 +313,7 @@ int doErrorTest(void)
rc = readv(fd, vec, 2); rc = readv(fd, vec, 2);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "readv error 6: %d=%s\n", errno, strerror(errno) ); printf( "readv error 6: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -328,7 +328,7 @@ int doErrorTest(void)
rc = writev(fd, vec, 3); rc = writev(fd, vec, 3);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "writev error 7: %d=%s\n", errno, strerror(errno) ); printf( "writev error 7: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -341,7 +341,7 @@ int doErrorTest(void)
rc = readv(fd, vec, 2); rc = readv(fd, vec, 2);
if ( (rc != -1) || (errno != EINVAL) ) { if ( (rc != -1) || (errno != EINVAL) ) {
printf( "readv error 7: %d=%s\n", errno, strerror(errno) ); printf( "readv error 7: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -354,7 +354,7 @@ int doErrorTest(void)
rc = writev(fd, vec, 2); rc = writev(fd, vec, 2);
if ( (rc != 0) ) { if ( (rc != 0) ) {
printf( "writev error 8: %d=%s\n", errno, strerror(errno) ); printf( "writev error 8: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }
@@ -367,7 +367,7 @@ int doErrorTest(void)
rc = readv(fd, vec, 2); rc = readv(fd, vec, 2);
if ( (rc != 0) ) { if ( (rc != 0) ) {
printf( "readv error 8: %d=%s\n", errno, strerror(errno) ); printf( "readv error 8: %d=%s\n", errno, strerror(errno) );
fclose(fp); fclose(fp);
return FALSE; return FALSE;
} }

View File

@@ -110,7 +110,7 @@ int main(
/*************** NOT INITIALIZED CHECKS *****************/ /*************** NOT INITIALIZED CHECKS *****************/
/* cheat visibility */ /* cheat visibility */
attr.is_initialized = 0; attr.is_initialized = 0;
puts( "pthread_rwlockattr_setpshared( &attr, shared ) -- EINVAL" ); puts( "pthread_rwlockattr_setpshared( &attr, shared ) -- EINVAL" );
status = pthread_rwlockattr_setpshared( &attr, PTHREAD_PROCESS_SHARED ); status = pthread_rwlockattr_setpshared( &attr, PTHREAD_PROCESS_SHARED );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -338,7 +338,7 @@ int main(
assert( !status ); assert( !status );
sleep(2); sleep(2);
/*************** CREATE THREADS AND LET THEM OBTAIN WRITE LOCK *************/ /*************** CREATE THREADS AND LET THEM OBTAIN WRITE LOCK *************/
puts( "pthread_rwlock_trywrlock(RWLock) -- OK" ); puts( "pthread_rwlock_trywrlock(RWLock) -- OK" );
status = pthread_rwlock_trywrlock(&RWLock); status = pthread_rwlock_trywrlock(&RWLock);
@@ -367,7 +367,7 @@ int main(
puts( "clock_gettime(CLOCK_REALTIME, &abstime) -- OK" ); puts( "clock_gettime(CLOCK_REALTIME, &abstime) -- OK" );
status = clock_gettime( CLOCK_REALTIME, &abstime ); status = clock_gettime( CLOCK_REALTIME, &abstime );
assert( !status ); assert( !status );
abstime.tv_sec += 1; abstime.tv_sec += 1;
puts( "pthread_rwlock_timedwrlock( &RWLock, &abstime) -- OK" ); puts( "pthread_rwlock_timedwrlock( &RWLock, &abstime) -- OK" );
status = pthread_rwlock_timedwrlock( &RWLock, &abstime ); status = pthread_rwlock_timedwrlock( &RWLock, &abstime );
@@ -421,7 +421,7 @@ int main(
puts( "pthread_rwlock_unlock ( &rwlock ) -- OK" ); puts( "pthread_rwlock_unlock ( &rwlock ) -- OK" );
status = pthread_rwlock_unlock( &rwlock ); status = pthread_rwlock_unlock( &rwlock );
assert( status == 0 ); assert( status == 0 );
puts( "pthread_rwlock_unlock ( &rwlock ) -- OK" ); puts( "pthread_rwlock_unlock ( &rwlock ) -- OK" );
status = pthread_rwlock_unlock( &rwlock ); status = pthread_rwlock_unlock( &rwlock );
assert( status == 0 ); assert( status == 0 );

View File

@@ -177,7 +177,7 @@ void *POSIX_Init(
errno, ENAMETOOLONG, "sem_open errorno ENAMETOOLONG" ); errno, ENAMETOOLONG, "sem_open errorno ENAMETOOLONG" );
puts( "Init: sem_open - sem1 SUCCESSFUL" ); puts( "Init: sem_open - sem1 SUCCESSFUL" );
n_sem1 = sem_open( "sem1",O_CREAT, 0777, 1 ); n_sem1 = sem_open( "sem1",O_CREAT, 0777, 1 );
assert( n_sem1 != SEM_FAILED ); assert( n_sem1 != SEM_FAILED );
puts( "Init: sem_destroy - named sem1 - EINVAL" ); puts( "Init: sem_destroy - named sem1 - EINVAL" );

View File

@@ -186,7 +186,7 @@ void *POSIX_Init(
Timer_id[ 0 ], Timer_id[ 0 ],
1, 1,
Signal_duringISR_TSR, Signal_duringISR_TSR,
NULL NULL
); );
sleep(5); sleep(5);
/* signal occurs during interruptible sleep */ /* signal occurs during interruptible sleep */
@@ -201,7 +201,7 @@ void *POSIX_Init(
Timer_id[ 0 ], Timer_id[ 0 ],
10, 10,
Signal_duringISR_TSR, Signal_duringISR_TSR,
NULL NULL
); );
do { do {
end = rtems_clock_get_ticks_since_boot(); end = rtems_clock_get_ticks_since_boot();
@@ -215,7 +215,7 @@ void *POSIX_Init(
/* end of install a signal handler for SIGUSR1 */ /* end of install a signal handler for SIGUSR1 */
Signal_occurred = 0; Signal_occurred = 0;
puts("*** Validate unexpected program termination ***"); puts("*** Validate unexpected program termination ***");
puts( "*** END OF POSIX TEST SIGNAL ***" ); puts( "*** END OF POSIX TEST SIGNAL ***" );
_POSIX_signals_Abnormal_termination_handler( SIGUSR1 ); _POSIX_signals_Abnormal_termination_handler( SIGUSR1 );

View File

@@ -70,7 +70,7 @@ const char *Actions[] = {
"Spins", "Spins",
"Sleeps" "Sleeps"
}; };
typedef struct { typedef struct {
int priority; int priority;
@@ -95,7 +95,7 @@ void *Test_Thread(void *arg)
Test_t *test = (Test_t *)arg; Test_t *test = (Test_t *)arg;
Install_Signal_Handler( test->name ); Install_Signal_Handler( test->name );
printf( "%s - %s\n", test->name, Actions[test->action] ); printf( "%s - %s\n", test->name, Actions[test->action] );
switch ( test->action ) { switch ( test->action ) {
case SUSPEND: case SUSPEND:

View File

@@ -109,7 +109,7 @@ void *Test_Thread(void *arg)
/* unblocked signals */ /* unblocked signals */
sc = pthread_sigmask( SIG_UNBLOCK, &mask, NULL ); sc = pthread_sigmask( SIG_UNBLOCK, &mask, NULL );
assert( !sc ); assert( !sc );
/* build wait mask */ /* build wait mask */
sc = sigemptyset( &wait_mask ); sc = sigemptyset( &wait_mask );
assert( !sc ); assert( !sc );
@@ -127,8 +127,8 @@ void *Test_Thread(void *arg)
printf( "%s - siginfo.si_signo=%d\n", name, info.si_signo ); printf( "%s - siginfo.si_signo=%d\n", name, info.si_signo );
printf( "%s - siginfo.si_code=%d\n", name, info.si_code ); printf( "%s - siginfo.si_code=%d\n", name, info.si_code );
/* FIXME: Instead of casting to (uintptr_t) and using PRIxPTR, we /* FIXME: Instead of casting to (uintptr_t) and using PRIxPTR, we
* likely should use %p. However, this would render this test's * likely should use %p. However, this would render this test's
* behavior non-deterministic, because %p's behavior is * behavior non-deterministic, because %p's behavior is
* "implementation defined" */ * "implementation defined" */
printf( "%s - siginfo.si_value=0x%08" PRIxPTR "\n", name, (uintptr_t) info.si_value.sival_ptr ); printf( "%s - siginfo.si_value=0x%08" PRIxPTR "\n", name, (uintptr_t) info.si_value.sival_ptr );

View File

@@ -81,7 +81,7 @@ int main(
assert( rstatus == RTEMS_SUCCESSFUL ); assert( rstatus == RTEMS_SUCCESSFUL );
sleep(1); sleep(1);
puts( "pthread_spin_unlock( &Spinlock ) -- OK" ); puts( "pthread_spin_unlock( &Spinlock ) -- OK" );
status = pthread_spin_unlock( &Spinlock ); status = pthread_spin_unlock( &Spinlock );
assert( status == 0 ); assert( status == 0 );

View File

@@ -58,7 +58,7 @@ void *POSIX_Init(
assert( Stack_Low ); assert( Stack_Low );
Stack_High = Stack_Low + PTHREAD_MINIMUM_STACK_SIZE; Stack_High = Stack_Low + PTHREAD_MINIMUM_STACK_SIZE;
puts( "Init - Initialize thread attribute for user provided stack" ); puts( "Init - Initialize thread attribute for user provided stack" );
sc = pthread_attr_init( &attr ); sc = pthread_attr_init( &attr );
assert( !sc ); assert( !sc );

View File

@@ -29,8 +29,8 @@ void *POSIX_Init(
sc = sysconf( -1 ); sc = sysconf( -1 );
fatal_posix_service_status_errno( sc, EINVAL, "bad conf name" ); fatal_posix_service_status_errno( sc, EINVAL, "bad conf name" );
#if UNUSED #if UNUSED
/* FIXME: This test doesn't make sense. /* FIXME: This test doesn't make sense.
* On targets with sizeof(int) < sizeof(long), compilation will fail, * On targets with sizeof(int) < sizeof(long), compilation will fail,
* On targets with sizeof(int) == sizeof(long) the call is valid. * On targets with sizeof(int) == sizeof(long) the call is valid.
*/ */

View File

@@ -105,7 +105,7 @@ void test_adjtime(void)
rtems_time_of_day *the_tod; rtems_time_of_day *the_tod;
rtems_time_of_day tod; rtems_time_of_day tod;
rtems_interval ticks; rtems_interval ticks;
the_tod = &Dates[0]; the_tod = &Dates[0];
print_time( "rtems_clock_set ", the_tod, "\n" ); print_time( "rtems_clock_set ", the_tod, "\n" );
@@ -151,7 +151,7 @@ void test_adjtime(void)
assert( sc == 0 ); assert( sc == 0 );
/* /*
* spin until over 1/2 of the way to the * spin until over 1/2 of the way to the
*/ */
ticks = rtems_clock_get_ticks_per_second(); ticks = rtems_clock_get_ticks_per_second();
assert( ticks ); assert( ticks );

View File

@@ -81,7 +81,7 @@ void StopTimer(
rtems_test_exit(0); rtems_test_exit(0);
} }
} }
/* task A */ /* task A */
void * task_a (void *arg) void * task_a (void *arg)
{ {
@@ -125,7 +125,7 @@ void * task_a (void *arg)
timergetdata.it_value.tv_sec, timergetdata.it_value.tv_nsec, timergetdata.it_value.tv_sec, timergetdata.it_value.tv_nsec,
timergetdata.it_interval.tv_sec, timergetdata.it_interval.tv_nsec timergetdata.it_interval.tv_sec, timergetdata.it_interval.tv_nsec
); );
/* periodic activity */ /* periodic activity */
while(1) { while(1) {
@@ -188,7 +188,7 @@ void * task_b (void *arg)
if (timer_settime(timer_id,TIMER_ABSTIME,&timerdata,NULL) == -1) { if (timer_settime(timer_id,TIMER_ABSTIME,&timerdata,NULL) == -1) {
perror ("Error in timer setting\n"); perror ("Error in timer setting\n");
rtems_test_exit(0); rtems_test_exit(0);
} }
/* periodic activity */ /* periodic activity */
while(1) { while(1) {
@@ -196,7 +196,7 @@ void * task_b (void *arg)
perror ("Error in sigwait\n"); perror ("Error in sigwait\n");
rtems_test_exit(0); rtems_test_exit(0);
} }
if (timer_gettime(timer_id, &timerdata) == -1) { if (timer_gettime(timer_id, &timerdata) == -1) {
perror ("Error in timer_gettime\n"); perror ("Error in timer_gettime\n");
rtems_test_exit(0); rtems_test_exit(0);
@@ -208,7 +208,7 @@ void * task_b (void *arg)
* and thus they are close but not equal. Can we test for this? * and thus they are close but not equal. Can we test for this?
*/ */
if ( !_Timespec_Equal_to( &timerdata.it_value, &my_period) ){ if ( !_Timespec_Equal_to( &timerdata.it_value, &my_period) ){
printf( "NOT EQUAL %d:%d != %d:%d\n", printf( "NOT EQUAL %d:%d != %d:%d\n",
timerdata.it_value.tv_sec, timerdata.it_value.tv_sec,
timerdata.it_value.tv_nsec, timerdata.it_value.tv_nsec,
my_period.tv_sec, my_period.tv_sec,
@@ -220,8 +220,8 @@ void * task_b (void *arg)
pthread_mutex_lock (&data.mutex); pthread_mutex_lock (&data.mutex);
clock = time(NULL); clock = time(NULL);
printf("Executing task B with count = %2i %s", printf("Executing task B with count = %2i %s",
params->count, ctime(&clock) params->count, ctime(&clock)
); );
data.updated = TRUE; data.updated = TRUE;
pthread_cond_signal (&data.sync); pthread_cond_signal (&data.sync);
@@ -292,8 +292,8 @@ void * task_c (void *arg)
pthread_cond_wait (&data.sync,&data.mutex); pthread_cond_wait (&data.sync,&data.mutex);
} }
clock = time(NULL); clock = time(NULL);
printf("Executing task C with count = %2i %s", printf("Executing task C with count = %2i %s",
params->count, ctime(&clock) params->count, ctime(&clock)
); );
if ( count && (count % 5) == 0 ) { if ( count && (count % 5) == 0 ) {
@@ -301,7 +301,7 @@ void * task_c (void *arg)
sleep(1); sleep(1);
overruns = timer_getoverrun( timer_id ); overruns = timer_getoverrun( timer_id );
printf( "task C: timer_getoverrun - overruns=%d\n", overruns ); printf( "task C: timer_getoverrun - overruns=%d\n", overruns );
if (timer_gettime(timer_id, &timergetdata) == -1) { if (timer_gettime(timer_id, &timergetdata) == -1) {
perror ("Error in timer setting\n"); perror ("Error in timer setting\n");
rtems_test_exit(0); rtems_test_exit(0);

View File

@@ -41,7 +41,7 @@ void *POSIX_Init (
timer_t timer; timer_t timer;
timer_t timer1; timer_t timer1;
struct itimerspec itimer; struct itimerspec itimer;
/* /*
* If these are not filled in correctly, we don't pass its error checking. * If these are not filled in correctly, we don't pass its error checking.
*/ */

View File

@@ -46,7 +46,7 @@ rtems_task Init(
remaining = usleep( 3 * 1000000 ); remaining = usleep( 3 * 1000000 );
rtems_test_assert( !remaining ); rtems_test_assert( !remaining );
sc = clock_gettime( CLOCK_REALTIME, &tv ); sc = clock_gettime( CLOCK_REALTIME, &tv );
rtems_test_assert( !sc ); rtems_test_assert( !sc );

View File

@@ -55,7 +55,7 @@ rtems_task Init(
rtems_monitor_init (0); rtems_monitor_init (0);
rtems_capture_cli_init (0); rtems_capture_cli_init (0);
setup_tasks_to_watch (); setup_tasks_to_watch ();
rtems_task_delete (RTEMS_SELF); rtems_task_delete (RTEMS_SELF);

View File

@@ -31,7 +31,7 @@ static volatile int capture_CT1c_deleted;
static void static void
capture_wait (uint32_t period) capture_wait (uint32_t period)
{ {
rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (period * 1000)); rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (period * 1000));
} }
/* /*
@@ -52,7 +52,7 @@ capture_CT1a (rtems_task_argument arg)
sc = rtems_semaphore_obtain (mutex, RTEMS_WAIT, 0); sc = rtems_semaphore_obtain (mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
fprintf (stdout, "error: CT1a: mutex obtain: %s\n", fprintf (stdout, "error: CT1a: mutex obtain: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
@@ -60,12 +60,12 @@ capture_CT1a (rtems_task_argument arg)
sc = rtems_semaphore_release (mutex); sc = rtems_semaphore_release (mutex);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
fprintf (stdout, "error: CT1a: mutex release: %s\n", fprintf (stdout, "error: CT1a: mutex release: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
capture_CT1a_deleted = 1; capture_CT1a_deleted = 1;
rtems_task_delete (RTEMS_SELF); rtems_task_delete (RTEMS_SELF);
} }
@@ -76,7 +76,7 @@ capture_CT1b (rtems_task_argument arg)
while (!capture_CT1c_deleted) while (!capture_CT1c_deleted)
i++; i++;
capture_CT1b_deleted = 1; capture_CT1b_deleted = 1;
rtems_task_delete (RTEMS_SELF); rtems_task_delete (RTEMS_SELF);
@@ -90,7 +90,7 @@ capture_CT1c (rtems_task_argument arg)
sc = rtems_semaphore_obtain (mutex, RTEMS_WAIT, 0); sc = rtems_semaphore_obtain (mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
fprintf (stdout, "error: CT1c: mutex obtain: %s\n", fprintf (stdout, "error: CT1c: mutex obtain: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
@@ -98,12 +98,12 @@ capture_CT1c (rtems_task_argument arg)
sc = rtems_semaphore_release (mutex); sc = rtems_semaphore_release (mutex);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
fprintf (stdout, "error: CT1c: mutex release: %s\n", fprintf (stdout, "error: CT1c: mutex release: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
capture_CT1c_deleted = 1; capture_CT1c_deleted = 1;
rtems_task_delete (RTEMS_SELF); rtems_task_delete (RTEMS_SELF);
} }
@@ -122,15 +122,15 @@ capture_test_1 (int argc,
capture_CT1a_deleted = 0; capture_CT1a_deleted = 0;
capture_CT1b_deleted = 0; capture_CT1b_deleted = 0;
capture_CT1c_deleted = 0; capture_CT1c_deleted = 0;
name = rtems_build_name('C', 'T', 'm', '1'); name = rtems_build_name('C', 'T', 'm', '1');
sc = rtems_semaphore_create (name, 1, sc = rtems_semaphore_create (name, 1,
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE |
RTEMS_INHERIT_PRIORITY, RTEMS_INHERIT_PRIORITY,
0, &mutex); 0, &mutex);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
{ {
fprintf (stdout, "error: Test 1: cannot mutex: %s\n", fprintf (stdout, "error: Test 1: cannot mutex: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
@@ -138,13 +138,13 @@ capture_test_1 (int argc,
} }
name = rtems_build_name('C', 'T', '1', 'a'); name = rtems_build_name('C', 'T', '1', 'a');
sc = rtems_task_create (name, 102, 2 * 1024, sc = rtems_task_create (name, 102, 2 * 1024,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR, RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR,
&id[0]); &id[0]);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
{ {
fprintf (stdout, "error: Test 1: cannot create CT1a: %s\n", fprintf (stdout, "error: Test 1: cannot create CT1a: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
@@ -166,13 +166,13 @@ capture_test_1 (int argc,
capture_wait (1000); capture_wait (1000);
name = rtems_build_name('C', 'T', '1', 'b'); name = rtems_build_name('C', 'T', '1', 'b');
sc = rtems_task_create (name, 101, 2 * 1024, sc = rtems_task_create (name, 101, 2 * 1024,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR, RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR,
&id[1]); &id[1]);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
{ {
fprintf (stdout, "error: Test 1: cannot create CT1b: %s\n", fprintf (stdout, "error: Test 1: cannot create CT1b: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
@@ -196,13 +196,13 @@ capture_test_1 (int argc,
capture_wait (1000); capture_wait (1000);
name = rtems_build_name('C', 'T', '1', 'c'); name = rtems_build_name('C', 'T', '1', 'c');
sc = rtems_task_create (name, 100, 2 * 1024, sc = rtems_task_create (name, 100, 2 * 1024,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR, RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR,
&id[2]); &id[2]);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
{ {
fprintf (stdout, "error: Test 1: cannot create CT1c: %s\n", fprintf (stdout, "error: Test 1: cannot create CT1c: %s\n",
rtems_status_text (sc)); rtems_status_text (sc));
@@ -241,7 +241,7 @@ capture_test_1 (int argc,
rtems_task_delete (id[1]); rtems_task_delete (id[1]);
rtems_task_delete (id[0]); rtems_task_delete (id[0]);
} }
sc = rtems_semaphore_delete (mutex); sc = rtems_semaphore_delete (mutex);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
fprintf (stdout, "error: Test 1: deleting the mutex: %s\n", fprintf (stdout, "error: Test 1: deleting the mutex: %s\n",

View File

@@ -160,7 +160,7 @@ void fileio_start_shell(void)
); );
writeScript( writeScript(
"/scripts/js", "/scripts/js",
"#! joel\n" "#! joel\n"
"\n" "\n"
"date\n" "date\n"
@@ -170,13 +170,13 @@ void fileio_start_shell(void)
); );
writeScript( writeScript(
"/scripts/j1", "/scripts/j1",
"#! joel -s 20480 -t JESS\n" "#! joel -s 20480 -t JESS\n"
"stackuse\n" "stackuse\n"
); );
rtems_shell_write_file( rtems_shell_write_file(
"/scripts/j2", "/scripts/j2",
"echo j2 TEST FILE\n" "echo j2 TEST FILE\n"
"echo j2 SHOULD BE non-executable AND\n" "echo j2 SHOULD BE non-executable AND\n"
"echo j2 DOES NOT have the magic first line\n" "echo j2 DOES NOT have the magic first line\n"
@@ -701,7 +701,7 @@ Init (rtems_task_argument ignored)
Task_name = rtems_build_name('F','M','N','U'); Task_name = rtems_build_name('F','M','N','U');
status = rtems_task_create( status = rtems_task_create(
Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_DEFAULT_MODES , RTEMS_DEFAULT_MODES ,
RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
); );
@@ -738,7 +738,7 @@ rtems_shell_alias_t Shell_USERECHO_Alias = {
"usercmd", /* command */ "usercmd", /* command */
"userecho" /* alias */ "userecho" /* alias */
}; };
#define CONFIGURE_SHELL_USER_COMMANDS &Shell_USERCMD_Command #define CONFIGURE_SHELL_USER_COMMANDS &Shell_USERCMD_Command
#define CONFIGURE_SHELL_USER_ALIASES &Shell_USERECHO_Alias #define CONFIGURE_SHELL_USER_ALIASES &Shell_USERECHO_Alias

View File

@@ -1,4 +1,4 @@
/* Minimum Size Application Initialization /* Minimum Size Application Initialization
* *
* COPYRIGHT (c) 1989-2008. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
@@ -20,7 +20,7 @@ rtems_task Init(
/* Real application would call idle loop functionality */ /* Real application would call idle loop functionality */
/* but in this case, just return and fall into a fatal error */ /* but in this case, just return and fall into a fatal error */
} }
/* configuration information */ /* configuration information */

View File

@@ -1,4 +1,4 @@
/* /*
* Nanoseconds accuracy timestamp test * Nanoseconds accuracy timestamp test
*/ */
@@ -29,7 +29,7 @@ char *my_ctime( time_t t )
static char b[32]; static char b[32];
ctime_r(&t, b); ctime_r(&t, b);
b[ strlen(b) - 1] = '\0'; b[ strlen(b) - 1] = '\0';
return b; return b;
} }
void subtract_em( void subtract_em(
@@ -117,7 +117,7 @@ rtems_task Init(
struct timespec diff; struct timespec diff;
int j, max = (index * 10000); int j, max = (index * 10000);
rtems_clock_get_uptime( &start ); rtems_clock_get_uptime( &start );
for (j=0 ; j<max ; j++ ) for (j=0 ; j<max ; j++ )
dummy_function_empty_body_to_force_call(); dummy_function_empty_body_to_force_call();
rtems_clock_get_uptime( &stop ); rtems_clock_get_uptime( &stop );

View File

@@ -34,7 +34,7 @@ rtems_task Task_1_through_3(
/* /*
* Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to
* test C implementation in SuperCore -- not macro version used * test C implementation in SuperCore -- not macro version used
* everywhere else. * everywhere else.
*/ */
ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 ); ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );

View File

@@ -31,7 +31,7 @@ bool Task_create_extension(
if ( task_number( created_task->Object.id ) > 0 ) { if ( task_number( created_task->Object.id ) > 0 ) {
name = Task_name[ task_number( created_task->Object.id ) ]; name = Task_name[ task_number( created_task->Object.id ) ];
/* /*
* FIXME: There should be a public function to * FIXME: There should be a public function to
* convert numeric rtems_names into char arrays * convert numeric rtems_names into char arrays
* c.f. rtems_name_to_characters() in rtems/rtems/support.inl * c.f. rtems_name_to_characters() in rtems/rtems/support.inl
* but it's private. * but it's private.

View File

@@ -41,7 +41,7 @@ void Task_delete_extension(
if ( task_number( deleted_task->Object.id ) > 0 ) { if ( task_number( deleted_task->Object.id ) > 0 ) {
name = Task_name[ task_number( deleted_task->Object.id ) ]; name = Task_name[ task_number( deleted_task->Object.id ) ];
/* /*
* FIXME: There should be a public function to * FIXME: There should be a public function to
* convert numeric rtems_names into char arrays * convert numeric rtems_names into char arrays
* c.f. rtems_name_to_characters() in rtems/rtems/support.inl * c.f. rtems_name_to_characters() in rtems/rtems/support.inl
* but it's private. * but it's private.

View File

@@ -31,7 +31,7 @@ void Task_restart_extension(
if ( task_number( restarted_task->Object.id ) > 0 ) { if ( task_number( restarted_task->Object.id ) > 0 ) {
name = Task_name[ task_number( restarted_task->Object.id ) ]; name = Task_name[ task_number( restarted_task->Object.id ) ];
/* /*
* FIXME: There should be a public function to * FIXME: There should be a public function to
* convert numeric rtems_names into char arrays * convert numeric rtems_names into char arrays
* c.f. rtems_name_to_characters() in rtems/rtems/support.inl * c.f. rtems_name_to_characters() in rtems/rtems/support.inl
* but it's private. * but it's private.

View File

@@ -31,7 +31,7 @@ void Task_start_extension(
if ( task_number( started_task->Object.id ) > 0 ) { if ( task_number( started_task->Object.id ) > 0 ) {
name = Task_name[ task_number( started_task->Object.id ) ]; name = Task_name[ task_number( started_task->Object.id ) ];
/* /*
* FIXME: There should be a public function to * FIXME: There should be a public function to
* convert numeric rtems_names into char arrays * convert numeric rtems_names into char arrays
* c.f. rtems_name_to_characters() in rtems/rtems/support.inl * c.f. rtems_name_to_characters() in rtems/rtems/support.inl
* but it's private. * but it's private.

View File

@@ -115,7 +115,7 @@ void Screen1()
); );
puts( "TA1 - rtems_object_get_classic_name - bad ID" ); puts( "TA1 - rtems_object_get_classic_name - bad ID" );
status = rtems_object_get_classic_name( status = rtems_object_get_classic_name(
rtems_build_id( OBJECTS_ITRON_API, OBJECTS_ITRON_TASKS, 1, 1 ), rtems_build_id( OBJECTS_ITRON_API, OBJECTS_ITRON_TASKS, 1, 1 ),
&task_name &task_name
); );

View File

@@ -71,7 +71,7 @@ void Screen3()
#if defined(__m32c__) #if defined(__m32c__)
skipUnsatisfied = true; skipUnsatisfied = true;
#endif #endif
if ( skipUnsatisfied ) { if ( skipUnsatisfied ) {
puts( puts(
"TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED -- SKIPPED" "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED -- SKIPPED"

View File

@@ -100,7 +100,7 @@ void Screen4()
status = rtems_clock_get_tod_timeval( &tv ); status = rtems_clock_get_tod_timeval( &tv );
directive_failed( status, "clock_get_tod_timeval OK" ); directive_failed( status, "clock_get_tod_timeval OK" );
seconds = tv.tv_sec; seconds = tv.tv_sec;
printf( "TA1 - current time - %s\n", ctime(&seconds) ); printf( "TA1 - current time - %s\n", ctime(&seconds) );
} }

View File

@@ -121,7 +121,7 @@ void Screen5()
status = rtems_semaphore_create( status = rtems_semaphore_create(
Semaphore_name[ 1 ], Semaphore_name[ 1 ],
1, 1,
RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY_CEILING | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY_CEILING |
RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY, RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY,
10, 10,
&Junk_id &Junk_id

View File

@@ -120,7 +120,7 @@ void Screen14()
/* bad id */ /* bad id */
build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); build_time( &time, 12, 31, 1994, 9, 0, 0, 0 );
status = rtems_timer_fire_when( status = rtems_timer_fire_when(
rtems_build_id( 1, 1, 1, 256 ), rtems_build_id( 1, 1, 1, 256 ),
&time, &time,
Delayed_routine, Delayed_routine,
@@ -159,8 +159,8 @@ void Screen14()
"rtems_timer_fire_when with NULL handler" "rtems_timer_fire_when with NULL handler"
); );
puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ADDRESS" ); puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ADDRESS" );
/* invalid time -- before RTEMS epoch */ /* invalid time -- before RTEMS epoch */
build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); build_time( &time, 2, 5, 1987, 8, 30, 45, 0 );
status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
fatal_directive_status( fatal_directive_status(

View File

@@ -25,7 +25,7 @@ rtems_task Init(
puts( "Init - rtems_debug_is_enabled - is 0x1 set? No" ); puts( "Init - rtems_debug_is_enabled - is 0x1 set? No" );
is_set = rtems_debug_is_enabled( 0x1 ); is_set = rtems_debug_is_enabled( 0x1 );
rtems_test_assert(is_set == false); rtems_test_assert(is_set == false);
puts( "Init - rtems_debug_enable - set 0x1" ); puts( "Init - rtems_debug_enable - set 0x1" );
rtems_debug_enable(0x1); rtems_debug_enable(0x1);
rtems_test_assert(_Debug_Level == 0x1); rtems_test_assert(_Debug_Level == 0x1);
@@ -33,7 +33,7 @@ rtems_task Init(
puts( "Init - rtems_debug_is_enabled - is 0x1 set? Yes" ); puts( "Init - rtems_debug_is_enabled - is 0x1 set? Yes" );
is_set = rtems_debug_is_enabled( 0x1 ); is_set = rtems_debug_is_enabled( 0x1 );
rtems_test_assert(is_set == true); rtems_test_assert(is_set == true);
puts( "Init - rtems_debug_disable - clear 0x1" ); puts( "Init - rtems_debug_disable - clear 0x1" );
rtems_debug_disable(0x1); rtems_debug_disable(0x1);
rtems_test_assert(_Debug_Level == 0x0); rtems_test_assert(_Debug_Level == 0x0);
@@ -41,7 +41,7 @@ rtems_task Init(
puts( "Init - rtems_debug_is_enabled - is 0x1 set? No" ); puts( "Init - rtems_debug_is_enabled - is 0x1 set? No" );
is_set = rtems_debug_is_enabled( 0x1 ); is_set = rtems_debug_is_enabled( 0x1 );
rtems_test_assert(is_set == false); rtems_test_assert(is_set == false);
puts( "*** END OF TEST 10 ***" ); puts( "*** END OF TEST 10 ***" );
rtems_test_exit(0); rtems_test_exit(0);
} }

View File

@@ -52,7 +52,7 @@ rtems_task Priority_task(
} }
/* special case of setting priority while holding a resource */ /* special case of setting priority while holding a resource */
{ {
rtems_task_priority priority; rtems_task_priority priority;
rtems_task_priority old_priority; rtems_task_priority old_priority;

View File

@@ -46,7 +46,7 @@ rtems_task Task5(
/* /*
* Use TOD_MICROSECONDS_TO_TICKS not RTEMS_MICROSECONDS_TO_TICKS to * Use TOD_MICROSECONDS_TO_TICKS not RTEMS_MICROSECONDS_TO_TICKS to
* test C implementation in SuperCore -- not macro version used * test C implementation in SuperCore -- not macro version used
* everywhere else. * everywhere else.
*/ */
status = rtems_task_wake_after( TOD_MICROSECONDS_TO_TICKS( 1000000 ) ); status = rtems_task_wake_after( TOD_MICROSECONDS_TO_TICKS( 1000000 ) );

View File

@@ -23,7 +23,7 @@ rtems_task Init(
size_t stack_size; size_t stack_size;
puts( "\n\n*** TEST 18 ***" ); puts( "\n\n*** TEST 18 ***" );
puts( "Init - rtems_workspace_get_information - OK" ); puts( "Init - rtems_workspace_get_information - OK" );
sb = rtems_workspace_get_information( &start ); sb = rtems_workspace_get_information( &start );
assert( sb ); assert( sb );
@@ -41,7 +41,7 @@ rtems_task Init(
puts( "Init - rtems_task_create - Unsatisfied on Extensions" ); puts( "Init - rtems_task_create - Unsatisfied on Extensions" );
while (1) { while (1) {
sc = rtems_task_create( sc = rtems_task_create(
rtems_build_name( 'T', 'E', 'S', 'T' ), rtems_build_name( 'T', 'E', 'S', 'T' ),
1, 1,

View File

@@ -111,7 +111,7 @@ rtems_task Init(
) )
{ {
puts( "\n\n*** TEST " TEST_NAME " ***" ); puts( "\n\n*** TEST " TEST_NAME " ***" );
puts( "Testing " TEST_SEMAPHORE_TYPE " semaphore flush" ); puts( "Testing " TEST_SEMAPHORE_TYPE " semaphore flush" );
doTest(); doTest();
puts( "*** END OF TEST " TEST_NAME " ***" ); puts( "*** END OF TEST " TEST_NAME " ***" );

View File

@@ -218,7 +218,7 @@ void test_multiple_taskvars(void)
directive_failed( sc, "get multiple #2" ); directive_failed( sc, "get multiple #2" );
sc = rtems_task_variable_get( RTEMS_SELF, (void **)&taskvar1, &value ); sc = rtems_task_variable_get( RTEMS_SELF, (void **)&taskvar1, &value );
directive_failed( sc, "get multiple #2" ); directive_failed( sc, "get multiple #2" );
/* /*
* Delete task variables in various spots on the chain * Delete task variables in various spots on the chain
*/ */
@@ -317,7 +317,7 @@ void test_delete_from_other_task(void)
directive_failed( sc, "task start other" ); directive_failed( sc, "task start other" );
rtems_task_wake_after( 100 ); rtems_task_wake_after( 100 );
if ( test_dtor_ran != 1 ) { if ( test_dtor_ran != 1 ) {
printf( "Test dtor ran %" PRIu32 " times not 1 times as expected\n", test_dtor_ran ); printf( "Test dtor ran %" PRIu32 " times not 1 times as expected\n", test_dtor_ran );
rtems_test_exit(0); rtems_test_exit(0);
@@ -364,7 +364,7 @@ void test_delete_as_side_effect(void)
directive_failed( sc, "task start deleter" ); directive_failed( sc, "task start deleter" );
rtems_task_wake_after( 100 ); rtems_task_wake_after( 100 );
if ( test_dtor_ran != 2 ) { if ( test_dtor_ran != 2 ) {
printf( "Test dtor ran %" PRIu32 " times not 2 times as expected\n", test_dtor_ran ); printf( "Test dtor ran %" PRIu32 " times not 2 times as expected\n", test_dtor_ran );
rtems_test_exit(0); rtems_test_exit(0);

View File

@@ -193,7 +193,7 @@ rtems_task Init(
directive_failed( status, "rtems_task_start of Waiter" ); directive_failed( status, "rtems_task_start of Waiter" );
} }
puts( "Delay to let Waiters block" ); puts( "Delay to let Waiters block" );
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
directive_failed(status, "rtems_task_wake_after"); directive_failed(status, "rtems_task_wake_after");
@@ -207,7 +207,7 @@ rtems_task Init(
exit(0); exit(0);
} }
puts( "Delay to let Waiters print a message" ); puts( "Delay to let Waiters print a message" );
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
directive_failed(status, "rtems_task_wake_after"); directive_failed(status, "rtems_task_wake_after");
@@ -230,7 +230,7 @@ rtems_task Init(
directive_failed( status, "rtems_task_start of Waiter" ); directive_failed( status, "rtems_task_start of Waiter" );
} }
puts( "Delay to let Waiters block" ); puts( "Delay to let Waiters block" );
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
directive_failed(status, "rtems_task_wake_after"); directive_failed(status, "rtems_task_wake_after");
@@ -238,7 +238,7 @@ rtems_task Init(
status = rtems_barrier_delete( Barrier ); status = rtems_barrier_delete( Barrier );
directive_failed(status, "rtems_barrier_delete"); directive_failed(status, "rtems_barrier_delete");
puts( "Delay to let Waiters print a message" ); puts( "Delay to let Waiters print a message" );
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
directive_failed(status, "rtems_task_wake_after"); directive_failed(status, "rtems_task_wake_after");
@@ -268,7 +268,7 @@ rtems_task Init(
directive_failed( status, "rtems_task_start of Waiter" ); directive_failed( status, "rtems_task_start of Waiter" );
} }
puts( "Delay to let task wait on barrier" ); puts( "Delay to let task wait on barrier" );
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
directive_failed(status, "rtems_task_wake_after"); directive_failed(status, "rtems_task_wake_after");

View File

@@ -45,7 +45,7 @@ const char *CallerName(void)
uint32_t u; uint32_t u;
unsigned char c[4]; unsigned char c[4];
} TempName; } TempName;
#if defined(TEST_ON_RTEMS_45) #if defined(TEST_ON_RTEMS_45)
TempName.u = *(uint32_t *)_Thread_Executing->Object.name; TempName.u = *(uint32_t *)_Thread_Executing->Object.name;
#else #else
@@ -95,22 +95,22 @@ rtems_task BlockingTasks(rtems_task_argument arg)
rtems_task Init(rtems_task_argument ignored) rtems_task Init(rtems_task_argument ignored)
{ {
rtems_status_code status; rtems_status_code status;
int i; int i;
puts( "\n\n*** TEST 34 ***" ); puts( "\n\n*** TEST 34 ***" );
/* Create synchronisation semaphore for LocalHwIsr -> Test Tasks */ /* Create synchronisation semaphore for LocalHwIsr -> Test Tasks */
status = rtems_semaphore_create( status = rtems_semaphore_create(
rtems_build_name ('S', 'E', 'M', '1'), /* name */ rtems_build_name ('S', 'E', 'M', '1'), /* name */
0, /* initial count = 0 */ 0, /* initial count = 0 */
RTEMS_LOCAL | RTEMS_LOCAL |
RTEMS_COUNTING_SEMAPHORE | RTEMS_COUNTING_SEMAPHORE |
RTEMS_PRIORITY, RTEMS_PRIORITY,
0, 0,
&Semaphore); /* *id */ &Semaphore); /* *id */
directive_failed( status, "rtems_semaphore_create" ); directive_failed( status, "rtems_semaphore_create" );
/* Create and start all tasks in the test */ /* Create and start all tasks in the test */
for (i = 0; i < NUMBER_OF_BLOCKING_TASKS; i++) { for (i = 0; i < NUMBER_OF_BLOCKING_TASKS; i++) {
@@ -122,7 +122,7 @@ rtems_task Init(rtems_task_argument ignored)
RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, /* Attributes */ RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, /* Attributes */
&Blockers[i]); /* Assigned ID */ &Blockers[i]); /* Assigned ID */
directive_failed( status, "rtems_task_create (BLKn)" ); directive_failed( status, "rtems_task_create (BLKn)" );
printf( "Blockers[%d] Id = 0x%08" PRIxrtems_id "\n", i, Blockers[i] ); printf( "Blockers[%d] Id = 0x%08" PRIxrtems_id "\n", i, Blockers[i] );
status = rtems_task_start( status = rtems_task_start(
Blockers[i], Blockers[i],

View File

@@ -103,7 +103,7 @@ const char *CallerName(void)
#define NofMediumTask_C 3 #define NofMediumTask_C 3
/* RTEMS identifiers */ /* RTEMS identifiers */
rtems_id TaMedium[NofMediumTask_C]; /* Medium-prio tasks accessing */ rtems_id TaMedium[NofMediumTask_C]; /* Medium-prio tasks accessing */
/* the common local HW */ /* the common local HW */
rtems_id TaHwSim; /* HW simulator */ rtems_id TaHwSim; /* HW simulator */
@@ -191,7 +191,7 @@ rtems_task LocalHwSim_Exec(rtems_task_argument TaskArg)
int ISRCount = 0; int ISRCount = 0;
#endif #endif
printf("LocalHwSim_Exec begins...\n"); printf("LocalHwSim_Exec begins...\n");
while(1) { while(1) {
if (StartHw) { if (StartHw) {
/* A test task has activated the HW, wait for a while and then /* A test task has activated the HW, wait for a while and then
@@ -238,7 +238,7 @@ rtems_isr LocalHwIsr(/*in*/ rtems_vector_number Vector)
void AccessLocalHw(void) void AccessLocalHw(void)
{ {
rtems_status_code Sts; rtems_status_code Sts;
rtems_task_priority EnterPrio; /* Statistics log */ rtems_task_priority EnterPrio; /* Statistics log */
rtems_task_priority AccessPrio; /* : */ rtems_task_priority AccessPrio; /* : */
rtems_task_priority LeavePrio; /* : */ rtems_task_priority LeavePrio; /* : */
@@ -291,7 +291,7 @@ void AccessLocalHw(void)
if ( ++Iterations == 10 ) { if ( ++Iterations == 10 ) {
puts( "*** END OF TEST 35 ***" ); puts( "*** END OF TEST 35 ***" );
exit(0); exit(0);
} }
#endif #endif
return; return;
} }
@@ -299,7 +299,7 @@ void AccessLocalHw(void)
void AccessRemoteHw(void) void AccessRemoteHw(void)
{ {
rtems_status_code Sts; rtems_status_code Sts;
rtems_task_priority EnterPrio; /* Statistics log */ rtems_task_priority EnterPrio; /* Statistics log */
rtems_task_priority AccessPrio; /* : */ rtems_task_priority AccessPrio; /* : */
rtems_task_priority LeavePrio; /* : */ rtems_task_priority LeavePrio; /* : */
@@ -356,29 +356,29 @@ void AccessRemoteHw(void)
/* The Init operation (the Init-task) */ /* The Init operation (the Init-task) */
rtems_task Init(rtems_task_argument ignored) rtems_task Init(rtems_task_argument ignored)
{ {
rtems_status_code status; rtems_status_code status;
#if defined(TEST_USE_ISR) #if defined(TEST_USE_ISR)
rtems_isr_entry DummyIsr; rtems_isr_entry DummyIsr;
#endif #endif
int i; int i;
puts( "\n\n*** TEST 35 ***" ); puts( "\n\n*** TEST 35 ***" );
/* Create synchronisation semaphore for LocalHwIsr -> Test Tasks */ /* Create synchronisation semaphore for LocalHwIsr -> Test Tasks */
status = rtems_semaphore_create( status = rtems_semaphore_create(
rtems_build_name ('S', 'Y', 'N', 'C'), /* name */ rtems_build_name ('S', 'Y', 'N', 'C'), /* name */
0, /* initial count = 0 */ 0, /* initial count = 0 */
RTEMS_LOCAL | RTEMS_LOCAL |
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_SIMPLE_BINARY_SEMAPHORE |
RTEMS_NO_INHERIT_PRIORITY | RTEMS_NO_INHERIT_PRIORITY |
RTEMS_NO_PRIORITY_CEILING | RTEMS_NO_PRIORITY_CEILING |
RTEMS_FIFO, RTEMS_FIFO,
0, 0,
&LocalHwSync_S); /* *id */ &LocalHwSync_S); /* *id */
directive_failed( status, "rtems_semaphore_create (SYNC)" ); directive_failed( status, "rtems_semaphore_create (SYNC)" );
printf( "Sync Mutex Id = 0x%08" PRIxrtems_id "\n", LocalHwSync_S ); printf( "Sync Mutex Id = 0x%08" PRIxrtems_id "\n", LocalHwSync_S );
/* Create resource semaphore for exclusive access to the local HW */ /* Create resource semaphore for exclusive access to the local HW */
status = rtems_semaphore_create( status = rtems_semaphore_create(
rtems_build_name ('R', 'E', 'S', '1'), /* name */ rtems_build_name ('R', 'E', 'S', '1'), /* name */
@@ -406,14 +406,14 @@ rtems_task Init(rtems_task_argument ignored)
directive_failed( status, "rtems_semaphore_create (RES2)" ); directive_failed( status, "rtems_semaphore_create (RES2)" );
printf( "Remote Mutex Id = 0x%08" PRIxrtems_id "\n", RemoteHwAccess_R ); printf( "Remote Mutex Id = 0x%08" PRIxrtems_id "\n", RemoteHwAccess_R );
#if defined(TEST_USE_ISR) #if defined(TEST_USE_ISR)
/* Install ISR for HW/SW synchronization, use ta 0x85 which is synchronous */ /* Install ISR for HW/SW synchronization, use ta 0x85 which is synchronous */
status = rtems_interrupt_catch(LocalHwIsr, 0x85 + 0x100, &DummyIsr); status = rtems_interrupt_catch(LocalHwIsr, 0x85 + 0x100, &DummyIsr);
directive_failed( status, "rtems_interrupt_catch" ); directive_failed( status, "rtems_interrupt_catch" );
#endif #endif
printf("Ending Init-task\n"); printf("Ending Init-task\n");
/* Create and start all tasks in the test */ /* Create and start all tasks in the test */

View File

@@ -76,7 +76,7 @@ rtems_task Init(rtems_task_argument ignored)
Mutex_name[2] = rtems_build_name( 'S','Y','N','C'); Mutex_name[2] = rtems_build_name( 'S','Y','N','C');
Task_name[0] = rtems_build_name( 'T','0',' ',' '); Task_name[0] = rtems_build_name( 'T','0',' ',' ');
status = rtems_task_create( status = rtems_task_create(
Task_name[0], Task_name[0],
@@ -89,7 +89,7 @@ rtems_task Init(rtems_task_argument ignored)
directive_failed( status,"rtems_task_create of T0"); directive_failed( status,"rtems_task_create of T0");
printf("Create T0,priority is 4\n"); printf("Create T0,priority is 4\n");
status = rtems_task_start( Task_id[0],Task0, 0); status = rtems_task_start( Task_id[0],Task0, 0);
directive_failed( status,"rtems_task_start of T0"); directive_failed( status,"rtems_task_start of T0");
@@ -102,8 +102,8 @@ rtems_task Init(rtems_task_argument ignored)
rtems_task Task0(rtems_task_argument ignored) rtems_task Task0(rtems_task_argument ignored)
{ {
rtems_status_code status; rtems_status_code status;
status = rtems_semaphore_obtain( status = rtems_semaphore_obtain(
Mutex_id[0], Mutex_id[0],
RTEMS_WAIT, RTEMS_WAIT,
@@ -111,7 +111,7 @@ rtems_task Task0(rtems_task_argument ignored)
printf("T0 rtems_semaphore_obtain - S0\n"); printf("T0 rtems_semaphore_obtain - S0\n");
directive_failed( status,"rtems_semaphore_obtain of S0\n"); directive_failed( status,"rtems_semaphore_obtain of S0\n");
printf("The current priority of T0 is %d\n",Get_current_pri()); printf("The current priority of T0 is %d\n",Get_current_pri());
status = rtems_semaphore_obtain( status = rtems_semaphore_obtain(
Mutex_id[1], Mutex_id[1],
RTEMS_WAIT, RTEMS_WAIT,
@@ -131,7 +131,7 @@ rtems_task Task0(rtems_task_argument ignored)
printf("T0 - rtems_semaphore_release - S1\n"); printf("T0 - rtems_semaphore_release - S1\n");
directive_failed( status,"rtems_semaphore_release of S1\n"); directive_failed( status,"rtems_semaphore_release of S1\n");
printf("The current priority of T0 is %d\n",Get_current_pri()); printf("The current priority of T0 is %d\n",Get_current_pri());
Task_name[1] = rtems_build_name( 'T','1',' ',' '); Task_name[1] = rtems_build_name( 'T','1',' ',' ');
status = rtems_task_create( status = rtems_task_create(
@@ -144,7 +144,7 @@ rtems_task Task0(rtems_task_argument ignored)
); );
directive_failed( status , "rtems_task_create of T1\n"); directive_failed( status , "rtems_task_create of T1\n");
printf("Create S1,priority is 1\n"); printf("Create S1,priority is 1\n");
status = rtems_task_start( Task_id[1],Task1, 0); status = rtems_task_start( Task_id[1],Task1, 0);
directive_failed( status, "rtems_task_start of T1\n"); directive_failed( status, "rtems_task_start of T1\n");
@@ -154,9 +154,9 @@ rtems_task Task0(rtems_task_argument ignored)
status = rtems_semaphore_release(Mutex_id[0]); status = rtems_semaphore_release(Mutex_id[0]);
printf("T0 - rtems_semaphore_release - S0\n"); printf("T0 - rtems_semaphore_release - S0\n");
directive_failed( status, "rtems_semaphore_release of S0\n"); directive_failed( status, "rtems_semaphore_release of S0\n");
} }
rtems_task Task1(rtems_task_argument ignored) rtems_task Task1(rtems_task_argument ignored)
{ {
@@ -194,10 +194,10 @@ rtems_task_priority Get_current_pri(void)
printf("node:Id=%p,priority_before=%d," printf("node:Id=%p,priority_before=%d,"
"holder_id=%d,holder's current priority=%d\n",node, "holder_id=%d,holder's current priority=%d\n",node,
((CORE_mutex_order_list *)node)->priority_before,p_mutex->holder_id,p_mutex->holder->current_priority); ((CORE_mutex_order_list *)node)->priority_before,p_mutex->holder_id,p_mutex->holder->current_priority);
node = node->next; node = node->next;
} }
} }
else else
printf("the Chain is empty\n"); printf("the Chain is empty\n");
} }
*/ */

View File

@@ -62,7 +62,7 @@ void test_interrupt_inline(void)
puts( "interrupt enable (use inline)" ); puts( "interrupt enable (use inline)" );
rtems_interrupt_enable( level ); rtems_interrupt_enable( level );
puts( "interrupt level attribute (use inline)" ); puts( "interrupt level attribute (use inline)" );
level_attribute = rtems_interrupt_level_attribute( level ); level_attribute = rtems_interrupt_level_attribute( level );
level_attribute_macro = RTEMS_INTERRUPT_LEVEL(level); level_attribute_macro = RTEMS_INTERRUPT_LEVEL(level);
@@ -168,7 +168,7 @@ rtems_timer_service_routine test_unblock_task(
status = rtems_timer_fire_after( timer, 1, test_unblock_task, NULL ); status = rtems_timer_fire_after( timer, 1, test_unblock_task, NULL );
directive_failed( status, "timer_fire_after failed" ); directive_failed( status, "timer_fire_after failed" );
return; return;
} }
blocked_task_status = 2; blocked_task_status = 2;
_Thread_Disable_dispatch(); _Thread_Disable_dispatch();
@@ -288,7 +288,7 @@ rtems_task Init(
puts( "interrupt enable (use body)" ); puts( "interrupt enable (use body)" );
rtems_interrupt_enable( level ); rtems_interrupt_enable( level );
puts( "interrupt level attribute (use body)" ); puts( "interrupt level attribute (use body)" );
level_attribute = rtems_interrupt_level_attribute( level ); level_attribute = rtems_interrupt_level_attribute( level );
level_attribute_macro = RTEMS_INTERRUPT_LEVEL(level); level_attribute_macro = RTEMS_INTERRUPT_LEVEL(level);
@@ -307,7 +307,7 @@ rtems_task Init(
status = rtems_task_wake_after( 100 ); status = rtems_task_wake_after( 100 );
directive_failed( status, "wake_after failed" ); directive_failed( status, "wake_after failed" );
check_isr_worked( "inline", isr_in_progress_body ); check_isr_worked( "inline", isr_in_progress_body );
check_isr_worked( "body", isr_in_progress_body ); check_isr_worked( "body", isr_in_progress_body );

View File

@@ -90,7 +90,7 @@ rtems_task Init(
break; break;
} }
puts( "Signal sent from ISR has been processed" ); puts( "Signal sent from ISR has been processed" );
puts( "*** END OF TEST 38 ***" ); puts( "*** END OF TEST 38 ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );
} }

View File

@@ -132,7 +132,7 @@ rtems_task Init(
printf( printf(
"Event sent from ISR hitting synchronization point has %soccurred\n", "Event sent from ISR hitting synchronization point has %soccurred\n",
(( case_hit == TRUE ) ? "" : "NOT ") (( case_hit == TRUE ) ? "" : "NOT ")
); );
/* /*
* Test Event send successful from ISR -- receive has timeout * Test Event send successful from ISR -- receive has timeout
@@ -167,7 +167,7 @@ rtems_task Init(
"Event sent from ISR (with timeout) hitting synchronization " "Event sent from ISR (with timeout) hitting synchronization "
"point has %soccurred\n", "point has %soccurred\n",
(( case_hit == TRUE ) ? "" : "NOT ") (( case_hit == TRUE ) ? "" : "NOT ")
); );
puts( "*** END OF TEST 39 ***" ); puts( "*** END OF TEST 39 ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );

View File

@@ -65,12 +65,12 @@ rtems_task Locker_task(
rtems_status_code status; rtems_status_code status;
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "rtems_task_ident" ); directive_failed( status, "rtems_task_ident" );
task_index = task_number( tid ) - 1; task_index = task_number( tid ) - 1;
status = rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 0 ); status = rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 0 );
directive_failed( status, "rtems_semaphore_obtain" ); directive_failed( status, "rtems_semaphore_obtain" );
put_name( Task_name[ task_index ], FALSE ); put_name( Task_name[ task_index ], FALSE );
puts( " - unblocked - OK" ); puts( " - unblocked - OK" );
@@ -93,10 +93,10 @@ void do_test(
0, /* IGNORED */ 0, /* IGNORED */
&Semaphore &Semaphore
); );
directive_failed( status, "rtems_semaphore_create" ); directive_failed( status, "rtems_semaphore_create" );
for (i=0 ; i< MAX_TASKS ; i++ ) { for (i=0 ; i< MAX_TASKS ; i++ ) {
Task_name[ i ] = rtems_build_name( Task_name[ i ] = rtems_build_name(
'T', 'T',
'A', 'A',
@@ -112,36 +112,36 @@ void do_test(
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ i ] &Task_id[ i ]
); );
directive_failed( status, "rtems_task_create" ); directive_failed( status, "rtems_task_create" );
status = rtems_task_start( status = rtems_task_start(
Task_id[ i ], Locker_task, (rtems_task_argument)i ); Task_id[ i ], Locker_task, (rtems_task_argument)i );
directive_failed( status, "rtems_task_start" ); directive_failed( status, "rtems_task_start" );
status = rtems_task_wake_after( 10 ); status = rtems_task_wake_after( 10 );
directive_failed( status, "rtems_task_wake_after" ); directive_failed( status, "rtems_task_wake_after" );
} }
for (i=0 ; i< MAX_TASKS ; i++ ) { for (i=0 ; i< MAX_TASKS ; i++ ) {
if ( extract == FALSE ) { if ( extract == FALSE ) {
status = rtems_semaphore_release( Semaphore ); status = rtems_semaphore_release( Semaphore );
directive_failed( status, "rtems_semaphore_release" ); directive_failed( status, "rtems_semaphore_release" );
status = rtems_task_wake_after( 100 ); status = rtems_task_wake_after( 100 );
directive_failed( status, "rtems_task_wake_after" ); directive_failed( status, "rtems_task_wake_after" );
} else { } else {
status = rtems_task_delete( Task_id[ i ] ); status = rtems_task_delete( Task_id[ i ] );
directive_failed( status, "rtems_task_delete" ); directive_failed( status, "rtems_task_delete" );
} }
} }
/* one extra release for the initial state */ /* one extra release for the initial state */
status = rtems_semaphore_release( Semaphore ); status = rtems_semaphore_release( Semaphore );
directive_failed( status, "rtems_semaphore_release" ); directive_failed( status, "rtems_semaphore_release" );
/* now delete the semaphore since no one is waiting and it is unlocked */ /* now delete the semaphore since no one is waiting and it is unlocked */
status = rtems_semaphore_delete( Semaphore ); status = rtems_semaphore_delete( Semaphore );
directive_failed( status, "rtems_semaphore_delete" ); directive_failed( status, "rtems_semaphore_delete" );
} }
rtems_task Init( rtems_task Init(

View File

@@ -175,7 +175,7 @@ rtems_task Init(
put_name( tmpName, FALSE ); put_name( tmpName, FALSE );
puts( " - rtems_build_name for TEMP" ); puts( " - rtems_build_name for TEMP" );
/* /*
* rtems_object_get_name - cases * rtems_object_get_name - cases
*/ */
@@ -272,7 +272,7 @@ rtems_task Init(
puts( "rtems_build_id - build an id to match init task" ); puts( "rtems_build_id - build an id to match init task" );
tmpId = rtems_build_id( OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TASKS, 1, 1 ), tmpId = rtems_build_id( OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TASKS, 1, 1 ),
assert( tmpId == main_task ); assert( tmpId == main_task );
puts( "rtems_object_id_get_api - OK" ); puts( "rtems_object_id_get_api - OK" );
part = rtems_object_id_get_api( main_task ); part = rtems_object_id_get_api( main_task );
assert( part == OBJECTS_CLASSIC_API ); assert( part == OBJECTS_CLASSIC_API );
@@ -332,7 +332,7 @@ rtems_task Init(
* Another screen break for the API and class name tests * Another screen break for the API and class name tests
*/ */
rtems_test_pause(); rtems_test_pause();
printf( "rtems_object_get_api_name(0) = %s\n", rtems_object_get_api_name(0) ); printf( "rtems_object_get_api_name(0) = %s\n", rtems_object_get_api_name(0) );
printf( "rtems_object_get_api_name(255) = %s\n", printf( "rtems_object_get_api_name(255) = %s\n",
rtems_object_get_api_name(255)); rtems_object_get_api_name(255));
@@ -344,14 +344,14 @@ rtems_task Init(
printf( "rtems_object_get_api_name(ITRON_API) = %s\n", printf( "rtems_object_get_api_name(ITRON_API) = %s\n",
rtems_object_get_api_name(OBJECTS_ITRON_API) ); rtems_object_get_api_name(OBJECTS_ITRON_API) );
printf( "rtems_object_get_api_class_name(0, RTEMS_TASKS) = %s\n", printf( "rtems_object_get_api_class_name(0, RTEMS_TASKS) = %s\n",
rtems_object_get_api_class_name( 0, OBJECTS_RTEMS_TASKS ) ); rtems_object_get_api_class_name( 0, OBJECTS_RTEMS_TASKS ) );
printf( "rtems_object_get_api_class_name(CLASSIC_API, 0) = %s\n", printf( "rtems_object_get_api_class_name(CLASSIC_API, 0) = %s\n",
rtems_object_get_api_class_name( OBJECTS_CLASSIC_API, 0 ) ); rtems_object_get_api_class_name( OBJECTS_CLASSIC_API, 0 ) );
printf("rtems_object_get_api_class_name(INTERNAL_API, MUTEXES) = %s\n", printf("rtems_object_get_api_class_name(INTERNAL_API, MUTEXES) = %s\n",
rtems_object_get_api_class_name( rtems_object_get_api_class_name(
OBJECTS_INTERNAL_API, OBJECTS_INTERNAL_MUTEXES)); OBJECTS_INTERNAL_API, OBJECTS_INTERNAL_MUTEXES));
printf("rtems_object_get_api_class_name(CLASSIC_API, RTEMS_BARRIERS) = %s\n", printf("rtems_object_get_api_class_name(CLASSIC_API, RTEMS_BARRIERS) = %s\n",
rtems_object_get_api_class_name( rtems_object_get_api_class_name(
OBJECTS_CLASSIC_API, OBJECTS_RTEMS_BARRIERS)); OBJECTS_CLASSIC_API, OBJECTS_RTEMS_BARRIERS));
@@ -360,7 +360,7 @@ rtems_task Init(
*/ */
rtems_test_pause(); rtems_test_pause();
puts( "rtems_object_get_class_information - INVALID_ADDRESS" ); puts( "rtems_object_get_class_information - INVALID_ADDRESS" );
sc = rtems_object_get_class_information( sc = rtems_object_get_class_information(
OBJECTS_INTERNAL_API, OBJECTS_INTERNAL_THREADS, NULL ); OBJECTS_INTERNAL_API, OBJECTS_INTERNAL_THREADS, NULL );

View File

@@ -79,7 +79,7 @@ rtems_task TaskAB_entry(rtems_task_argument me)
if (turn == me) { if (turn == me) {
printf("Task #%" PRIdrtems_task_argument "'s turn. Now setting turn to %" PRIdrtems_task_argument "\n", me, 1 - me); printf("Task #%" PRIdrtems_task_argument "'s turn. Now setting turn to %" PRIdrtems_task_argument "\n", me, 1 - me);
turn = 1 - me; turn = 1 - me;
if ( ++iterations == 10 ) { if ( ++iterations == 10 ) {
puts( "*** END OF SP44 TEST ***" ); puts( "*** END OF SP44 TEST ***" );
exit( 0 ); exit( 0 );

View File

@@ -42,7 +42,7 @@ rtems_task Periodic_Task(
status = rtems_rate_monotonic_period( period_id, 25 ); status = rtems_rate_monotonic_period( period_id, 25 );
directive_failed(status, "rate_monotonic_period"); directive_failed(status, "rate_monotonic_period");
partial_loop = 0; partial_loop = 0;
start = rtems_clock_get_ticks_since_boot(); start = rtems_clock_get_ticks_since_boot();
end = start + 5; end = start + 5;
while ( end <= rtems_clock_get_ticks_since_boot() ) while ( end <= rtems_clock_get_ticks_since_boot() )

View File

@@ -40,7 +40,7 @@ rtems_task Init(rtems_task_argument ignored)
sc = rtems_task_create( sc = rtems_task_create(
rtems_build_name('t', 's', 't', '0'), rtems_build_name('t', 's', 't', '0'),
100, 100,
RTEMS_MINIMUM_STACK_SIZE, RTEMS_MINIMUM_STACK_SIZE,
RTEMS_NO_ASR, RTEMS_NO_ASR,
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
&ti &ti

View File

@@ -33,7 +33,7 @@ rtems_task Init(rtems_task_argument ignored)
rtems_build_name('s', 'e', 'm', ' '), rtems_build_name('s', 'e', 'm', ' '),
1, 1,
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
0, 0,
&Semaphores[i] &Semaphores[i]
); );
/* printf("Creating %i id=0x%08x\n", i, Semaphores[i]); */ /* printf("Creating %i id=0x%08x\n", i, Semaphores[i]); */

View File

@@ -40,7 +40,7 @@ rtems_task Init(
puts( "\n\n*** TEST 50 ***" ); puts( "\n\n*** TEST 50 ***" );
sc = rtems_timer_initiate_server( sc = rtems_timer_initiate_server(
1, 1,
RTEMS_MINIMUM_STACK_SIZE, RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
); );
@@ -63,7 +63,7 @@ rtems_task Init(
sc = rtems_clock_get_uptime( &uptime ); sc = rtems_clock_get_uptime( &uptime );
directive_failed( sc, "rtems_clock_get_uptime" ); directive_failed( sc, "rtems_clock_get_uptime" );
printf( "Timer fired at %" PRItime_t "\n", uptime.tv_sec ); printf( "Timer fired at %" PRItime_t "\n", uptime.tv_sec );
} }

View File

@@ -48,7 +48,7 @@ rtems_task Init(
puts( "Init - rtems_task_start - delay task - OK" ); puts( "Init - rtems_task_start - delay task - OK" );
status = rtems_task_start( task_id, Delay_task, 0 ); status = rtems_task_start( task_id, Delay_task, 0 );
directive_failed( status, "rtems_task_start" ); directive_failed( status, "rtems_task_start" );
puts( "Init - rtems_task_wake_after - let delay task block - OK" ); puts( "Init - rtems_task_wake_after - let delay task block - OK" );
status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(1000) ); status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(1000) );
directive_failed( status, "rtems_task_wake_after" ); directive_failed( status, "rtems_task_wake_after" );
@@ -56,7 +56,7 @@ rtems_task Init(
puts( "Init - rtems_task_restart - delay task - OK" ); puts( "Init - rtems_task_restart - delay task - OK" );
status = rtems_task_restart( task_id, 0 ); status = rtems_task_restart( task_id, 0 );
directive_failed( status, "rtems_task_restart" ); directive_failed( status, "rtems_task_restart" );
puts( "*** END OF TEST 57 ***" ); puts( "*** END OF TEST 57 ***" );
rtems_test_exit(0); rtems_test_exit(0);
} }

View File

@@ -35,7 +35,7 @@ void timespec_divide_by_zero(void)
_Timespec_Divide( &t1, &zero, &ival_percentage, &fval_percentage ); _Timespec_Divide( &t1, &zero, &ival_percentage, &fval_percentage );
rtems_test_assert( ival_percentage == 0 ); rtems_test_assert( ival_percentage == 0 );
rtems_test_assert( fval_percentage == 0 ); rtems_test_assert( fval_percentage == 0 );
} }
rtems_task Init( rtems_task Init(

View File

@@ -67,7 +67,7 @@ rtems_task Init(
puts( "Init - rtems_task_start - delay task - OK" ); puts( "Init - rtems_task_start - delay task - OK" );
status = rtems_task_start( task_id, Blocking_task, 0 ); status = rtems_task_start( task_id, Blocking_task, 0 );
directive_failed( status, "rtems_task_start" ); directive_failed( status, "rtems_task_start" );
puts( "Init - rtems_region_create - OK" ); puts( "Init - rtems_region_create - OK" );
status = rtems_region_create( status = rtems_region_create(
rtems_build_name('R', 'N', '0', '1'), rtems_build_name('R', 'N', '0', '1'),

View File

@@ -38,19 +38,19 @@ rtems_task Init(
puts( "Init - rtems_rate_monotonic_period - short period" ); puts( "Init - rtems_rate_monotonic_period - short period" );
sc = rtems_rate_monotonic_period(period1, RTEMS_MILLISECONDS_TO_TICKS(200) ); sc = rtems_rate_monotonic_period(period1, RTEMS_MILLISECONDS_TO_TICKS(200) );
directive_failed( sc, "rtems_rate_monotonic_period" ); directive_failed( sc, "rtems_rate_monotonic_period" );
puts( "Init - rtems_rate_monotonic_period - long period initiated" ); puts( "Init - rtems_rate_monotonic_period - long period initiated" );
sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) ); sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) );
directive_failed( sc, "rtems_rate_monotonic_period" ); directive_failed( sc, "rtems_rate_monotonic_period" );
puts( "Init - rtems_rate_monotonic_period - long period block" ); puts( "Init - rtems_rate_monotonic_period - long period block" );
sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) ); sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) );
directive_failed( sc, "rtems_rate_monotonic_period" ); directive_failed( sc, "rtems_rate_monotonic_period" );
puts( "Init - rtems_rate_monotonic_period - verify long period expired" ); puts( "Init - rtems_rate_monotonic_period - verify long period expired" );
sc = rtems_rate_monotonic_period(period1, RTEMS_PERIOD_STATUS ); sc = rtems_rate_monotonic_period(period1, RTEMS_PERIOD_STATUS );
fatal_directive_status(sc, RTEMS_TIMEOUT, "rtems_task_period status"); fatal_directive_status(sc, RTEMS_TIMEOUT, "rtems_task_period status");
puts( "*** END OF TEST 60 ***" ); puts( "*** END OF TEST 60 ***" );
rtems_test_exit(0); rtems_test_exit(0);
} }

View File

@@ -27,7 +27,7 @@ rtems_task Init(
puts( "Init - restore System State and shutdown for real" ); puts( "Init - restore System State and shutdown for real" );
_System_state_Set( SYSTEM_STATE_UP ); _System_state_Set( SYSTEM_STATE_UP );
puts( "*** END OF TEST 61 ***" ); puts( "*** END OF TEST 61 ***" );
rtems_test_exit(0); rtems_test_exit(0);
} }

View File

@@ -38,7 +38,7 @@ rtems_task Blocker(
puts( "Blocker - Got memory after resize" ); puts( "Blocker - Got memory after resize" );
case_hit = true; case_hit = true;
(void) rtems_task_delete( RTEMS_SELF ); (void) rtems_task_delete( RTEMS_SELF );
} }
@@ -53,7 +53,7 @@ rtems_task Init(
size_t size; size_t size;
puts( "\n\n*** TEST 62 ***" ); puts( "\n\n*** TEST 62 ***" );
puts( "Init - rtems_task_create Blocker - OK" ); puts( "Init - rtems_task_create Blocker - OK" );
sc = rtems_task_create( sc = rtems_task_create(
rtems_build_name( 'B', 'L', 'C', 'K' ), rtems_build_name( 'B', 'L', 'C', 'K' ),

View File

@@ -116,7 +116,7 @@ rtems_task Init(
) )
{ {
puts( "\n\n*** TEST 63 ***" ); puts( "\n\n*** TEST 63 ***" );
test_case_one(); test_case_one();
test_case_two(); test_case_two();

View File

@@ -29,14 +29,14 @@ rtems_task Init(
{ {
int status; int status;
rtems_id Mutex_id, Task_id; rtems_id Mutex_id, Task_id;
puts( "\n\n*** TEST " TEST_NAME " ***" ); puts( "\n\n*** TEST " TEST_NAME " ***" );
/* /*
* Create binary semaphore (a.k.a. Mutex) with Priority Ceiling * Create binary semaphore (a.k.a. Mutex) with Priority Ceiling
* attribute. * attribute.
*/ */
puts( "Creating semaphore" ); puts( "Creating semaphore" );
status = rtems_semaphore_create( status = rtems_semaphore_create(
rtems_build_name( 's','e','m','1' ), rtems_build_name( 's','e','m','1' ),
@@ -50,9 +50,9 @@ rtems_task Init(
puts( "Calling rtems_semaphore_obtain" ); puts( "Calling rtems_semaphore_obtain" );
status = rtems_semaphore_obtain( Mutex_id, RTEMS_DEFAULT_OPTIONS, 0 ); status = rtems_semaphore_obtain( Mutex_id, RTEMS_DEFAULT_OPTIONS, 0 );
directive_failed( status, "rtems_semaphore_obtain" ); directive_failed( status, "rtems_semaphore_obtain" );
puts( "Calling rtems_task_create" ); puts( "Calling rtems_task_create" );
status = rtems_task_create( rtems_build_name( 'T', 'A', 'S', '1' ), status = rtems_task_create( rtems_build_name( 'T', 'A', 'S', '1' ),
TASK_PRIORITY, TASK_PRIORITY,
RTEMS_MINIMUM_STACK_SIZE, RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_MODES,
@@ -60,17 +60,17 @@ rtems_task Init(
&Task_id &Task_id
); );
directive_failed( status, "rtems_task_create" ); directive_failed( status, "rtems_task_create" );
puts( "Calling rtems_task_start" ); puts( "Calling rtems_task_start" );
status = rtems_task_start( Task_id, Task_1, (rtems_task_argument)&Mutex_id ); status = rtems_task_start( Task_id, Task_1, (rtems_task_argument)&Mutex_id );
directive_failed( status, "rtems_task_start" ); directive_failed( status, "rtems_task_start" );
sleep(1); sleep(1);
puts( "Calling semaphore release" ); puts( "Calling semaphore release" );
status = rtems_semaphore_release( Mutex_id ); status = rtems_semaphore_release( Mutex_id );
directive_failed( status, "rtems_semaphore_release" ); directive_failed( status, "rtems_semaphore_release" );
puts( "*** END OF TEST 65 ***" ); puts( "*** END OF TEST 65 ***" );

View File

@@ -21,14 +21,14 @@ rtems_task Init(
{ {
int status, ceiling, old_ceiling; int status, ceiling, old_ceiling;
rtems_id Mutex_id, Task_id; rtems_id Mutex_id, Task_id;
puts( "\n\n*** TEST 66 ***" ); puts( "\n\n*** TEST 66 ***" );
/* /*
* Create binary semaphore (a.k.a. Mutex) with Priority Ceiling * Create binary semaphore (a.k.a. Mutex) with Priority Ceiling
* attribute. * attribute.
*/ */
puts( "Creating semaphore" ); puts( "Creating semaphore" );
status = rtems_semaphore_create( status = rtems_semaphore_create(
rtems_build_name( 's','e','m','1' ), rtems_build_name( 's','e','m','1' ),
@@ -42,9 +42,9 @@ rtems_task Init(
puts( "Calling rtems_semaphore_obtain" ); puts( "Calling rtems_semaphore_obtain" );
status = rtems_semaphore_obtain( Mutex_id, RTEMS_DEFAULT_OPTIONS, 0 ); status = rtems_semaphore_obtain( Mutex_id, RTEMS_DEFAULT_OPTIONS, 0 );
directive_failed( status, "rtems_semaphore_obtain" ); directive_failed( status, "rtems_semaphore_obtain" );
puts( "Calling rtems_task_create" ); puts( "Calling rtems_task_create" );
status = rtems_task_create( rtems_build_name( 'T', 'A', 'S', '1' ), status = rtems_task_create( rtems_build_name( 'T', 'A', 'S', '1' ),
2, 2,
RTEMS_MINIMUM_STACK_SIZE, RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_MODES,
@@ -52,17 +52,17 @@ rtems_task Init(
&Task_id &Task_id
); );
directive_failed( status, "rtems_task_create" ); directive_failed( status, "rtems_task_create" );
puts( "Calling rtems_task_start" ); puts( "Calling rtems_task_start" );
status = rtems_task_start( Task_id, Task_1, (rtems_task_argument)&Mutex_id ); status = rtems_task_start( Task_id, Task_1, (rtems_task_argument)&Mutex_id );
directive_failed( status, "rtems_task_start" ); directive_failed( status, "rtems_task_start" );
sleep(1); sleep(1);
puts( "Calling semaphore release" ); puts( "Calling semaphore release" );
status = rtems_semaphore_release( Mutex_id ); status = rtems_semaphore_release( Mutex_id );
directive_failed( status, "rtems_semaphore_release" ); directive_failed( status, "rtems_semaphore_release" );
puts( "*** END OF TEST 66 ***" ); puts( "*** END OF TEST 66 ***" );
rtems_test_exit(0); rtems_test_exit(0);

View File

@@ -21,9 +21,9 @@ rtems_task Init(
rtems_task_argument ignored rtems_task_argument ignored
) )
{ {
rtems_chain_control chain1; rtems_chain_control chain1;
rtems_chain_node *p; rtems_chain_node *p;
test_node node1, node2; test_node node1, node2;
int id; int id;
puts( "\n\n*** TEST OF RTEMS CHAIN API ***" ); puts( "\n\n*** TEST OF RTEMS CHAIN API ***" );

View File

@@ -30,23 +30,23 @@ rtems_task Init(
sc = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); sc = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
directive_failed( sc, "rtems_clock_get -- TOD" ); directive_failed( sc, "rtems_clock_get -- TOD" );
print_time( "Init - rtems_clock_get - ", &time, "\n" ); print_time( "Init - rtems_clock_get - ", &time, "\n" );
sc = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &interval ); sc = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &interval );
directive_failed( sc, "rtems_clock_get -- Seconds Since Epoch" ); directive_failed( sc, "rtems_clock_get -- Seconds Since Epoch" );
printf( "Init - rtems_clock_get - Seconds Since Epoch = %" PRIdrtems_interval "\n", interval ); printf( "Init - rtems_clock_get - Seconds Since Epoch = %" PRIdrtems_interval "\n", interval );
sc = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &interval ); sc = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &interval );
directive_failed( sc, "rtems_clock_get -- Ticks Since Boot" ); directive_failed( sc, "rtems_clock_get -- Ticks Since Boot" );
printf( "Init - rtems_clock_get - Ticks Since Boot = %" PRIdrtems_interval "\n", interval ); printf( "Init - rtems_clock_get - Ticks Since Boot = %" PRIdrtems_interval "\n", interval );
sc = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &interval ); sc = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &interval );
directive_failed( sc, "rtems_clock_get -- Ticks Per Second" ); directive_failed( sc, "rtems_clock_get -- Ticks Per Second" );
printf( "Init - rtems_clock_get - Ticks Per Second = %" PRIdrtems_interval "\n", interval ); printf( "Init - rtems_clock_get - Ticks Per Second = %" PRIdrtems_interval "\n", interval );
sc = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &timev ); sc = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &timev );
directive_failed( sc, "rtems_clock_get -- Time Value" ); directive_failed( sc, "rtems_clock_get -- Time Value" );
printf( "Init - rtems_clock_get - Time Value = %" PRItime_t "\n", timev.tv_sec ); printf( "Init - rtems_clock_get - Time Value = %" PRItime_t "\n", timev.tv_sec );
puts( "*** END OF TEST LEGACY RTEMS_CLOCK_GET ***" ); puts( "*** END OF TEST LEGACY RTEMS_CLOCK_GET ***" );
rtems_test_exit(0); rtems_test_exit(0);
} }

View File

@@ -19,7 +19,7 @@
#define FATAL_ERROR_DESCRIPTION "Core Mutex obtain in critical section" #define FATAL_ERROR_DESCRIPTION "Core Mutex obtain in critical section"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE #define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE #define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE #define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE
void force_error(void) void force_error(void)
{ {
@@ -45,6 +45,6 @@ void force_error(void)
_Thread_Enable_dispatch(); _Thread_Enable_dispatch();
puts("ERROR -- Obtain semaphore should not have returned"); puts("ERROR -- Obtain semaphore should not have returned");
/* we will not run this far */ /* we will not run this far */
} }

View File

@@ -60,13 +60,13 @@ void force_error()
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
&id &id
); );
directive_failed( status, "rtems_task_create" ); directive_failed( status, "rtems_task_create" );
status = rtems_task_start( id, EmptyTask, 0 ); status = rtems_task_start( id, EmptyTask, 0 );
directive_failed( status, "rtems_task_start" ); directive_failed( status, "rtems_task_start" );
status = rtems_task_wake_after( 10 ); status = rtems_task_wake_after( 10 );
directive_failed( status, "rtems_task_wake_after" ); directive_failed( status, "rtems_task_wake_after" );
/* we will not run this far */ /* we will not run this far */
} }

View File

@@ -40,7 +40,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
void force_error() void force_error()
{ {
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
Configuration.interrupt_stack_size = (STACK_MINIMUM_SIZE-1); Configuration.interrupt_stack_size = (STACK_MINIMUM_SIZE-1);
rtems_initialize_data_structures(); rtems_initialize_data_structures();
#else #else
@@ -50,6 +50,6 @@ void force_error()
); );
rtems_test_exit(0); rtems_test_exit(0);
#endif #endif
/* we will not run this far */ /* we will not run this far */
} }

View File

@@ -34,7 +34,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define FATAL_ERROR_TEST_NAME "8" #define FATAL_ERROR_TEST_NAME "8"
#define FATAL_ERROR_DESCRIPTION "Core workspace too small" #define FATAL_ERROR_DESCRIPTION "Core workspace too small"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE #define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE #define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_WORKSPACE_ALLOCATION #define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_WORKSPACE_ALLOCATION
char Workspace[ 256 ] CPU_STRUCTURE_ALIGNMENT; char Workspace[ 256 ] CPU_STRUCTURE_ALIGNMENT;

View File

@@ -33,7 +33,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define FATAL_ERROR_TEST_NAME "9" #define FATAL_ERROR_TEST_NAME "9"
#define FATAL_ERROR_DESCRIPTION "Core invalid workspace address" #define FATAL_ERROR_DESCRIPTION "Core invalid workspace address"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE #define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE #define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS #define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS

View File

@@ -19,6 +19,6 @@
void force_error() void force_error()
{ {
__assert_func( __FILE__, __LINE__, "Init", "forced" ); __assert_func( __FILE__, __LINE__, "Init", "forced" );
/* we will not run this far */ /* we will not run this far */
} }

Some files were not shown because too many files have changed in this diff Show More