Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DebugLib Socket lwip lwip-sys
Fork of NetworkingCoreLib by
main/lwip/arch/sys_arch.h@1:240e3322b87a, 2012-05-24 (annotated)
- Committer:
- donatien
- Date:
- Thu May 24 15:35:36 2012 +0000
- Revision:
- 1:240e3322b87a
- Parent:
- 0:013f5d54248c
+ Debug Lib
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| donatien | 0:013f5d54248c | 1 | /* sys_arch.h */ |
| donatien | 0:013f5d54248c | 2 | /* |
| donatien | 0:013f5d54248c | 3 | Copyright (C) 2012 ARM Limited. |
| donatien | 0:013f5d54248c | 4 | |
| donatien | 0:013f5d54248c | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of |
| donatien | 0:013f5d54248c | 6 | this software and associated documentation files (the "Software"), to deal in |
| donatien | 0:013f5d54248c | 7 | the Software without restriction, including without limitation the rights to |
| donatien | 0:013f5d54248c | 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
| donatien | 0:013f5d54248c | 9 | of the Software, and to permit persons to whom the Software is furnished to do |
| donatien | 0:013f5d54248c | 10 | so, subject to the following conditions: |
| donatien | 0:013f5d54248c | 11 | |
| donatien | 0:013f5d54248c | 12 | The above copyright notice and this permission notice shall be included in all |
| donatien | 0:013f5d54248c | 13 | copies or substantial portions of the Software. |
| donatien | 0:013f5d54248c | 14 | |
| donatien | 0:013f5d54248c | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| donatien | 0:013f5d54248c | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| donatien | 0:013f5d54248c | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| donatien | 0:013f5d54248c | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| donatien | 0:013f5d54248c | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| donatien | 0:013f5d54248c | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| donatien | 0:013f5d54248c | 21 | SOFTWARE. |
| donatien | 0:013f5d54248c | 22 | */ |
| donatien | 0:013f5d54248c | 23 | |
| donatien | 0:013f5d54248c | 24 | #ifndef SYS_ARCH_H_ |
| donatien | 0:013f5d54248c | 25 | #define SYS_ARCH_H_ |
| donatien | 0:013f5d54248c | 26 | |
| donatien | 0:013f5d54248c | 27 | //Architecture-specific configuration |
| donatien | 0:013f5d54248c | 28 | #define LWIP_SEMAPHORES_COUNT 8 |
| donatien | 0:013f5d54248c | 29 | #define LWIP_MUTEXES_COUNT 8 |
| donatien | 0:013f5d54248c | 30 | #define LWIP_MAILBOXES_COUNT 8 |
| donatien | 0:013f5d54248c | 31 | |
| donatien | 0:013f5d54248c | 32 | typedef u32_t sys_prot_t; |
| donatien | 0:013f5d54248c | 33 | |
| donatien | 0:013f5d54248c | 34 | struct sys_mutex |
| donatien | 0:013f5d54248c | 35 | { |
| donatien | 0:013f5d54248c | 36 | /*Mutex**/ void* pMtx; |
| donatien | 0:013f5d54248c | 37 | int valid; |
| donatien | 0:013f5d54248c | 38 | }; |
| donatien | 0:013f5d54248c | 39 | typedef struct sys_mutex sys_mutex_t; |
| donatien | 0:013f5d54248c | 40 | |
| donatien | 0:013f5d54248c | 41 | struct sys_sem |
| donatien | 0:013f5d54248c | 42 | { |
| donatien | 0:013f5d54248c | 43 | /*Semaphore**/ void* pSphre; |
| donatien | 0:013f5d54248c | 44 | int valid; |
| donatien | 0:013f5d54248c | 45 | }; |
| donatien | 0:013f5d54248c | 46 | typedef struct sys_sem sys_sem_t; |
| donatien | 0:013f5d54248c | 47 | |
| donatien | 0:013f5d54248c | 48 | #if 0 |
| donatien | 0:013f5d54248c | 49 | struct sys_mbox |
| donatien | 0:013f5d54248c | 50 | { |
| donatien | 0:013f5d54248c | 51 | /*Queue<void>**/ void* pQueue; |
| donatien | 0:013f5d54248c | 52 | int valid; |
| donatien | 0:013f5d54248c | 53 | }; |
| donatien | 0:013f5d54248c | 54 | #else |
| donatien | 0:013f5d54248c | 55 | struct sys_mbox { |
| donatien | 0:013f5d54248c | 56 | volatile int first, last; |
| donatien | 0:013f5d54248c | 57 | void * volatile msgs[8]; |
| donatien | 0:013f5d54248c | 58 | struct sys_sem not_empty; |
| donatien | 0:013f5d54248c | 59 | struct sys_sem not_full; |
| donatien | 0:013f5d54248c | 60 | struct sys_sem mutex; |
| donatien | 0:013f5d54248c | 61 | volatile int wait_send; |
| donatien | 0:013f5d54248c | 62 | volatile int valid; |
| donatien | 0:013f5d54248c | 63 | }; |
| donatien | 0:013f5d54248c | 64 | #endif |
| donatien | 0:013f5d54248c | 65 | |
| donatien | 0:013f5d54248c | 66 | |
| donatien | 0:013f5d54248c | 67 | typedef struct sys_mbox sys_mbox_t; |
| donatien | 0:013f5d54248c | 68 | |
| donatien | 0:013f5d54248c | 69 | typedef void/*struct sys_thread*/ sys_thread_t; |
| donatien | 0:013f5d54248c | 70 | |
| donatien | 0:013f5d54248c | 71 | #define SYS_MBOX_NULL NULL |
| donatien | 0:013f5d54248c | 72 | #define SYS_SEM_NULL NULL |
| donatien | 0:013f5d54248c | 73 | |
| donatien | 0:013f5d54248c | 74 | err_t sys_sem_new_mul(sys_sem_t *pSem, u8_t size, u8_t count); |
| donatien | 0:013f5d54248c | 75 | |
| donatien | 0:013f5d54248c | 76 | #endif /* SYS_ARCH_H_ */ |
