mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-01 14:14:56 +00:00
Compare commits
5 commits
b2351a4ba5
...
2cb7605a24
Author | SHA1 | Date | |
---|---|---|---|
2cb7605a24 | |||
8502c68d29 | |||
5afc347944 | |||
7d37fcbf52 | |||
7e5574f9e5 |
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 ARM Ltd
|
* Copyright (c) 2024 Arm Ltd
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -27,157 +27,5 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ARM_ARCH
|
#ifndef __ARM_ARCH
|
||||||
|
#error Your compiler is too old
|
||||||
/* ACLE standardises a set of pre-defines that describe the ARM architecture.
|
|
||||||
These were mostly implemented in GCC around GCC-4.8; older versions
|
|
||||||
have no, or only partial support. To provide a level of backwards
|
|
||||||
compatibility we try to work out what the definitions should be, given
|
|
||||||
the older pre-defines that GCC did produce. This isn't complete, but
|
|
||||||
it should be enough for use by routines that depend on this header. */
|
|
||||||
|
|
||||||
/* No need to handle ARMv8, GCC had ACLE support before that. */
|
|
||||||
|
|
||||||
#define __ARM_ACLE 101
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_7__
|
|
||||||
/* The common subset of ARMv7 in all profiles. */
|
|
||||||
# define __ARM_ARCH 7
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 2
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_LDREX 7
|
|
||||||
# define __ARM_FEATURE_UNALIGNED
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__)
|
|
||||||
# define __ARM_ARCH 7
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 2
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_SIMD32
|
|
||||||
# define __ARM_FEATURE_DSP
|
|
||||||
# define __ARM_FEATURE_QBIT
|
|
||||||
# define __ARM_FEATURE_SAT
|
|
||||||
# define __ARM_FEATURE_LDREX 15
|
|
||||||
# define __ARM_FEATURE_UNALIGNED
|
|
||||||
# ifdef __ARM_ARCH_7A__
|
|
||||||
# define __ARM_ARCH_PROFILE 'A'
|
|
||||||
# else
|
|
||||||
# define __ARM_ARCH_PROFILE 'R'
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_7EM__
|
|
||||||
# define __ARM_ARCH 7
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 2
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_SIMD32
|
|
||||||
# define __ARM_FEATURE_DSP
|
|
||||||
# define __ARM_FEATURE_QBIT
|
|
||||||
# define __ARM_FEATURE_SAT
|
|
||||||
# define __ARM_FEATURE_LDREX 7
|
|
||||||
# define __ARM_FEATURE_UNALIGNED
|
|
||||||
# define __ARM_ARCH_PROFILE 'M'
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_7M__
|
|
||||||
# define __ARM_ARCH 7
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 2
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_QBIT
|
|
||||||
# define __ARM_FEATURE_SAT
|
|
||||||
# define __ARM_FEATURE_LDREX 7
|
|
||||||
# define __ARM_FEATURE_UNALIGNED
|
|
||||||
# define __ARM_ARCH_PROFILE 'M'
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_6T2__
|
|
||||||
# define __ARM_ARCH 6
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 2
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_SIMD32
|
|
||||||
# define __ARM_FEATURE_DSP
|
|
||||||
# define __ARM_FEATURE_QBIT
|
|
||||||
# define __ARM_FEATURE_SAT
|
|
||||||
# define __ARM_FEATURE_LDREX 4
|
|
||||||
# define __ARM_FEATURE_UNALIGNED
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_6M__
|
|
||||||
# define __ARM_ARCH 6
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 1
|
|
||||||
# define __ARM_ARCH_PROFILE 'M'
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) \
|
|
||||||
|| defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) \
|
|
||||||
|| defined (__ARM_ARCH_6ZK__)
|
|
||||||
# define __ARM_ARCH 6
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 1
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_SIMD32
|
|
||||||
# define __ARM_FEATURE_DSP
|
|
||||||
# define __ARM_FEATURE_QBIT
|
|
||||||
# define __ARM_FEATURE_SAT
|
|
||||||
# define __ARM_FEATURE_UNALIGNED
|
|
||||||
# ifndef __thumb__
|
|
||||||
# if defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
|
|
||||||
# define __ARM_FEATURE_LDREX 15
|
|
||||||
# else
|
|
||||||
# define __ARM_FEATURE_LDREX 4
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5E__)
|
|
||||||
# define __ARM_ARCH 5
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# ifdef __ARM_ARCH_5TE__
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 1
|
|
||||||
# endif
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# define __ARM_FEATURE_DSP
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5__)
|
|
||||||
# define __ARM_ARCH 5
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# ifdef __ARM_ARCH_5TE__
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 1
|
|
||||||
# endif
|
|
||||||
# define __ARM_FEATURE_CLZ
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_4T__
|
|
||||||
# define __ARM_ARCH 4
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# define __ARM_ARCH_ISA_THUMB 1
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_4__
|
|
||||||
# define __ARM_ARCH 4
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__)
|
|
||||||
# define __ARM_ARCH 3
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARM_ARCH_2__
|
|
||||||
# define __ARM_ARCH 2
|
|
||||||
# define __ARM_ARCH_ISA_ARM
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef __ARMEB__
|
|
||||||
# define __ARM_BIG_ENDIAN
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* If we still don't know what the target architecture is, then we're
|
|
||||||
probably not using GCC. */
|
|
||||||
# ifndef __ARM_ARCH
|
|
||||||
# error Unable to determine architecture version.
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif /* __ARM_ARCH */
|
|
||||||
|
|
|
@ -4349,9 +4349,7 @@ calculate_iaq(struct adapter *sc, struct intrs_and_queues *iaq, int itype,
|
||||||
*/
|
*/
|
||||||
do {
|
do {
|
||||||
if (iaq->nrxq > 1) {
|
if (iaq->nrxq > 1) {
|
||||||
do {
|
iaq->nrxq = rounddown_pow_of_two(iaq->nrxq - 1);
|
||||||
iaq->nrxq--;
|
|
||||||
} while (!powerof2(iaq->nrxq));
|
|
||||||
if (iaq->nnmrxq > iaq->nrxq)
|
if (iaq->nnmrxq > iaq->nrxq)
|
||||||
iaq->nnmrxq = iaq->nrxq;
|
iaq->nnmrxq = iaq->nrxq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,13 +93,9 @@ static int looutput(struct ifnet *ifp, struct mbuf *m,
|
||||||
const struct sockaddr *dst, struct route *ro);
|
const struct sockaddr *dst, struct route *ro);
|
||||||
|
|
||||||
VNET_DEFINE(struct ifnet *, loif); /* Used externally */
|
VNET_DEFINE(struct ifnet *, loif); /* Used externally */
|
||||||
|
|
||||||
#ifdef VIMAGE
|
|
||||||
VNET_DEFINE_STATIC(struct if_clone *, lo_cloner);
|
VNET_DEFINE_STATIC(struct if_clone *, lo_cloner);
|
||||||
#define V_lo_cloner VNET(lo_cloner)
|
#define V_lo_cloner VNET(lo_cloner)
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct if_clone *lo_cloner;
|
|
||||||
static const char loname[] = "lo";
|
static const char loname[] = "lo";
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -141,8 +137,6 @@ lo_clone_create(struct if_clone *ifc, char *name, size_t len,
|
||||||
ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6;
|
ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6;
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
|
bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
|
||||||
if (V_loif == NULL)
|
|
||||||
V_loif = ifp;
|
|
||||||
*ifpp = ifp;
|
*ifpp = ifp;
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -156,12 +150,9 @@ vnet_loif_init(const void *unused __unused)
|
||||||
.destroy_f = lo_clone_destroy,
|
.destroy_f = lo_clone_destroy,
|
||||||
.flags = IFC_F_AUTOUNIT,
|
.flags = IFC_F_AUTOUNIT,
|
||||||
};
|
};
|
||||||
lo_cloner = ifc_attach_cloner(loname, &req);
|
V_lo_cloner = ifc_attach_cloner(loname, &req);
|
||||||
#ifdef VIMAGE
|
|
||||||
V_lo_cloner = lo_cloner;
|
|
||||||
#endif
|
|
||||||
struct ifc_data ifd = { .unit = 0 };
|
struct ifc_data ifd = { .unit = 0 };
|
||||||
ifc_create_ifp(loname, &ifd, NULL);
|
ifc_create_ifp(loname, &ifd, &V_loif);
|
||||||
}
|
}
|
||||||
VNET_SYSINIT(vnet_loif_init, SI_SUB_PSEUDO, SI_ORDER_ANY,
|
VNET_SYSINIT(vnet_loif_init, SI_SUB_PSEUDO, SI_ORDER_ANY,
|
||||||
vnet_loif_init, NULL);
|
vnet_loif_init, NULL);
|
||||||
|
|
|
@ -180,6 +180,7 @@ static __inline void
|
||||||
sched_unpin(void)
|
sched_unpin(void)
|
||||||
{
|
{
|
||||||
atomic_interrupt_fence();
|
atomic_interrupt_fence();
|
||||||
|
MPASS(curthread->td_pinned > 0);
|
||||||
curthread->td_pinned--;
|
curthread->td_pinned--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -315,13 +315,6 @@ dmar_ir_free_irte(struct dmar_unit *unit, u_int cookie)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u_int
|
|
||||||
clp2(u_int v)
|
|
||||||
{
|
|
||||||
|
|
||||||
return (powerof2(v) ? v : 1 << fls(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
dmar_init_irt(struct dmar_unit *unit)
|
dmar_init_irt(struct dmar_unit *unit)
|
||||||
{
|
{
|
||||||
|
@ -339,7 +332,7 @@ dmar_init_irt(struct dmar_unit *unit)
|
||||||
"QI disabled, disabling interrupt remapping\n");
|
"QI disabled, disabling interrupt remapping\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
unit->irte_cnt = clp2(num_io_irqs);
|
unit->irte_cnt = roundup_pow_of_two(num_io_irqs);
|
||||||
unit->irt = kmem_alloc_contig(unit->irte_cnt * sizeof(dmar_irte_t),
|
unit->irt = kmem_alloc_contig(unit->irte_cnt * sizeof(dmar_irte_t),
|
||||||
M_ZERO | M_WAITOK, 0, iommu_high, PAGE_SIZE, 0,
|
M_ZERO | M_WAITOK, 0, iommu_high, PAGE_SIZE, 0,
|
||||||
DMAR_IS_COHERENT(unit) ?
|
DMAR_IS_COHERENT(unit) ?
|
||||||
|
|
Loading…
Reference in a new issue