diff options
-rw-r--r-- | freebsd/sys/kern/uipc_socket.c | 4 | ||||
-rw-r--r-- | freebsd/sys/net/if_gif.c | 4 | ||||
-rw-r--r-- | freebsd/sys/net/if_gre.c | 4 | ||||
-rw-r--r-- | freebsd/sys/net/if_stf.c | 4 | ||||
-rw-r--r-- | freebsd/sys/net/route.c | 6 | ||||
-rw-r--r-- | freebsd/sys/net/rtsock.c | 8 | ||||
-rw-r--r-- | freebsd/sys/sys/proc.h | 1 | ||||
-rw-r--r-- | libbsd.txt | 3 | ||||
-rw-r--r-- | rtemsbsd/include/machine/rtems-bsd-config.h.in | 2 | ||||
-rw-r--r-- | rtemsbsd/rtems/rtems-bsd-thread.c | 1 |
10 files changed, 35 insertions, 2 deletions
diff --git a/freebsd/sys/kern/uipc_socket.c b/freebsd/sys/kern/uipc_socket.c index fdea2601..04770f27 100644 --- a/freebsd/sys/kern/uipc_socket.c +++ b/freebsd/sys/kern/uipc_socket.c @@ -372,7 +372,11 @@ socreate(int dom, struct socket **aso, int type, int proto, so->so_cred = crhold(cred); if ((prp->pr_domain->dom_family == PF_INET) || (prp->pr_domain->dom_family == PF_ROUTE)) +#ifndef __rtems__ so->so_fibnum = td->td_proc->p_fibnum; +#else /* __rtems__ */ + so->so_fibnum = BSD_DEFAULT_FIB; +#endif /* __rtems__ */ else so->so_fibnum = 0; so->so_proto = prp; diff --git a/freebsd/sys/net/if_gif.c b/freebsd/sys/net/if_gif.c index b6c6111c..d9144419 100644 --- a/freebsd/sys/net/if_gif.c +++ b/freebsd/sys/net/if_gif.c @@ -162,7 +162,11 @@ gif_clone_create(ifc, unit, params) struct gif_softc *sc; sc = malloc(sizeof(struct gif_softc), M_GIF, M_WAITOK | M_ZERO); +#ifndef __rtems__ sc->gif_fibnum = curthread->td_proc->p_fibnum; +#else /* __rtems__ */ + sc->gif_fibnum = BSD_DEFAULT_FIB; +#endif /* __rtems__ */ GIF2IFP(sc) = if_alloc(IFT_GIF); if (GIF2IFP(sc) == NULL) { free(sc, M_GIF); diff --git a/freebsd/sys/net/if_gre.c b/freebsd/sys/net/if_gre.c index 09e53e94..09950859 100644 --- a/freebsd/sys/net/if_gre.c +++ b/freebsd/sys/net/if_gre.c @@ -205,7 +205,11 @@ gre_clone_create(ifc, unit, params) GRE2IFP(sc)->if_flags |= IFF_LINK0; sc->encap = NULL; sc->called = 0; +#ifndef __rtems__ sc->gre_fibnum = curthread->td_proc->p_fibnum; +#else /* __rtems__ */ + sc->gre_fibnum = BSD_DEFAULT_FIB; +#endif /* __rtems__ */ sc->wccp_ver = WCCP_V1; sc->key = 0; if_attach(GRE2IFP(sc)); diff --git a/freebsd/sys/net/if_stf.c b/freebsd/sys/net/if_stf.c index 104536fd..79466119 100644 --- a/freebsd/sys/net/if_stf.c +++ b/freebsd/sys/net/if_stf.c @@ -231,7 +231,11 @@ stf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) return (ENOSPC); } ifp->if_softc = sc; +#ifndef __rtems__ sc->sc_fibnum = curthread->td_proc->p_fibnum; +#else /* __rtems__ */ + sc->sc_fibnum = BSD_DEFAULT_FIB; +#endif /* __rtems__ */ /* * Set the name manually rather then using if_initname because diff --git a/freebsd/sys/net/route.c b/freebsd/sys/net/route.c index 1434b2d7..5827cc00 100644 --- a/freebsd/sys/net/route.c +++ b/freebsd/sys/net/route.c @@ -124,6 +124,7 @@ u_int tunnel_fib = 0; SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); #endif +#ifndef __rtems__ /* * handler for net.my_fibnum */ @@ -140,6 +141,7 @@ sysctl_my_fibnum(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); +#endif /* __rtems__ */ static __inline struct radix_node_head ** rt_tables_get_rnh_ptr(int table, int fam) @@ -1397,7 +1399,11 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) fibnum = 0; if (fibnum == -1) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { +#ifndef __rtems__ startfib = endfib = curthread->td_proc->p_fibnum; +#else /* __rtems__ */ + startfib = endfib = BSD_DEFAULT_FIB; +#endif /* __rtems__ */ } else { startfib = 0; endfib = rt_numfibs - 1; diff --git a/freebsd/sys/net/rtsock.c b/freebsd/sys/net/rtsock.c index 0cfc6e91..2e709f79 100644 --- a/freebsd/sys/net/rtsock.c +++ b/freebsd/sys/net/rtsock.c @@ -261,7 +261,11 @@ rts_attach(struct socket *so, int proto, struct thread *td) */ s = splnet(); so->so_pcb = (caddr_t)rp; +#ifndef __rtems__ so->so_fibnum = td->td_proc->p_fibnum; +#else /* __rtems__ */ + so->so_fibnum = BSD_DEFAULT_FIB; +#endif /* __rtems__ */ error = raw_attach(so, proto); rp = sotorawcb(so); if (error) { @@ -1648,7 +1652,11 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) * take care of routing entries */ for (error = 0; error == 0 && i <= lim; i++) { +#ifndef __rtems__ rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i); +#else /* __rtems__ */ + rnh = rt_tables_get_rnh(BSD_DEFAULT_FIB, i); +#endif /* __rtems__ */ if (rnh != NULL) { RADIX_NODE_HEAD_LOCK(rnh); error = rnh->rnh_walktree(rnh, diff --git a/freebsd/sys/sys/proc.h b/freebsd/sys/sys/proc.h index e3c0f2fd..dd8ad315 100644 --- a/freebsd/sys/sys/proc.h +++ b/freebsd/sys/sys/proc.h @@ -577,7 +577,6 @@ struct proc { #else /* __rtems__ */ struct ucred *p_ucred; /* (c) Process owner's identity. */ rtems_id p_pid; - int p_fibnum; /* in this routing domain XXX MRT */ #endif /* __rtems__ */ }; @@ -50,6 +50,9 @@ the current Git submodule commit is this * Per-CPU NETISR(9) should be enabled onece the new stack is ready for SMP. +* Multiple routing tables are not supported. Every FIB value is set to zero + (= BSD_DEFAULT_FIB). + * Sebastian Huber and Joel Sherrill discussed the need for a a basic USB functionality test that is known to work on qemu pc. diff --git a/rtemsbsd/include/machine/rtems-bsd-config.h.in b/rtemsbsd/include/machine/rtems-bsd-config.h.in index 477a2cd1..1fedcd54 100644 --- a/rtemsbsd/include/machine/rtems-bsd-config.h.in +++ b/rtemsbsd/include/machine/rtems-bsd-config.h.in @@ -136,6 +136,8 @@ void rtems_bsd_assert_func(const char *file, int line, const char *func, const c #define BSD_MAXIMUM_SLEEP_QUEUES 32 +#define BSD_DEFAULT_FIB 0 + extern rtems_chain_control rtems_bsd_lock_chain; extern rtems_chain_control rtems_bsd_mtx_chain; diff --git a/rtemsbsd/rtems/rtems-bsd-thread.c b/rtemsbsd/rtems/rtems-bsd-thread.c index 18c1ee15..45e37bbf 100644 --- a/rtemsbsd/rtems/rtems-bsd-thread.c +++ b/rtemsbsd/rtems/rtems-bsd-thread.c @@ -217,7 +217,6 @@ rtems_bsd_threads_init(void *arg __unused) FIXME_proc.p_ucred = crhold(&FIXME_ucred); FIXME_proc.p_pid = getpid(); - FIXME_proc.p_fibnum = 0; } SYSINIT(rtems_bsd_threads, SI_SUB_INTRINSIC, SI_ORDER_ANY, rtems_bsd_threads_init, NULL); |