Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: gecko-sdk/include/md/_scoos.h

Issue 20346: Version 1.8 of gecko-sdk. Downloaded from here:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gecko-sdk/include/md/_riscos.h ('k') | gecko-sdk/include/md/_solaris.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is the Netscape Portable Runtime (NSPR).
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #ifndef nspr_scoos5_defs_h___
39 #define nspr_scoos5_defs_h___
40
41 /*
42 * Internal configuration macros
43 */
44
45 #define PR_LINKER_ARCH "scoos5"
46 #define PR_DLL_SUFFIX ".so"
47
48 #define _PR_SI_SYSNAME "SCO"
49 #define _PR_SI_ARCHITECTURE "x86"
50 #define _PR_STACK_VMBASE 0x50000000
51
52 #define _MD_DEFAULT_STACK_SIZE 65536L
53 #define _MD_MMAP_FLAGS MAP_PRIVATE
54
55 #undef HAVE_STACK_GROWING_UP
56 #define HAVE_DLL
57 #define USE_DLFCN
58
59 #if !defined (HAVE_STRERROR)
60 #define HAVE_STRERROR
61 #endif
62
63 #ifndef HAVE_WEAK_IO_SYMBOLS
64 #define HAVE_WEAK_IO_SYMBOLS
65 #endif
66
67 #define _PR_POLL_AVAILABLE
68 #define _PR_USE_POLL
69 #define _PR_NO_LARGE_FILES
70 #define _PR_STAT_HAS_ONLY_ST_ATIME
71
72 #define NEED_STRFTIME_LOCK
73 #define NEED_TIME_R
74 #define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */
75
76 #define USE_SETJMP
77
78 #ifdef _PR_LOCAL_THREADS_ONLY
79 #include <setjmp.h>
80
81 #define _MD_GET_SP(_t) (_t)->md.jb[4]
82 #define PR_NUM_GCREGS _SIGJBLEN
83 #define PR_CONTEXT_TYPE sigjmp_buf
84
85 #define CONTEXT(_th) ((_th)->md.jb)
86
87 #define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
88 { \
89 *status = PR_TRUE; \
90 if (sigsetjmp(CONTEXT(_thread),1)) { \
91 (*_main)(); \
92 } \
93 _MD_GET_SP(_thread) = (int) ((_sp) - 64); \
94 }
95
96 #define _MD_SWITCH_CONTEXT(_thread) \
97 if (!sigsetjmp(CONTEXT(_thread), 1)) { \
98 (_thread)->md.errcode = errno; \
99 _PR_Schedule(); \
100 }
101
102 /*
103 ** Restore a thread context, saved by _MD_SWITCH_CONTEXT
104 */
105 #define _MD_RESTORE_CONTEXT(_thread) \
106 { \
107 errno = (_thread)->osErrorCode; \
108 _MD_SET_CURRENT_THREAD(_thread); \
109 siglongjmp(CONTEXT(_thread), 1); \
110 }
111
112 #endif /* _PR_LOCAL_THREADS_ONLY */
113
114 struct _MDThread {
115 jmp_buf jb;
116 int id;
117 int errcode;
118 };
119
120 struct _MDThreadStack {
121 PRInt8 notused;
122 };
123
124 struct _MDLock {
125 PRInt8 notused;
126 };
127
128 struct _MDSemaphore {
129 PRInt8 notused;
130 };
131
132 struct _MDCVar {
133 PRInt8 notused;
134 };
135
136 struct _MDSegment {
137 PRInt8 notused;
138 };
139
140 /*
141 * md-specific cpu structure field
142 */
143 #define _PR_MD_MAX_OSFD FD_SETSIZE
144
145 struct _MDCPU_Unix {
146 PRCList ioQ;
147 PRUint32 ioq_timeout;
148 PRInt32 ioq_max_osfd;
149 PRInt32 ioq_osfd_cnt;
150 #ifndef _PR_USE_POLL
151 fd_set fd_read_set, fd_write_set, fd_exception_set;
152 PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
153 fd_exception_cnt[_PR_MD_MAX_OSFD];
154 #else
155 struct pollfd *ioq_pollfds;
156 int ioq_pollfds_size;
157 #endif /* _PR_USE_POLL */
158 };
159
160 #define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
161 #define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
162 #define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
163 #define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
164 #define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
165 #define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
166 #define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
167 #define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
168 #define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
169 #define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
170 #define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
171 #define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
172 #define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
173
174 #define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
175
176 struct _MDCPU {
177 struct _MDCPU_Unix md_unix;
178 };
179
180 #define _MD_INIT_LOCKS()
181 #define _MD_NEW_LOCK(lock) PR_SUCCESS
182 #define _MD_FREE_LOCK(lock)
183 #define _MD_LOCK(lock)
184 #define _MD_UNLOCK(lock)
185 #define _MD_INIT_IO()
186 #define _MD_IOQ_LOCK()
187 #define _MD_IOQ_UNLOCK()
188
189 #define _MD_EARLY_INIT _MD_EarlyInit
190 #define _MD_FINAL_INIT _PR_UnixInit
191 #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
192 #define _MD_INIT_THREAD _MD_InitializeThread
193 #define _MD_EXIT_THREAD(thread)
194 #define _MD_SUSPEND_THREAD(thread)
195 #define _MD_RESUME_THREAD(thread)
196 #define _MD_CLEAN_THREAD(_thread)
197
198 #define _MD_GET_INTERVAL _PR_UNIX_GetInterval
199 #define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
200
201 #define _MD_SELECT _select
202 #define _MD_POLL _poll
203
204 #endif /* nspr_scoos5_defs_h___ */
OLDNEW
« no previous file with comments | « gecko-sdk/include/md/_riscos.h ('k') | gecko-sdk/include/md/_solaris.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698