2014-08-05 19:13:23 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 René Kijewski <rene.kijewski@fu-berlin.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup tests
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2016-01-04 22:29:34 +01:00
|
|
|
* @brief Print the size of thread_t.
|
2014-08-05 19:13:23 +02:00
|
|
|
*
|
|
|
|
* @author René Kijewski <rene.kijewski@fu-berlin.de>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2016-01-04 22:29:34 +01:00
|
|
|
#include "thread.h"
|
2014-08-05 19:13:23 +02:00
|
|
|
|
2016-11-08 16:28:40 +01:00
|
|
|
#define P(NAME) printf("\t%-*s%4u%4u\n", 11, #NAME, \
|
|
|
|
(unsigned)sizeof(((thread_t *) 0)->NAME), \
|
|
|
|
(unsigned)offsetof(thread_t, NAME));
|
2014-08-05 19:13:23 +02:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
puts("\tmember, sizeof, offsetof");
|
|
|
|
|
2016-11-08 16:28:40 +01:00
|
|
|
printf("sizeof(thread_t): %u\n", (unsigned)sizeof(thread_t));
|
2014-08-05 19:13:23 +02:00
|
|
|
|
|
|
|
P(sp);
|
|
|
|
P(status);
|
|
|
|
P(priority);
|
2016-02-29 01:48:08 +01:00
|
|
|
P(pid);
|
2016-02-24 23:21:56 +01:00
|
|
|
#ifdef MODULE_CORE_THREAD_FLAGS
|
|
|
|
P(flags);
|
|
|
|
#endif
|
2014-08-05 19:13:23 +02:00
|
|
|
P(rq_entry);
|
2016-02-26 22:19:31 +01:00
|
|
|
#ifdef MODULE_CORE_MSG
|
2014-08-05 19:13:23 +02:00
|
|
|
P(wait_data);
|
|
|
|
P(msg_waiters);
|
|
|
|
P(msg_queue);
|
|
|
|
P(msg_array);
|
2016-02-26 22:19:31 +01:00
|
|
|
#endif
|
2014-10-15 00:04:58 +02:00
|
|
|
#ifdef DEVELHELP
|
2014-08-05 19:13:23 +02:00
|
|
|
P(name);
|
2014-10-15 00:04:58 +02:00
|
|
|
#endif
|
2016-10-24 18:36:15 +02:00
|
|
|
#if defined(DEVELHELP) || defined(SCHED_TEST_STACK) || defined(MODULE_MPU_STACK_GUARD)
|
2014-08-05 19:13:23 +02:00
|
|
|
P(stack_start);
|
2014-10-15 00:04:58 +02:00
|
|
|
#endif
|
2014-08-05 19:13:23 +02:00
|
|
|
|
|
|
|
#ifdef DEVELHELP
|
|
|
|
P(stack_size);
|
|
|
|
#endif
|
|
|
|
|
2017-11-11 20:50:55 +01:00
|
|
|
puts("SUCCESS");
|
2014-08-05 19:13:23 +02:00
|
|
|
return 0;
|
|
|
|
}
|