mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 05:09:34 +08:00
Add smp variables used by e1000 and remove unneeded ifdefs
+ added machine/smp.h as empty file + added rtems-bsd-smp.c for a few variables which were needed
This commit is contained in:
parent
7fa65cace4
commit
0f09b72726
1
Makefile
1
Makefile
@ -356,6 +356,7 @@ C_FILES += \
|
|||||||
rtemsbsd/src/rtems-bsd-jail.c \
|
rtemsbsd/src/rtems-bsd-jail.c \
|
||||||
rtemsbsd/src/rtems-bsd-shell.c \
|
rtemsbsd/src/rtems-bsd-shell.c \
|
||||||
rtemsbsd/src/rtems-bsd-syscalls.c \
|
rtemsbsd/src/rtems-bsd-syscalls.c \
|
||||||
|
rtemsbsd/src/rtems-bsd-smp.c \
|
||||||
rtemsbsd/src/rtems-bsd-malloc.c \
|
rtemsbsd/src/rtems-bsd-malloc.c \
|
||||||
rtemsbsd/src/rtems-bsd-support.c \
|
rtemsbsd/src/rtems-bsd-support.c \
|
||||||
rtemsbsd/src/rtems-bsd-bus-dma.c \
|
rtemsbsd/src/rtems-bsd-bus-dma.c \
|
||||||
|
@ -516,6 +516,7 @@ rtems_sourceFiles = [
|
|||||||
'src/rtems-bsd-jail.c',
|
'src/rtems-bsd-jail.c',
|
||||||
'src/rtems-bsd-shell.c',
|
'src/rtems-bsd-shell.c',
|
||||||
'src/rtems-bsd-syscalls.c',
|
'src/rtems-bsd-syscalls.c',
|
||||||
|
'src/rtems-bsd-smp.c',
|
||||||
#'src/rtems-bsd-socket.c',
|
#'src/rtems-bsd-socket.c',
|
||||||
#'src/rtems-bsd-mbuf.c',
|
#'src/rtems-bsd-mbuf.c',
|
||||||
'src/rtems-bsd-malloc.c',
|
'src/rtems-bsd-malloc.c',
|
||||||
@ -1880,6 +1881,7 @@ mm.addEmptyFiles(
|
|||||||
'machine/cpu.h',
|
'machine/cpu.h',
|
||||||
'machine/elf.h',
|
'machine/elf.h',
|
||||||
'machine/sf_buf.h',
|
'machine/sf_buf.h',
|
||||||
|
'machine/smp.h',
|
||||||
#'machine/vmparam.h',
|
#'machine/vmparam.h',
|
||||||
'local/opt_ntp.h',
|
'local/opt_ntp.h',
|
||||||
'local/pci_if.h',
|
'local/pci_if.h',
|
||||||
|
@ -60,10 +60,8 @@
|
|||||||
#include <freebsd/sys/taskqueue.h>
|
#include <freebsd/sys/taskqueue.h>
|
||||||
#include <freebsd/sys/eventhandler.h>
|
#include <freebsd/sys/eventhandler.h>
|
||||||
#include <freebsd/sys/pcpu.h>
|
#include <freebsd/sys/pcpu.h>
|
||||||
#ifndef __rtems__
|
|
||||||
#include <freebsd/sys/smp.h>
|
#include <freebsd/sys/smp.h>
|
||||||
#include <freebsd/machine/smp.h>
|
#include <freebsd/machine/smp.h>
|
||||||
#endif
|
|
||||||
#include <freebsd/machine/bus.h>
|
#include <freebsd/machine/bus.h>
|
||||||
#include <freebsd/machine/resource.h>
|
#include <freebsd/machine/resource.h>
|
||||||
|
|
||||||
@ -2515,13 +2513,8 @@ igb_setup_msix(struct adapter *adapter)
|
|||||||
goto msi;
|
goto msi;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __rtems__
|
|
||||||
/* Figure out a reasonable auto config value */
|
|
||||||
queues = 10; /* XXX fix me */
|
|
||||||
#else
|
|
||||||
/* Figure out a reasonable auto config value */
|
/* Figure out a reasonable auto config value */
|
||||||
queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
|
queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Manual override */
|
/* Manual override */
|
||||||
if (igb_num_queues != 0)
|
if (igb_num_queues != 0)
|
||||||
|
1
freebsd/machine/smp.h
Normal file
1
freebsd/machine/smp.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* EMPTY */
|
40
rtemsbsd/src/rtems-bsd-smp.c
Normal file
40
rtemsbsd/src/rtems-bsd-smp.c
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @ingroup rtems_bsd_rtems
|
||||||
|
*
|
||||||
|
* @brief TODO.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 1989-2012.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <freebsd/machine/rtems-bsd-config.h>
|
||||||
|
|
||||||
|
#include <freebsd/sys/types.h>
|
||||||
|
|
||||||
|
#include <freebsd/sys/smp.h>
|
||||||
|
#include <freebsd/machine/smp.h>
|
||||||
|
|
||||||
|
int mp_ncpus;
|
||||||
|
int mp_maxcpus;
|
||||||
|
|
||||||
|
static void configure(void *dummy)
|
||||||
|
{
|
||||||
|
#if defined(RTEMS_SMP)
|
||||||
|
mp_ncpus = rtems_smp_get_number_of_processors();
|
||||||
|
mp_maxcpus = rtems_configuration_smp_maximum_processors;
|
||||||
|
#else
|
||||||
|
mp_ncpus = 1;
|
||||||
|
mp_maxcpus = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX setup initialization of this */
|
Loading…
x
Reference in New Issue
Block a user