diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-10 08:57:10 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-10 08:57:10 +0000 |
commit | 8cfbd3604fac14f629244e521ad24ffa9938c790 (patch) | |
tree | 16dc096519b8b537bb7d4b73e0c97f5f33ee752b /firmware/target/arm/imx31/gigabeat-s | |
parent | 40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff) | |
download | rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.gz rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.zip |
Use cookies for thread identification instead of pointers directly which gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c b/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c index c185994bfc..81849d0852 100644 --- a/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c | |||
@@ -69,7 +69,7 @@ static const unsigned char pmic_ints_regs[2] = | |||
69 | 69 | ||
70 | #ifdef PMIC_DRIVER_CLOSE | 70 | #ifdef PMIC_DRIVER_CLOSE |
71 | static bool pmic_close = false; | 71 | static bool pmic_close = false; |
72 | static struct thread_entry *mc13783_thread_p = NULL; | 72 | static unsigned int mc13783_thread_id = 0; |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | static void mc13783_interrupt_thread(void) | 75 | static void mc13783_interrupt_thread(void) |
@@ -149,7 +149,7 @@ void mc13783_init(void) | |||
149 | MC13783_GPIO_ISR = (1ul << MC13783_GPIO_LINE); | 149 | MC13783_GPIO_ISR = (1ul << MC13783_GPIO_LINE); |
150 | 150 | ||
151 | #ifdef PMIC_DRIVER_CLOSE | 151 | #ifdef PMIC_DRIVER_CLOSE |
152 | mc13783_thread_p = | 152 | mc13783_thread_id = |
153 | #endif | 153 | #endif |
154 | create_thread(mc13783_interrupt_thread, | 154 | create_thread(mc13783_interrupt_thread, |
155 | mc13783_thread_stack, sizeof(mc13783_thread_stack), 0, | 155 | mc13783_thread_stack, sizeof(mc13783_thread_stack), 0, |
@@ -159,16 +159,16 @@ void mc13783_init(void) | |||
159 | #ifdef PMIC_DRIVER_CLOSE | 159 | #ifdef PMIC_DRIVER_CLOSE |
160 | void mc13783_close(void) | 160 | void mc13783_close(void) |
161 | { | 161 | { |
162 | struct thread_entry *thread = mc13783_thread_p; | 162 | unsigned int thread_id = mc13783_thread_p; |
163 | 163 | ||
164 | if (thread == NULL) | 164 | if (thread_id == 0) |
165 | return; | 165 | return; |
166 | 166 | ||
167 | mc13783_thread_p = NULL; | 167 | mc13783_thread_id = 0; |
168 | 168 | ||
169 | pmic_close = true; | 169 | pmic_close = true; |
170 | wakeup_signal(&mc13783_wake); | 170 | wakeup_signal(&mc13783_wake); |
171 | thread_wait(thread); | 171 | thread_wait(thread_id); |
172 | } | 172 | } |
173 | #endif /* PMIC_DRIVER_CLOSE */ | 173 | #endif /* PMIC_DRIVER_CLOSE */ |
174 | 174 | ||