2 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
20 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * This file is part of the lwIP TCP/IP stack.
30 * Author: Adam Dunkels <adam@sics.se>
35 * Copyright (c) 2007 Xilinx, Inc. All rights reserved.
38 * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
39 * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
40 * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
41 * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
42 * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
43 * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
44 * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
45 * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
46 * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
47 * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
48 * AND FITNESS FOR A PARTICULAR PURPOSE.
52 #ifndef __SYS_XILINX_ARCH_H__
53 #define __SYS_XILINX_ARCH_H__
60 #ifdef OS_IS_XILKERNEL
63 #include "semaphore.h"
64 #include "os_config.h"
66 #define SYS_MBOX_NULL NULL
67 #define SYS_SEM_NULL NULL
68 #define SYS_MBOX_SIZE 500
69 #define SYS_SEM_MAX MAX_SEM
70 #define SYS_MBOX_MAX (MAX_SEM/2)
71 #define SYS_THREAD_MAX MAX_PTHREADS
73 #define SEM_FREE 0xffffffff
74 #define TID_FREE 0xffffffff
77 struct sys_mbox_msg *next;
84 void *msgs[SYS_MBOX_SIZE];
90 typedef sem_t sys_sem_t;
93 typedef struct sys_mbox_s sys_mbox_t;
96 typedef struct sys_thread *sys_thread_t;
98 typedef u32_t sys_prot_t;
101 #ifdef OS_IS_FREERTOS
103 #include "FreeRTOS.h"
109 #define SYS_MBOX_NULL ( ( xQueueHandle ) NULL )
110 #define SYS_SEM_NULL ( ( xSemaphoreHandle ) NULL )
111 #define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE
113 typedef xSemaphoreHandle sys_sem_t;
114 typedef xSemaphoreHandle sys_mutex_t;
115 typedef xQueueHandle sys_mbox_t;
116 typedef xTaskHandle sys_thread_t;
118 typedef unsigned long sys_prot_t;
120 #define sys_mbox_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE )
121 #define sys_mbox_set_invalid( x ) ( ( *x ) = NULL )
122 #define sys_sem_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE )
123 #define sys_sem_set_invalid( x ) ( ( *x ) = NULL )
130 #endif /* __SYS_XILINX_ARCH_H__ */