From c7815abb5239b00b4a23a63676abac15e455e617 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 16 Apr 2010 22:21:09 +0000 Subject: [PATCH] Cleanup thread_entry definition a bit. Reorder members so that related ones are next to each other and move a pretty hidden define into config.h. Doesn't make a binsize difference (the comment says the order should be optimized for size). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25659 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config.h | 1 + firmware/export/thread.h | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/firmware/export/config.h b/firmware/export/config.h index 04bf15faaf..fb9381e7da 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -664,6 +664,7 @@ Lyre prototype 1 */ #else /* !BOOTLOADER */ #define HAVE_EXTENDED_MESSAGING_AND_NAME +#define HAVE_WAKEUP_EXT_CB #ifndef SIMULATOR #define HAVE_PRIORITY_SCHEDULING diff --git a/firmware/export/thread.h b/firmware/export/thread.h index a75981dcba..c61a067174 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h @@ -253,11 +253,13 @@ struct thread_entry #if NUM_CORES > 1 struct corelock *obj_cl; /* Object corelock where thead is blocked - states: STATE_BLOCKED/STATE_BLOCKED_W_TMO */ + struct corelock waiter_cl; /* Corelock for thread_wait */ + struct corelock slot_cl; /* Corelock to lock thread slot */ + unsigned char core; /* The core to which thread belongs */ #endif struct thread_entry *queue; /* List of threads waiting for thread to be removed */ #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME - #define HAVE_WAKEUP_EXT_CB void (*wakeup_ext_cb)(struct thread_entry *thread); /* Callback that performs special steps needed when being forced off of an object's wait queue that @@ -279,24 +281,17 @@ struct thread_entry base priority */ int skip_count; /* Number of times skipped if higher priority thread was running */ -#endif - uint16_t id; /* Current slot id */ - unsigned short stack_size; /* Size of stack in bytes */ -#ifdef HAVE_PRIORITY_SCHEDULING unsigned char base_priority; /* Base priority (set explicitly during creation or thread_set_priority) */ unsigned char priority; /* Scheduled priority (higher of base or all threads blocked by this one) */ #endif + uint16_t id; /* Current slot id */ + unsigned short stack_size; /* Size of stack in bytes */ unsigned char state; /* Thread slot state (STATE_*) */ #ifdef HAVE_SCHEDULER_BOOSTCTRL unsigned char cpu_boost; /* CPU frequency boost flag */ #endif -#if NUM_CORES > 1 - unsigned char core; /* The core to which thread belongs */ - struct corelock waiter_cl; /* Corelock for thread_wait */ - struct corelock slot_cl; /* Corelock to lock thread slot */ -#endif #ifdef HAVE_IO_PRIORITY unsigned char io_priority; #endif