mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-01 03:54:26 +08:00
Added initialization needed for Nics back in.
This commit is contained in:
parent
19955e7c29
commit
1e88db1321
@ -64,6 +64,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <freebsd/sys/sx.h>
|
#include <freebsd/sys/sx.h>
|
||||||
#include <freebsd/ddb/ddb.h>
|
#include <freebsd/ddb/ddb.h>
|
||||||
|
|
||||||
|
#ifdef __rtems__
|
||||||
|
#include <freebsd/sys/kernel.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting.");
|
MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting.");
|
||||||
|
|
||||||
struct dpcpu_free {
|
struct dpcpu_free {
|
||||||
@ -79,7 +83,6 @@ uintptr_t dpcpu_off[MAXCPU];
|
|||||||
struct pcpu *cpuid_to_pcpu[MAXCPU];
|
struct pcpu *cpuid_to_pcpu[MAXCPU];
|
||||||
struct cpuhead cpuhead = SLIST_HEAD_INITIALIZER(cpuhead);
|
struct cpuhead cpuhead = SLIST_HEAD_INITIALIZER(cpuhead);
|
||||||
|
|
||||||
#ifndef __rtems__
|
|
||||||
/*
|
/*
|
||||||
* Initialize the MI portions of a struct pcpu.
|
* Initialize the MI portions of a struct pcpu.
|
||||||
*/
|
*/
|
||||||
@ -94,7 +97,9 @@ pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
|
|||||||
pcpu->pc_cpumask = 1 << cpuid;
|
pcpu->pc_cpumask = 1 << cpuid;
|
||||||
cpuid_to_pcpu[cpuid] = pcpu;
|
cpuid_to_pcpu[cpuid] = pcpu;
|
||||||
SLIST_INSERT_HEAD(&cpuhead, pcpu, pc_allcpu);
|
SLIST_INSERT_HEAD(&cpuhead, pcpu, pc_allcpu);
|
||||||
|
#ifndef __rtems__
|
||||||
cpu_pcpu_init(pcpu, cpuid, size);
|
cpu_pcpu_init(pcpu, cpuid, size);
|
||||||
|
#endif
|
||||||
pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue;
|
pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue;
|
||||||
pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue;
|
pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue;
|
||||||
#ifdef KTR
|
#ifdef KTR
|
||||||
@ -402,4 +407,3 @@ DB_SHOW_ALL_COMMAND(pcpu, db_show_cpu_all)
|
|||||||
}
|
}
|
||||||
DB_SHOW_ALIAS(allpcpu, db_show_cpu_all);
|
DB_SHOW_ALIAS(allpcpu, db_show_cpu_all);
|
||||||
#endif
|
#endif
|
||||||
#endif /* __rtems__ */
|
|
||||||
|
@ -669,7 +669,6 @@ netisr_select_cpuid(struct netisr_proto *npp, uintptr_t source,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __rtems__
|
|
||||||
/*
|
/*
|
||||||
* Process packets associated with a workstream and protocol. For reasons of
|
* Process packets associated with a workstream and protocol. For reasons of
|
||||||
* fairness, we process up to one complete netisr queue at a time, moving the
|
* fairness, we process up to one complete netisr queue at a time, moving the
|
||||||
@ -780,7 +779,6 @@ out:
|
|||||||
netisr_pollmore();
|
netisr_pollmore();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* __rtems__ */
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
netisr_queue_workstream(struct netisr_workstream *nwsp, u_int proto,
|
netisr_queue_workstream(struct netisr_workstream *nwsp, u_int proto,
|
||||||
@ -1016,7 +1014,6 @@ netisr_dispatch(u_int proto, struct mbuf *m)
|
|||||||
return (netisr_dispatch_src(proto, 0, m));
|
return (netisr_dispatch_src(proto, 0, m));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __rtems__
|
|
||||||
#ifdef DEVICE_POLLING
|
#ifdef DEVICE_POLLING
|
||||||
/*
|
/*
|
||||||
* Kernel polling borrows a netisr thread to run interface polling in; this
|
* Kernel polling borrows a netisr thread to run interface polling in; this
|
||||||
@ -1051,12 +1048,14 @@ netisr_start_swi(u_int cpuid, struct pcpu *pc)
|
|||||||
if (error)
|
if (error)
|
||||||
panic("%s: swi_add %d", __func__, error);
|
panic("%s: swi_add %d", __func__, error);
|
||||||
pc->pc_netisr = nwsp->nws_intr_event;
|
pc->pc_netisr = nwsp->nws_intr_event;
|
||||||
|
#ifndef __rtems__
|
||||||
if (netisr_bindthreads) {
|
if (netisr_bindthreads) {
|
||||||
error = intr_event_bind(nwsp->nws_intr_event, cpuid);
|
error = intr_event_bind(nwsp->nws_intr_event, cpuid);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
printf("%s: cpu %u: intr_event_bind: %d", __func__,
|
printf("%s: cpu %u: intr_event_bind: %d", __func__,
|
||||||
cpuid, error);
|
cpuid, error);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
NETISR_WLOCK();
|
NETISR_WLOCK();
|
||||||
nws_array[nws_count] = nwsp->nws_cpu;
|
nws_array[nws_count] = nwsp->nws_cpu;
|
||||||
nws_count++;
|
nws_count++;
|
||||||
@ -1167,4 +1166,3 @@ DB_SHOW_COMMAND(netisr, db_show_netisr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* __rtems__ */
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user