1 | RTEMS BSD USB and TCP/IP Developers Guide |
---|
2 | ========================================= |
---|
3 | Joel Sherrill <joel.sherrill@oarcorp.com> |
---|
4 | :Author Initials: JRS |
---|
5 | :toc: |
---|
6 | :icons: |
---|
7 | :numbered: |
---|
8 | :website: http://www.rtems.org/ |
---|
9 | |
---|
10 | RTEMS uses FreeBSD as the source of its TCP/IP and USB stacks. |
---|
11 | This is a developers guide which captures information on the |
---|
12 | process of merging code from FreeBSD, building this library, |
---|
13 | RTEMS specific support files, and general guidelines on what |
---|
14 | modifications to the FreeBSD source are permitted. |
---|
15 | |
---|
16 | Goals of this effort are: |
---|
17 | |
---|
18 | * Update TCP/IP and provide USB in RTEMS |
---|
19 | * Ease updating to future FreeBSD versions |
---|
20 | * Ease tracking changes in FreeBSD code |
---|
21 | * Minimize manual changes in FreeBSD code |
---|
22 | * Define stable kernel/device driver API which is implemented |
---|
23 | by both RTEMS and FreeBSD. This is the foundation of the port. |
---|
24 | |
---|
25 | We will work to push our changes upstream to the FreeBSD Project |
---|
26 | and minimize changes required at each update point. |
---|
27 | |
---|
28 | ************************************************************** |
---|
29 | This is a work in progress and is very likely to be incomplete. |
---|
30 | Please help by adding to it. |
---|
31 | ************************************************************** |
---|
32 | |
---|
33 | == Source Code Version Information |
---|
34 | |
---|
35 | * FreeBSD 8.2 SVN r222496 |
---|
36 | * RTEMS 4.11 |
---|
37 | - BSP must have support for all new BSD sys sections |
---|
38 | - It is preferable if the BSP uses linkcmds.base. |
---|
39 | - BSP must be from an architecture with Programmable Interrupt Controller |
---|
40 | interrupt model. |
---|
41 | |
---|
42 | The FreeBSD 8.2 SVN checkout will generally be referred to as the |
---|
43 | FreeBSD source in this document. An archive of the FreeBSD 8.2 SVN |
---|
44 | archive used is located at |
---|
45 | http://www.rtems.org/ftp/pub/rtems/people/joel/freebsd/ |
---|
46 | The SVN checkout command is this |
---|
47 | svn co http://svn.freebsd.org/base/releng/8.2/sys/ -r222496 freebsd-8.2 |
---|
48 | |
---|
49 | == Issues and To Do |
---|
50 | * Sebastian Huber and Joel Sherrill discussed the need for a a basic USB |
---|
51 | functionality test that is known to work on qemu pc. |
---|
52 | |
---|
53 | * Adapt generic IRQ PIC interface code to Simple Vectored Interrupt Model |
---|
54 | so that those architectures can use new TCP/IP and USB code. |
---|
55 | |
---|
56 | * freebsd-userspace/rtems/include/sys/syslog.h is a copy from the old |
---|
57 | RTEMS TCP/IP stack. For some reason, the __printflike markers do not |
---|
58 | compile in this environment. We may want to use the FreeBSD syslog.h |
---|
59 | and get this addressed. |
---|
60 | |
---|
61 | * in_cksum implementations for architectures not supported by FreeBSD. |
---|
62 | This will require figuring out where to put implementations that do |
---|
63 | not originate from FreeBSD and are populated via the script. |
---|
64 | |
---|
65 | * linker section issues: I have undefined symbols for |
---|
66 | `_bsd__start_set_sysinit_set` and `_bsd__stop_set_sysinit_set`. |
---|
67 | Is this the only type of new section magic? What about the old sysctl_set? |
---|
68 | I added this to my linkcmds. |
---|
69 | |
---|
70 | [listing] |
---|
71 | ---- |
---|
72 | /* sysinit section? */ |
---|
73 | . = ALIGN (16); |
---|
74 | _bsd__start_set_sysinit_set = .; |
---|
75 | *(set_sys_init_*); |
---|
76 | _bsd__stop_set_sysinit_set = .; |
---|
77 | |
---|
78 | ---- |
---|
79 | |
---|
80 | * Why is the interrupt server used? The BSD interrupt handlers can block on |
---|
81 | synchronization primitives like mutexes. This is in contrast to RTEMS |
---|
82 | interrupt service routines. The BSPs using the generic interrupt support must |
---|
83 | implement the `bsp_interrupt_vector_enable()` and |
---|
84 | `bsp_interrupt_vector_disable()` routines. They normally enable/disable a |
---|
85 | particular interrupt source at the interrupt controller. This can be used to |
---|
86 | implement the interrupt server. The interrupt server is a task that wakes-up |
---|
87 | in case an associated interrupt happens. The interrupt source is disabled in |
---|
88 | a generic interrupt handler that wakes-up the interrupt server task. Once the |
---|
89 | postponed interrupt processing is performed in the interrupt server the |
---|
90 | interrupt source is enabled again. |
---|
91 | |
---|
92 | * Convert all BSP linkcmds to use a linkcmds.base so the sections are |
---|
93 | easier to insert. |
---|
94 | |
---|
95 | * rtems-bsd-init-with-irq.c: |
---|
96 | rtems_bsd_initialize_with_interrupt_server() has reference to |
---|
97 | rtems_interrupt_server_initialize() and this method is unimplemented |
---|
98 | - XXX BSP implements pieces |
---|
99 | - BSPs using this software stack must support it apparently. |
---|
100 | - What about Simple Vectored architectures? |
---|
101 | |
---|
102 | * We carried over use of notepad 0 for per task information. This should |
---|
103 | be changed. |
---|
104 | |
---|
105 | * maxproc variable referenced by rtems-bsd-resource.c. What should it |
---|
106 | be set to? |
---|
107 | |
---|
108 | * ngroups_max variable referenced by rtems-bsd-prot.c. - What should |
---|
109 | it be set to? |
---|
110 | |
---|
111 | * NIC Device Drivers |
---|
112 | - Only common PCI NIC drivers have been included in the initial set. These |
---|
113 | do not include any system on chip or ISA drivers. |
---|
114 | - PCI configuration probe does not appear to happen to determine if a |
---|
115 | NIC is in I/O or memory space. We have worked around this by using a |
---|
116 | static hint to tell the fxp driver the correct mode. But this needs to |
---|
117 | be addressed. |
---|
118 | - The ISA drivers require more BSD infrastructure to be addressed. This was |
---|
119 | outside the scope of the initial porting effort. |
---|
120 | |
---|
121 | == FreeBSD Source |
---|
122 | |
---|
123 | You should be able to rely on FreebSD manual pages and documentation |
---|
124 | for details on the code itself. |
---|
125 | |
---|
126 | === Automatically Generated FreeBSD Files |
---|
127 | |
---|
128 | The FreeBSD source tarball includes a file named Makefile.rtems which |
---|
129 | has stanzas to automatically generate some files using awk. For details |
---|
130 | on this, see http://www.freebsd.org/cgi/man.cgi?query=kobj&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html |
---|
131 | |
---|
132 | XXX This needs more detail. |
---|
133 | |
---|
134 | === Rules for Modifying FreeBSD Source |
---|
135 | |
---|
136 | * Only add lines. Subtract code by added "ifndef __rtems__". This makes |
---|
137 | merging easier in the future. |
---|
138 | |
---|
139 | == libbsd Source |
---|
140 | |
---|
141 | === What is in git |
---|
142 | |
---|
143 | The git source is a self-contained kit with FreeBSD and RTEMS components |
---|
144 | pre-merged. The Makefile in this kit is automatically generated. |
---|
145 | |
---|
146 | Any changes to sources in the freebsd or contrib directories will need to |
---|
147 | be merged upstream into our master FreeBSD svn checkout. |
---|
148 | |
---|
149 | The FreeBSD sources managed in the rtems-libbsd git repository (e.g. contrib |
---|
150 | and freebsd directories) contain the "managed" version of the |
---|
151 | FreeBSD source. The FreeBSD SVN source is the "master" version. The |
---|
152 | freebsd-to-rtems.py script is used to transfer files between the two |
---|
153 | trees. In general terms, if you have modified FreeBSD (i.e. anything in the |
---|
154 | freebsd directory) in the rtems-libbsd tree, you will need to run the script |
---|
155 | in "revert" or "reverse" mode using the -R switch. This will copy the source |
---|
156 | back to your local copy of the FreeBSD source so you can run "svn diff" against |
---|
157 | the upstream FreeBSD source. If you want to transfer source files from the |
---|
158 | FreeBSD SVN checkout to the rtems-libbsd tree, then you must run the script in |
---|
159 | "forward" mode (the default). |
---|
160 | |
---|
161 | === Building rtems-libbsd source |
---|
162 | |
---|
163 | You need to configure RTEMS for the desired BSP and install it. The |
---|
164 | following is the script used to build the powerpc/psim BSP for our |
---|
165 | internal testing purposes: |
---|
166 | |
---|
167 | [listing] |
---|
168 | ---- |
---|
169 | #! /bin/sh |
---|
170 | |
---|
171 | cd ${HOME}/newbsd |
---|
172 | rm -rf b-psim |
---|
173 | mkdir b-psim |
---|
174 | cd b-psim |
---|
175 | ../git/rtems/configure --target=powerpc-rtems4.11 \ |
---|
176 | --enable-rtemsbsp=psim --disable-networking \ |
---|
177 | --enable-tests=samples \ |
---|
178 | --prefix=${HOME}/newbsd/bsp-install >c.log 2>&1 && \ |
---|
179 | make >b.log 2>&1 && \ |
---|
180 | make install >i.log 2>&1 |
---|
181 | echo $? |
---|
182 | ---- |
---|
183 | |
---|
184 | Then edit the file config.inc to set RTEMS_MAKEFILE_PATH appropriately |
---|
185 | to indicate the ${prefix}/${target}/${BSP}. Continuing on the above, |
---|
186 | the config.inc used to match the above is: |
---|
187 | |
---|
188 | [listing] |
---|
189 | ---- |
---|
190 | RTEMS_MAKEFILE_PATH = ${HOME}/newbsd/bsp-install/powerpc-rtems4.11/psim/ |
---|
191 | INSTALL_BASE = ${HOME}/newbsd/install |
---|
192 | ---- |
---|
193 | |
---|
194 | The above installs the rtems-libbsd kit into a separate place from |
---|
195 | RTEMS and the BSP. The rtems-libbsd tests are built against an installed |
---|
196 | image of the rtems-libbsd. By keeping it in a separate installation point |
---|
197 | from RTEMS itself, this makes it easier to remove a libbsd installation |
---|
198 | and have a clean test point. |
---|
199 | |
---|
200 | [listing] |
---|
201 | ---- |
---|
202 | make |
---|
203 | make install |
---|
204 | make -C testsuite |
---|
205 | ---- |
---|
206 | |
---|
207 | At this point, we expect multiple linker errors. That is what we are |
---|
208 | currently working on. |
---|
209 | |
---|
210 | === Organization |
---|
211 | |
---|
212 | The top level directory contains a few directories and files. The following |
---|
213 | are important to understand: |
---|
214 | |
---|
215 | * freebsd-to-rtems.py - script to convert to and free FreeBSD and RTEMS trees |
---|
216 | * Makefile - automatically generated |
---|
217 | * contrib/ - from FreeBSD by script. |
---|
218 | * freebsd/ - from FreeBSD by script. |
---|
219 | * rtemsbsd/ - RTEMS specific implementations of FreeBSD kernel support routines. |
---|
220 | * testsuite/ - RTEMS specific tests |
---|
221 | * libbsd.txt - Documentation in Asciidoc |
---|
222 | |
---|
223 | == Moving Code Between FreeBSD SVN and rtems-libbsd |
---|
224 | |
---|
225 | The script freebsd-to-rtems.py is used to copy code from FreeBSD to the |
---|
226 | rtems-libbsd tree and to reverse this process. This script attempts to |
---|
227 | automate this process as much as possible and performs some transformations |
---|
228 | on the FreeBSD code. Its command line arguments are shown below: |
---|
229 | |
---|
230 | [listing] |
---|
231 | ---- |
---|
232 | freebsd-to-rtems.py [args] |
---|
233 | -?|-h|--help print this and exit |
---|
234 | -d|--dry-run run program but no modifications |
---|
235 | -D|--diff provide diff of files between trees |
---|
236 | -e|--early-exit evaluate arguments, print results, and exit |
---|
237 | -m|--makefile just generate Makefile |
---|
238 | -R|--reverse default FreeBSD -> RTEMS, reverse that |
---|
239 | -r|--rtems RTEMS directory |
---|
240 | -f|--freebsd FreeBSD directory |
---|
241 | -v|--verbose enable verbose output mode |
---|
242 | ---- |
---|
243 | |
---|
244 | In its default mode of operation, freebsd-to-rtems.py is used to copy code |
---|
245 | from FreeBSD to the rtems-libbsd tree and perform transformations. In forward |
---|
246 | mode, the script may be requested to just generate the Makefile. |
---|
247 | |
---|
248 | In "reverse mode", this script undoes those transformations and copies |
---|
249 | the source code back to the FreeBSD SVN tree. This allows us to do |
---|
250 | 'svn diff', evaluate changes made by the RTEMS Project, and report changes |
---|
251 | back to FreeBSD upstream. |
---|
252 | |
---|
253 | In either mode, the script may be asked to perform a dry-run or be verbose. |
---|
254 | Also, in either mode, the script is also smart enough to avoid copying over |
---|
255 | files which have not changed. This means that the timestamps of files are |
---|
256 | not changed unless the contents change. The script will also report the |
---|
257 | number of files which changed. In verbose mode, the script will print |
---|
258 | the name of the files which are changed. |
---|
259 | |
---|
260 | The following is an example forward run with no changes. |
---|
261 | |
---|
262 | [listing] |
---|
263 | ---- |
---|
264 | $ ~/newbsd/git/libbsd-8.2/freebsd-to-rtems.py \ |
---|
265 | -r /home/joel/newbsd/git/libbsd-8.2 \ |
---|
266 | -f /home/joel/newbsd/libbsd/freebsd-8.2 -v |
---|
267 | Verbose: yes |
---|
268 | Dry Run: no |
---|
269 | Only Generate Makefile: no |
---|
270 | RTEMS Directory: /home/joel/newbsd/git/libbsd-8.2 |
---|
271 | FreeBSD Directory: /home/joel/newbsd/libbsd/freebsd-8.2 |
---|
272 | Direction: forward |
---|
273 | Generating into /home/joel/newbsd/git/libbsd-8.2 |
---|
274 | 0 files were changed. |
---|
275 | ---- |
---|
276 | |
---|
277 | The script may also be used to generate a diff in either forward or reverse |
---|
278 | direction. |
---|
279 | |
---|
280 | == Initialization of rtems-libbsd |
---|
281 | |
---|
282 | The initialization of the rtems-libbsd is based on the FreeBSD SYSINIT(9) |
---|
283 | infrastructure. The key to initializing a system is to ensure that the desired |
---|
284 | device drivers are explicitly pulled into the linked application. This plus |
---|
285 | linking against the libbsd library will pull in the necessary FreeBSD |
---|
286 | infrastructure. |
---|
287 | |
---|
288 | The FreeBSD kernel is not a library like the RTEMS kernel. It is a bunch of |
---|
289 | object files linked together. If we have a library, then creating the |
---|
290 | executable is simple. We begin with a start symbol and recursively resolve all |
---|
291 | references. With a bunch of object files linked together we need a different |
---|
292 | mechanism. Most object files don't know each other. Lets say we have a driver |
---|
293 | module. The rest of the system has no references to this driver module. The |
---|
294 | driver module needs a way to tell the rest of the system: Hey, kernel I am |
---|
295 | here, please use my services! |
---|
296 | |
---|
297 | This registration of independent components is performed by SYSINIT(9) and |
---|
298 | specializations: |
---|
299 | |
---|
300 | http://www.freebsd.org/cgi/man.cgi?query=SYSINIT |
---|
301 | |
---|
302 | The SYSINIT(9) uses some global data structures that are placed in a certain |
---|
303 | section. In the linker command file we need this: |
---|
304 | |
---|
305 | [listing] |
---|
306 | ---- |
---|
307 | .robsdsets : { |
---|
308 | _bsd__start_set_modmetadata_set = .; |
---|
309 | *(_bsd_set_modmetadata_set); |
---|
310 | _bsd__stop_set_modmetadata_set = .; |
---|
311 | _bsd__start_set_sysctl_set = .; |
---|
312 | *(_bsd_set_sysctl_set); |
---|
313 | _bsd__stop_set_sysctl_set = .; |
---|
314 | } > REGION_RODATA AT > REGION_RODATA_LOAD |
---|
315 | |
---|
316 | .rwbsdsets : { |
---|
317 | _bsd__start_set_sysinit_set = .; |
---|
318 | *(_bsd_set_sysinit_set); |
---|
319 | _bsd__stop_set_sysinit_set = .; |
---|
320 | } > REGION_DATA AT > REGION_DATA_LOAD |
---|
321 | ---- |
---|
322 | |
---|
323 | Here you can see, that these global data structures are collected into |
---|
324 | continuous memory areas. This memory area can be identified by start and stop |
---|
325 | symbols. This constructs a table of uniform items. |
---|
326 | |
---|
327 | The low level FreeBSD code calls at some time during the initialization the |
---|
328 | mi_startup() function (machine independent startup). This function will sort |
---|
329 | the SYSINIT(9) set and call handler functions which perform further |
---|
330 | initialization. The last step is the scheduler invocation. |
---|
331 | |
---|
332 | The SYSINIT(9) routines are run in mi_startup() which is called by |
---|
333 | rtems_bsd_initialize(). |
---|
334 | |
---|
335 | This is also explained in "The Design and Implementation of the FreeBSD |
---|
336 | Operating System" section 14.3 "Kernel Initialization". |
---|
337 | |
---|
338 | In RTEMS we have a library and not a bunch of object files. Thus we need a way |
---|
339 | to pull-in the desired services out of the libbsd. Here the |
---|
340 | "rtems-bsd-sysinit.h" comes into play. The SYSINIT(9) macros have been |
---|
341 | modified and extended for RTEMS in "sys/kernel.h": |
---|
342 | |
---|
343 | [listing] |
---|
344 | ---- |
---|
345 | #ifndef __rtems__ |
---|
346 | #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ |
---|
347 | static struct sysinit uniquifier ## _sys_init = { \ |
---|
348 | subsystem, \ |
---|
349 | order, \ |
---|
350 | func, \ |
---|
351 | (ident) \ |
---|
352 | }; \ |
---|
353 | DATA_SET(sysinit_set,uniquifier ## _sys_init) |
---|
354 | #else /* __rtems__ */ |
---|
355 | #define SYSINIT_ENTRY_NAME(uniquifier) \ |
---|
356 | _bsd_ ## uniquifier ## _sys_init |
---|
357 | #define SYSINIT_REFERENCE_NAME(uniquifier) \ |
---|
358 | _bsd_ ## uniquifier ## _sys_init_ref |
---|
359 | #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ |
---|
360 | struct sysinit SYSINIT_ENTRY_NAME(uniquifier) = { \ |
---|
361 | subsystem, \ |
---|
362 | order, \ |
---|
363 | func, \ |
---|
364 | (ident) \ |
---|
365 | }; \ |
---|
366 | DATA_SET(sysinit_set,SYSINIT_ENTRY_NAME(uniquifier)) |
---|
367 | #define SYSINIT_REFERENCE(uniquifier) \ |
---|
368 | extern struct sysinit SYSINIT_ENTRY_NAME(uniquifier); \ |
---|
369 | static struct sysinit const * const \ |
---|
370 | SYSINIT_REFERENCE_NAME(uniquifier) __used \ |
---|
371 | = &SYSINIT_ENTRY_NAME(uniquifier) |
---|
372 | #define SYSINIT_MODULE_REFERENCE(mod) \ |
---|
373 | SYSINIT_REFERENCE(mod ## module) |
---|
374 | #define SYSINIT_DRIVER_REFERENCE(driver, bus) \ |
---|
375 | SYSINIT_MODULE_REFERENCE(driver ## _ ## bus) |
---|
376 | #endif /* __rtems__ */ |
---|
377 | ---- |
---|
378 | |
---|
379 | Here you see that the SYSINIT(9) entries are no longer static. The |
---|
380 | *_REFERENCE() macros will create references to the corresponding modules which |
---|
381 | are later resolved by the linker. The application has to provide an object |
---|
382 | file with references to all required FreeBSD modules. |
---|
383 | |
---|
384 | The FreeBSD device model is quite elaborated (with follow-ups): |
---|
385 | |
---|
386 | http://www.freebsd.org/cgi/man.cgi?query=driver |
---|
387 | |
---|
388 | The devices form a tree with the Nexus device at a high-level. This Nexus |
---|
389 | device is architecture specific in FreeBSD. In RTEMS we have our own Nexus |
---|
390 | device, see "rtems-bsd-nexus.c". It uses a table to add child devices: |
---|
391 | |
---|
392 | [listing] |
---|
393 | ---- |
---|
394 | const char *const _bsd_nexus_devices [] = { |
---|
395 | #ifdef NEED_USB_OHCI |
---|
396 | "ohci", |
---|
397 | #endif |
---|
398 | #ifdef NEED_USB_EHCI |
---|
399 | "ehci", |
---|
400 | #endif |
---|
401 | #ifdef NEED_SDHC |
---|
402 | "sdhci", |
---|
403 | #endif |
---|
404 | NULL |
---|
405 | }; |
---|
406 | ---- |
---|
407 | |
---|
408 | This table must be provided by the application. |
---|
409 | |
---|
410 | === SYSCTL_NODE Example |
---|
411 | |
---|
412 | During development, we had an undefined reference to |
---|
413 | _bsd_sysctl__net_children that we had trouble tracking down. Thanks to |
---|
414 | Chris Johns, we located it. He explained how to read SYSCTL_NODE |
---|
415 | definitions. This line from freebsd/netinet/in_proto.c is attempting |
---|
416 | to add the "inet" node to the parent node "_net". |
---|
417 | |
---|
418 | [listing] |
---|
419 | ---- |
---|
420 | SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0, |
---|
421 | "Internet Family"); |
---|
422 | ---- |
---|
423 | |
---|
424 | Our problem was that we could not find where _bsd_sysctl__net_children |
---|
425 | was defined. Chris suggested that when in doubt compile with -save-temps |
---|
426 | and look at the preprocessed .i files. But he did not need that. He |
---|
427 | explained that this the symbol name _bsd_sysctl__net_children was |
---|
428 | automatically generated by a SYSCTL_NODE as follows: |
---|
429 | |
---|
430 | * _bsd_ - added by RTEMS modifications to SYSCTL_NODE macro |
---|
431 | * sysctl_ - boilerplace added by SYSCTL_NODE macro |
---|
432 | * "" - empty string for parent node |
---|
433 | * net - name of SYSCTL_NODE |
---|
434 | * children - added by SYSCTL macros |
---|
435 | |
---|
436 | This was all generated by a support macro declaring the node as this: |
---|
437 | |
---|
438 | [listing] |
---|
439 | ---- |
---|
440 | struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); |
---|
441 | ---- |
---|
442 | |
---|
443 | Given this information, we located this SYSCTL_NODE declaration in |
---|
444 | kern/kern_mib.c |
---|
445 | |
---|
446 | [listing] |
---|
447 | ---- |
---|
448 | SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW, 0, |
---|
449 | "High kernel, proc, limits &c"); |
---|
450 | ---- |
---|
451 | |
---|
452 | == Core FreeBSD APIs and RTEMS Replacements == |
---|
453 | |
---|
454 | === SX(9) (Shared/exclusive locks) === |
---|
455 | |
---|
456 | http://www.freebsd.org/cgi/man.cgi?query=sx |
---|
457 | |
---|
458 | Binary semaphores (this neglects the ability to allow shared access). |
---|
459 | |
---|
460 | === MUTEX(9) (Mutual exclusion) === |
---|
461 | |
---|
462 | http://www.freebsd.org/cgi/man.cgi?query=mutex |
---|
463 | |
---|
464 | Binary semaphores (not recursive mutexes are not supported this way). |
---|
465 | |
---|
466 | === RWLOCK(9) (Reader/writer lock) === |
---|
467 | |
---|
468 | http://www.freebsd.org/cgi/man.cgi?query=rwlock |
---|
469 | |
---|
470 | POSIX r/w lock. |
---|
471 | |
---|
472 | === RMLOCK(9) (Reader/writer lock optimized for mostly read access patterns) === |
---|
473 | |
---|
474 | Note: This object was implemented as a wrapper for RWLOCK in the rm_lock header file. |
---|
475 | |
---|
476 | http://www.freebsd.org/cgi/man.cgi?query=rmlock |
---|
477 | |
---|
478 | POSIX r/w lock. |
---|
479 | |
---|
480 | === CONDVAR(9) (Condition variables) === |
---|
481 | |
---|
482 | http://www.freebsd.org/cgi/man.cgi?query=condvar |
---|
483 | |
---|
484 | POSIX condition variables with modifications (hack). |
---|
485 | |
---|
486 | === CALLOUT(9) (Timer functions) === |
---|
487 | |
---|
488 | http://www.freebsd.org/cgi/man.cgi?query=callout |
---|
489 | |
---|
490 | Timer server. |
---|
491 | |
---|
492 | === TASKQUEUE(9) (Asynchronous task execution) === |
---|
493 | |
---|
494 | http://www.freebsd.org/cgi/man.cgi?query=taskqueue |
---|
495 | |
---|
496 | TBD. |
---|
497 | |
---|
498 | === KTHREAD(9), KPROC(9) (Tasks) === |
---|
499 | |
---|
500 | http://www.freebsd.org/cgi/man.cgi?query=kthread |
---|
501 | |
---|
502 | http://www.freebsd.org/cgi/man.cgi?query=kproc |
---|
503 | |
---|
504 | Tasks. |
---|
505 | |
---|
506 | === ZONE(9) (Zone allocator) === |
---|
507 | |
---|
508 | http://www.freebsd.org/cgi/man.cgi?query=zone |
---|
509 | |
---|
510 | TBD. |
---|
511 | |
---|
512 | === devfs (Device file system) === |
---|
513 | |
---|
514 | Dummy, IMFS or new implementation (currently dummy). |
---|
515 | |
---|
516 | === psignal (Signals) === |
---|
517 | |
---|
518 | TBD. Seems to be not needed. |
---|
519 | |
---|
520 | === poll, select === |
---|
521 | |
---|
522 | TBD. Seems to be not needed. |
---|
523 | |
---|
524 | === RMAN(9) (Resource management) === |
---|
525 | |
---|
526 | http://www.freebsd.org/cgi/man.cgi?query=rman |
---|
527 | |
---|
528 | TBD. Seems to be not needed. |
---|
529 | |
---|
530 | === DEVCLASS(9), DEVICE(9), DRIVER(9), MAKE_DEV(9) (Device management) === |
---|
531 | |
---|
532 | http://www.freebsd.org/cgi/man.cgi?query=devclass |
---|
533 | |
---|
534 | http://www.freebsd.org/cgi/man.cgi?query=device |
---|
535 | |
---|
536 | http://www.freebsd.org/cgi/man.cgi?query=driver |
---|
537 | |
---|
538 | http://www.freebsd.org/cgi/man.cgi?query=make_dev |
---|
539 | |
---|
540 | Use FreeBSD implementation as far as possible. FreeBSD has a nice API for |
---|
541 | dynamic device handling. It may be interesting for RTEMS to use this API |
---|
542 | internally in the future. |
---|
543 | |
---|
544 | === BUS_SPACE(9), BUS_DMA(9) (Bus and DMA access) === |
---|
545 | |
---|
546 | http://www.freebsd.org/cgi/man.cgi?query=bus_space |
---|
547 | |
---|
548 | http://www.freebsd.org/cgi/man.cgi?query=bus_dma |
---|
549 | |
---|
550 | Likely BSP dependent. A default implementation for memory mapped linear access |
---|
551 | is easy to provide. The current heap implementation supports all properties |
---|
552 | demanded by bus_dma (including the boundary constraint). |
---|
553 | |
---|
554 | == RTEMS Replacements by File Description == |
---|
555 | |
---|
556 | Note: Files with a status of USB are used by the USB test and have at least |
---|
557 | been partially tested. If they contain both USB and Nic, then they are used |
---|
558 | by both and MAY contain methods that have not been tested yet. Files that |
---|
559 | are only used by the Nic test are the most suspect. |
---|
560 | |
---|
561 | [listing] |
---|
562 | ---- |
---|
563 | rtems-libbsd File: rtems-bsd-assert.c |
---|
564 | FreeBSD File: rtems-bsd-config.h redefines BSD_ASSERT. |
---|
565 | Description: This file contains the support method rtems_bsd_assert_func(). |
---|
566 | Status: USB, Nic |
---|
567 | |
---|
568 | rtems-libbsd File: rtems-bsd-autoconf.c |
---|
569 | FreeBSD File: FreeBSD has BSP specific autoconf.c |
---|
570 | Description: This file contains configuration methods that are used to setup the system. |
---|
571 | Status: USB |
---|
572 | |
---|
573 | rtems-libbsd File: rtems-bsd-bus-dma.c |
---|
574 | FreeBSD File: FreeBSD has BSP specific busdma_machdep.c |
---|
575 | Description: |
---|
576 | Status: USB, Nic |
---|
577 | |
---|
578 | rtems-libbsd File: rtems-bsd-bus-dma-mbuf.c |
---|
579 | FreeBSD File: FreeBSD has BSP specific busdma_machdep.c |
---|
580 | Description: |
---|
581 | Status: Nic |
---|
582 | |
---|
583 | rtems-libbsd File: rtems-bsd-callout.c |
---|
584 | FreeBSD File: kern/kern_timeout.c |
---|
585 | Description: |
---|
586 | Status: USB, Nic |
---|
587 | |
---|
588 | rtems-libbsd File: rtems-bsd-cam.c |
---|
589 | FreeBSD File: cam/cam_sim.c |
---|
590 | Description: |
---|
591 | Status: USB |
---|
592 | |
---|
593 | rtems-libbsd File: rtems-bsd-condvar.c |
---|
594 | FreeBSD File: kern/kern_condvar.c |
---|
595 | Description: |
---|
596 | Status: USB |
---|
597 | |
---|
598 | rtems-libbsd File: rtems-bsd-copyinout.c |
---|
599 | FreeBSD File: bsp specific copyinout.c ) |
---|
600 | Description: Note: The FreeBSD file is split with some methods being in rtems-bsd-support |
---|
601 | Status: Nic |
---|
602 | |
---|
603 | rtems-libbsd File: rtems-bsd-delay.c |
---|
604 | FreeBSD File: bsp specific file with multiple names |
---|
605 | Description: |
---|
606 | Status: USB, Nic |
---|
607 | |
---|
608 | rtems-libbsd File: rtems-bsd-descrip.c |
---|
609 | FreeBSD File: kern/kern_descrip.c |
---|
610 | Description: |
---|
611 | Status: Nic |
---|
612 | |
---|
613 | rtems-libbsd File: rtems-bsd-generic.c |
---|
614 | FreeBSD File: kern/sys_generic.c |
---|
615 | Description: |
---|
616 | Status: Nic |
---|
617 | |
---|
618 | rtems-libbsd File: rtems-bsd-init.c |
---|
619 | FreeBSD File: N/A |
---|
620 | Description: |
---|
621 | Status: USB, Nic |
---|
622 | |
---|
623 | rtems-libbsd File: rtems-bsd-init-with-irq.c |
---|
624 | FreeBSD File: N/A |
---|
625 | Description: |
---|
626 | Status: USB, Nic |
---|
627 | |
---|
628 | rtems-libbsd File: rtems-bsd-jail.c |
---|
629 | FreeBSD File: kern/kern_jail.c |
---|
630 | Description: |
---|
631 | Status: USB, Nic |
---|
632 | |
---|
633 | rtems-libbsd File: rtems-bsd-lock.c |
---|
634 | FreeBSD File: kern/subr_lock.c |
---|
635 | Description: |
---|
636 | Status: USB, Nic |
---|
637 | |
---|
638 | rtems-libbsd File: rtems-bsd-log.c |
---|
639 | FreeBSD File: kern/subr_prf.c |
---|
640 | Description: |
---|
641 | Status: Nic |
---|
642 | |
---|
643 | rtems-libbsd File: rtems-bsd-malloc.c |
---|
644 | FreeBSD File: kern/kern_malloc.c |
---|
645 | Description: |
---|
646 | Status: USB, Nic |
---|
647 | |
---|
648 | rtems-libbsd File: rtems-bsd-mutex.c |
---|
649 | FreeBSD File: kern/kern_mutex.c |
---|
650 | Description: |
---|
651 | Status: USB, Nic |
---|
652 | |
---|
653 | rtems-libbsd File: rtems-bsd-newproc.c |
---|
654 | FreeBSD File: N/A |
---|
655 | Description: |
---|
656 | Status: Nic |
---|
657 | |
---|
658 | rtems-libbsd File: rtems-bsd-nexus.c |
---|
659 | FreeBSD File: bsp specific nexus.c |
---|
660 | Description: |
---|
661 | Status: USB |
---|
662 | |
---|
663 | rtems-libbsd File: rtems-bsd-panic.c |
---|
664 | FreeBSD File: boot/common/panic.c |
---|
665 | Description: |
---|
666 | Status: USB, Nic |
---|
667 | |
---|
668 | rtems-libbsd File: rtems-bsd-rwlock.c |
---|
669 | FreeBSD File: kern_rwlock.c |
---|
670 | Description: |
---|
671 | Status: USB, Nic |
---|
672 | |
---|
673 | rtems-libbsd File: rtems-bsd-shell.c |
---|
674 | FreeBSD File: N/A |
---|
675 | Description: |
---|
676 | Status: USB |
---|
677 | |
---|
678 | rtems-libbsd File: rtems-bsd-signal.c |
---|
679 | FreeBSD File: kern/kern_sig.c |
---|
680 | Description: |
---|
681 | Status: Nic |
---|
682 | |
---|
683 | rtems-libbsd File: rtems-bsd-smp.c |
---|
684 | FreeBSD File: N/A |
---|
685 | Description: |
---|
686 | Status: Nic |
---|
687 | |
---|
688 | rtems-libbsd File: rtems-bsd-support.c |
---|
689 | FreeBSD File: bsp specific copyinout.c |
---|
690 | Description: Note: the FreeBSD file is split with some methods being in rtems-bsd-copyinout. |
---|
691 | Status: USB, Nic |
---|
692 | |
---|
693 | rtems-libbsd File: rtems-bsd-sx.c |
---|
694 | FreeBSD File: kern/kern_sx.c |
---|
695 | Description: Status: USB, Nic |
---|
696 | |
---|
697 | rtems-libbsd File: rtems-bsd-synch.c |
---|
698 | FreeBSD File: kern/kern_synch.c |
---|
699 | Description: |
---|
700 | Status: USB, Nic |
---|
701 | |
---|
702 | rtems-libbsd File: rtems-bsd-syscalls.c |
---|
703 | FreeBSD File: User API for kern/uipc_syscalls.c |
---|
704 | Description: |
---|
705 | Status: Nic |
---|
706 | |
---|
707 | rtems-libbsd File: rtems-bsd-sysctlbyname.c |
---|
708 | FreeBSD File: User API for sysctlbyname(3) |
---|
709 | Description: |
---|
710 | Status: |
---|
711 | |
---|
712 | rtems-libbsd File: rtems-bsd-sysctl.c |
---|
713 | FreeBSD File: User API for sysctl(8) |
---|
714 | Description: |
---|
715 | Status: |
---|
716 | |
---|
717 | rtems-libbsd File: rtems-bsd-sysctlnametomib.c |
---|
718 | FreeBSD File: User API for sysctlnametomib |
---|
719 | Description: |
---|
720 | Status: |
---|
721 | |
---|
722 | rtems-libbsd File: rtems-bsd-taskqueue.c |
---|
723 | FreeBSD File: kern/subr_taskqueue.c |
---|
724 | Description: |
---|
725 | Status: Nic |
---|
726 | |
---|
727 | rtems-libbsd File: rtems-bsd-thread.c |
---|
728 | FreeBSD File: kern/kern_kthread.c |
---|
729 | Description: |
---|
730 | Status: USB, Nic |
---|
731 | |
---|
732 | rtems-libbsd File: rtems-bsd-timeout.c |
---|
733 | FreeBSD File: kern/kern_timeout.c |
---|
734 | Description: |
---|
735 | Status: Nic |
---|
736 | |
---|
737 | rtems-libbsd File: rtems-bsd-timesupport.c |
---|
738 | FreeBSD File: kern/kern_clock.c |
---|
739 | Description: |
---|
740 | Status: Nic |
---|
741 | |
---|
742 | rtems-libbsd File: rtems-bsd-vm_glue.c |
---|
743 | FreeBSD File: vm/vm_glue.c |
---|
744 | Description: |
---|
745 | Status: USB, Nic |
---|
746 | ---- |
---|
747 | |
---|
748 | == Notes by File == |
---|
749 | |
---|
750 | altq_subr.c - Arbitrary choices were made in this file that RTEMS would |
---|
751 | not support tsc frequency change. Additionally, the clock frequency |
---|
752 | for machclk_freq is always measured for RTEMS. |
---|
753 | |
---|
754 | conf.h - In order to add make_dev and destroy_dev, variables in the cdev |
---|
755 | structure that were not being used were conditionally compiled out. The |
---|
756 | capability of supporting children did not appear to be needed and was |
---|
757 | not implemented in the rtems version of these routines. |
---|
758 | |
---|
759 | == NICs Status == |
---|
760 | |
---|
761 | [listing] |
---|
762 | ---- |
---|
763 | Driver Symbol Status |
---|
764 | ====== ====== ====== |
---|
765 | RealTek _bsd_re_pcimodule_sys_init Links |
---|
766 | EtherExpress _bsd_fxp_pcimodule_sys_init Links |
---|
767 | DEC tulip _bsd_dc_pcimodule_sys_init Links |
---|
768 | Broadcom BCM57xxx _bsd_bce_pcimodule_sys_init Links |
---|
769 | Broadcom BCM4401 _bsd_bfe_pcimodule_sys_init Links |
---|
770 | Broadcom BCM570x _bsd_bge_pcimodule_sys_init Needs Symbols (A) |
---|
771 | E1000 IGB _bsd_igb_pcimodule_sys_init Links |
---|
772 | E1000 EM _bsd_em_pcimodule_sys_init Links |
---|
773 | ---- |
---|
774 | |
---|
775 | |
---|
776 | Symbols (A) |
---|
777 | pci_get_vpd_ident |
---|