MFC
This commit is contained in:
commit
f43c467a4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/random_number_generator/; revision=255094
@ -762,5 +762,7 @@ typecmd_impl(int argc, char **argv, int cmd, const char *path)
|
||||
int
|
||||
typecmd(int argc, char **argv)
|
||||
{
|
||||
if (argc > 2 && strcmp(argv[1], "--") == 0)
|
||||
argc--, argv++;
|
||||
return typecmd_impl(argc, argv, TYPECMD_TYPE, bltinlookup("PATH", 1));
|
||||
}
|
||||
|
161
bin/sh/parser.c
161
bin/sh/parser.c
@ -108,12 +108,13 @@ static int funclinno; /* line # where the current function started */
|
||||
static struct parser_temp *parser_temp;
|
||||
|
||||
|
||||
static union node *list(int, int);
|
||||
static union node *list(int);
|
||||
static union node *andor(void);
|
||||
static union node *pipeline(void);
|
||||
static union node *command(void);
|
||||
static union node *simplecmd(union node **, union node *);
|
||||
static union node *makename(void);
|
||||
static union node *makebinary(int type, union node *n1, union node *n2);
|
||||
static void parsefname(void);
|
||||
static void parseheredoc(void);
|
||||
static int peektoken(void);
|
||||
@ -121,6 +122,7 @@ static int readtoken(void);
|
||||
static int xxreadtoken(void);
|
||||
static int readtoken1(int, const char *, const char *, int);
|
||||
static int noexpand(char *);
|
||||
static void consumetoken(int);
|
||||
static void synexpect(int) __dead2;
|
||||
static void synerror(const char *) __dead2;
|
||||
static void setprompt(int);
|
||||
@ -223,18 +225,18 @@ parsecmd(int interact)
|
||||
if (t == TNL)
|
||||
return NULL;
|
||||
tokpushback++;
|
||||
return list(1, 1);
|
||||
return list(1);
|
||||
}
|
||||
|
||||
|
||||
static union node *
|
||||
list(int nlflag, int erflag)
|
||||
list(int nlflag)
|
||||
{
|
||||
union node *ntop, *n1, *n2, *n3;
|
||||
int tok;
|
||||
|
||||
checkkwd = CHKNL | CHKKWD | CHKALIAS;
|
||||
if (!nlflag && !erflag && tokendlist[peektoken()])
|
||||
if (!nlflag && tokendlist[peektoken()])
|
||||
return NULL;
|
||||
ntop = n1 = NULL;
|
||||
for (;;) {
|
||||
@ -256,17 +258,11 @@ list(int nlflag, int erflag)
|
||||
if (ntop == NULL)
|
||||
ntop = n2;
|
||||
else if (n1 == NULL) {
|
||||
n1 = (union node *)stalloc(sizeof (struct nbinary));
|
||||
n1->type = NSEMI;
|
||||
n1->nbinary.ch1 = ntop;
|
||||
n1->nbinary.ch2 = n2;
|
||||
n1 = makebinary(NSEMI, ntop, n2);
|
||||
ntop = n1;
|
||||
}
|
||||
else {
|
||||
n3 = (union node *)stalloc(sizeof (struct nbinary));
|
||||
n3->type = NSEMI;
|
||||
n3->nbinary.ch1 = n1->nbinary.ch2;
|
||||
n3->nbinary.ch2 = n2;
|
||||
n3 = makebinary(NSEMI, n1->nbinary.ch2, n2);
|
||||
n1->nbinary.ch2 = n3;
|
||||
n1 = n3;
|
||||
}
|
||||
@ -287,8 +283,7 @@ list(int nlflag, int erflag)
|
||||
tokpushback++;
|
||||
}
|
||||
checkkwd = CHKNL | CHKKWD | CHKALIAS;
|
||||
if (!nlflag && (erflag ? peektoken() == TEOF :
|
||||
tokendlist[peektoken()]))
|
||||
if (!nlflag && tokendlist[peektoken()])
|
||||
return ntop;
|
||||
break;
|
||||
case TEOF:
|
||||
@ -298,7 +293,7 @@ list(int nlflag, int erflag)
|
||||
pungetc(); /* push back EOF on input */
|
||||
return ntop;
|
||||
default:
|
||||
if (nlflag || erflag)
|
||||
if (nlflag)
|
||||
synexpect(-1);
|
||||
tokpushback++;
|
||||
return ntop;
|
||||
@ -311,10 +306,10 @@ list(int nlflag, int erflag)
|
||||
static union node *
|
||||
andor(void)
|
||||
{
|
||||
union node *n1, *n2, *n3;
|
||||
union node *n;
|
||||
int t;
|
||||
|
||||
n1 = pipeline();
|
||||
n = pipeline();
|
||||
for (;;) {
|
||||
if ((t = readtoken()) == TAND) {
|
||||
t = NAND;
|
||||
@ -322,14 +317,9 @@ andor(void)
|
||||
t = NOR;
|
||||
} else {
|
||||
tokpushback++;
|
||||
return n1;
|
||||
return n;
|
||||
}
|
||||
n2 = pipeline();
|
||||
n3 = (union node *)stalloc(sizeof (struct nbinary));
|
||||
n3->type = t;
|
||||
n3->nbinary.ch1 = n1;
|
||||
n3->nbinary.ch2 = n2;
|
||||
n1 = n3;
|
||||
n = makebinary(t, n, pipeline());
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,49 +401,39 @@ command(void)
|
||||
case TIF:
|
||||
n1 = (union node *)stalloc(sizeof (struct nif));
|
||||
n1->type = NIF;
|
||||
if ((n1->nif.test = list(0, 0)) == NULL)
|
||||
if ((n1->nif.test = list(0)) == NULL)
|
||||
synexpect(-1);
|
||||
if (readtoken() != TTHEN)
|
||||
synexpect(TTHEN);
|
||||
n1->nif.ifpart = list(0, 0);
|
||||
consumetoken(TTHEN);
|
||||
n1->nif.ifpart = list(0);
|
||||
n2 = n1;
|
||||
while (readtoken() == TELIF) {
|
||||
n2->nif.elsepart = (union node *)stalloc(sizeof (struct nif));
|
||||
n2 = n2->nif.elsepart;
|
||||
n2->type = NIF;
|
||||
if ((n2->nif.test = list(0, 0)) == NULL)
|
||||
if ((n2->nif.test = list(0)) == NULL)
|
||||
synexpect(-1);
|
||||
if (readtoken() != TTHEN)
|
||||
synexpect(TTHEN);
|
||||
n2->nif.ifpart = list(0, 0);
|
||||
consumetoken(TTHEN);
|
||||
n2->nif.ifpart = list(0);
|
||||
}
|
||||
if (lasttoken == TELSE)
|
||||
n2->nif.elsepart = list(0, 0);
|
||||
n2->nif.elsepart = list(0);
|
||||
else {
|
||||
n2->nif.elsepart = NULL;
|
||||
tokpushback++;
|
||||
}
|
||||
if (readtoken() != TFI)
|
||||
synexpect(TFI);
|
||||
consumetoken(TFI);
|
||||
checkkwd = CHKKWD | CHKALIAS;
|
||||
break;
|
||||
case TWHILE:
|
||||
case TUNTIL: {
|
||||
int got;
|
||||
n1 = (union node *)stalloc(sizeof (struct nbinary));
|
||||
n1->type = (lasttoken == TWHILE)? NWHILE : NUNTIL;
|
||||
if ((n1->nbinary.ch1 = list(0, 0)) == NULL)
|
||||
case TUNTIL:
|
||||
t = lasttoken;
|
||||
if ((n1 = list(0)) == NULL)
|
||||
synexpect(-1);
|
||||
if ((got=readtoken()) != TDO) {
|
||||
TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
synexpect(TDO);
|
||||
}
|
||||
n1->nbinary.ch2 = list(0, 0);
|
||||
if (readtoken() != TDONE)
|
||||
synexpect(TDONE);
|
||||
consumetoken(TDO);
|
||||
n1 = makebinary((t == TWHILE)? NWHILE : NUNTIL, n1, list(0));
|
||||
consumetoken(TDONE);
|
||||
checkkwd = CHKKWD | CHKALIAS;
|
||||
break;
|
||||
}
|
||||
case TFOR:
|
||||
if (readtoken() != TWORD || quoteflag || ! goodname(wordtext))
|
||||
synerror("Bad for loop variable");
|
||||
@ -465,10 +445,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
if (lasttoken == TWORD && ! quoteflag && equal(wordtext, "in")) {
|
||||
app = ≈
|
||||
while (readtoken() == TWORD) {
|
||||
n2 = (union node *)stalloc(sizeof (struct narg));
|
||||
n2->type = NARG;
|
||||
n2->narg.text = wordtext;
|
||||
n2->narg.backquote = backquotelist;
|
||||
n2 = makename();
|
||||
*app = n2;
|
||||
app = &n2->narg.next;
|
||||
}
|
||||
@ -500,21 +477,15 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
t = TEND;
|
||||
else
|
||||
synexpect(-1);
|
||||
n1->nfor.body = list(0, 0);
|
||||
if (readtoken() != t)
|
||||
synexpect(t);
|
||||
n1->nfor.body = list(0);
|
||||
consumetoken(t);
|
||||
checkkwd = CHKKWD | CHKALIAS;
|
||||
break;
|
||||
case TCASE:
|
||||
n1 = (union node *)stalloc(sizeof (struct ncase));
|
||||
n1->type = NCASE;
|
||||
if (readtoken() != TWORD)
|
||||
synexpect(TWORD);
|
||||
n1->ncase.expr = n2 = (union node *)stalloc(sizeof (struct narg));
|
||||
n2->type = NARG;
|
||||
n2->narg.text = wordtext;
|
||||
n2->narg.backquote = backquotelist;
|
||||
n2->narg.next = NULL;
|
||||
consumetoken(TWORD);
|
||||
n1->ncase.expr = makename();
|
||||
while (readtoken() == TNL);
|
||||
if (lasttoken != TWORD || ! equal(wordtext, "in"))
|
||||
synerror("expecting \"in\"");
|
||||
@ -527,10 +498,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
if (lasttoken == TLP)
|
||||
readtoken();
|
||||
for (;;) {
|
||||
*app = ap = (union node *)stalloc(sizeof (struct narg));
|
||||
ap->type = NARG;
|
||||
ap->narg.text = wordtext;
|
||||
ap->narg.backquote = backquotelist;
|
||||
*app = ap = makename();
|
||||
checkkwd = CHKNL | CHKKWD;
|
||||
if (readtoken() != TPIPE)
|
||||
break;
|
||||
@ -540,7 +508,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
ap->narg.next = NULL;
|
||||
if (lasttoken != TRP)
|
||||
synexpect(TRP);
|
||||
cp->nclist.body = list(0, 0);
|
||||
cp->nclist.body = list(0);
|
||||
|
||||
checkkwd = CHKNL | CHKKWD | CHKALIAS;
|
||||
if ((t = readtoken()) != TESAC) {
|
||||
@ -560,17 +528,15 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
case TLP:
|
||||
n1 = (union node *)stalloc(sizeof (struct nredir));
|
||||
n1->type = NSUBSHELL;
|
||||
n1->nredir.n = list(0, 0);
|
||||
n1->nredir.n = list(0);
|
||||
n1->nredir.redirect = NULL;
|
||||
if (readtoken() != TRP)
|
||||
synexpect(TRP);
|
||||
consumetoken(TRP);
|
||||
checkkwd = CHKKWD | CHKALIAS;
|
||||
is_subshell = 1;
|
||||
break;
|
||||
case TBEGIN:
|
||||
n1 = list(0, 0);
|
||||
if (readtoken() != TEND)
|
||||
synexpect(TEND);
|
||||
n1 = list(0);
|
||||
consumetoken(TEND);
|
||||
checkkwd = CHKKWD | CHKALIAS;
|
||||
break;
|
||||
/* A simple command must have at least one redirection or word. */
|
||||
@ -644,10 +610,7 @@ simplecmd(union node **rpp, union node *redir)
|
||||
for (;;) {
|
||||
checkkwd = savecheckkwd;
|
||||
if (readtoken() == TWORD) {
|
||||
n = (union node *)stalloc(sizeof (struct narg));
|
||||
n->type = NARG;
|
||||
n->narg.text = wordtext;
|
||||
n->narg.backquote = backquotelist;
|
||||
n = makename();
|
||||
*app = n;
|
||||
app = &n->narg.next;
|
||||
if (savecheckkwd != 0 && !isassignment(wordtext))
|
||||
@ -659,8 +622,7 @@ simplecmd(union node **rpp, union node *redir)
|
||||
} else if (lasttoken == TLP && app == &args->narg.next
|
||||
&& rpp == orig_rpp) {
|
||||
/* We have a function */
|
||||
if (readtoken() != TRP)
|
||||
synexpect(TRP);
|
||||
consumetoken(TRP);
|
||||
funclinno = plinno;
|
||||
/*
|
||||
* - Require plain text.
|
||||
@ -708,6 +670,18 @@ makename(void)
|
||||
return n;
|
||||
}
|
||||
|
||||
static union node *
|
||||
makebinary(int type, union node *n1, union node *n2)
|
||||
{
|
||||
union node *n;
|
||||
|
||||
n = (union node *)stalloc(sizeof (struct nbinary));
|
||||
n->type = type;
|
||||
n->nbinary.ch1 = n1;
|
||||
n->nbinary.ch2 = n2;
|
||||
return (n);
|
||||
}
|
||||
|
||||
void
|
||||
fixredir(union node *n, const char *text, int err)
|
||||
{
|
||||
@ -734,8 +708,7 @@ parsefname(void)
|
||||
{
|
||||
union node *n = redirnode;
|
||||
|
||||
if (readtoken() != TWORD)
|
||||
synexpect(-1);
|
||||
consumetoken(TWORD);
|
||||
if (n->type == NHERE) {
|
||||
struct heredoc *here = heredoc;
|
||||
struct heredoc *p;
|
||||
@ -786,11 +759,7 @@ parseheredoc(void)
|
||||
}
|
||||
readtoken1(pgetc(), here->here->type == NHERE? SQSYNTAX : DQSYNTAX,
|
||||
here->eofmark, here->striptabs);
|
||||
n = (union node *)stalloc(sizeof (struct narg));
|
||||
n->narg.type = NARG;
|
||||
n->narg.next = NULL;
|
||||
n->narg.text = wordtext;
|
||||
n->narg.backquote = backquotelist;
|
||||
n = makename();
|
||||
here->here->nhere.doc = n;
|
||||
}
|
||||
}
|
||||
@ -1090,14 +1059,14 @@ parsebackq(char *out, struct nodelist **pbqlist,
|
||||
doprompt = 0;
|
||||
}
|
||||
|
||||
n = list(0, oldstyle);
|
||||
n = list(0);
|
||||
|
||||
if (oldstyle)
|
||||
if (oldstyle) {
|
||||
if (peektoken() != TEOF)
|
||||
synexpect(-1);
|
||||
doprompt = saveprompt;
|
||||
else {
|
||||
if (readtoken() != TRP)
|
||||
synexpect(TRP);
|
||||
}
|
||||
} else
|
||||
consumetoken(TRP);
|
||||
|
||||
(*nlpp)->n = n;
|
||||
if (oldstyle) {
|
||||
@ -1880,6 +1849,14 @@ isassignment(const char *p)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
consumetoken(int token)
|
||||
{
|
||||
if (readtoken() != token)
|
||||
synexpect(token);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Called when an unexpected token is read during the parse. The argument
|
||||
* is the token that is expected, or -1 if more than one type of token can
|
||||
|
@ -715,7 +715,9 @@ static void report_failure(_Unwind_Reason_Code err, __cxa_exception *thrown_exce
|
||||
if (status == 0) { free(demangled); }
|
||||
// Print a back trace if no handler is found.
|
||||
// TODO: Make this optional
|
||||
#ifndef __arm__
|
||||
_Unwind_Backtrace(trace, 0);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
std::terminate();
|
||||
|
@ -845,21 +845,26 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
|
||||
Value *InstCombiner::SimplifyShrShlDemandedBits(Instruction *Shr,
|
||||
Instruction *Shl, APInt DemandedMask, APInt &KnownZero, APInt &KnownOne) {
|
||||
|
||||
unsigned ShlAmt = cast<ConstantInt>(Shl->getOperand(1))->getZExtValue();
|
||||
unsigned ShrAmt = cast<ConstantInt>(Shr->getOperand(1))->getZExtValue();
|
||||
const APInt &ShlOp1 = cast<ConstantInt>(Shl->getOperand(1))->getValue();
|
||||
const APInt &ShrOp1 = cast<ConstantInt>(Shr->getOperand(1))->getValue();
|
||||
if (!ShlOp1 || !ShrOp1)
|
||||
return 0; // Noop.
|
||||
|
||||
Value *VarX = Shr->getOperand(0);
|
||||
Type *Ty = VarX->getType();
|
||||
unsigned BitWidth = Ty->getIntegerBitWidth();
|
||||
if (ShlOp1.uge(BitWidth) || ShrOp1.uge(BitWidth))
|
||||
return 0; // Undef.
|
||||
|
||||
unsigned ShlAmt = ShlOp1.getZExtValue();
|
||||
unsigned ShrAmt = ShrOp1.getZExtValue();
|
||||
|
||||
KnownOne.clearAllBits();
|
||||
KnownZero = APInt::getBitsSet(KnownZero.getBitWidth(), 0, ShlAmt-1);
|
||||
KnownZero &= DemandedMask;
|
||||
|
||||
if (ShlAmt == 0 || ShrAmt == 0)
|
||||
return 0;
|
||||
|
||||
Value *VarX = Shr->getOperand(0);
|
||||
Type *Ty = VarX->getType();
|
||||
|
||||
APInt BitMask1(APInt::getAllOnesValue(Ty->getIntegerBitWidth()));
|
||||
APInt BitMask2(APInt::getAllOnesValue(Ty->getIntegerBitWidth()));
|
||||
APInt BitMask1(APInt::getAllOnesValue(BitWidth));
|
||||
APInt BitMask2(APInt::getAllOnesValue(BitWidth));
|
||||
|
||||
bool isLshr = (Shr->getOpcode() == Instruction::LShr);
|
||||
BitMask1 = isLshr ? (BitMask1.lshr(ShrAmt) << ShlAmt) :
|
||||
|
@ -153,10 +153,11 @@ SRCF+= divsi3 \
|
||||
.endif
|
||||
|
||||
# FreeBSD-specific atomic intrinsics.
|
||||
.if ${MACHINE_CPUARCH} == "arm"
|
||||
.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6"
|
||||
.PATH: ${.CURDIR}/../../sys/arm/arm
|
||||
|
||||
SRCF+= stdatomic
|
||||
CFLAGS+= -DEMIT_SYNC_ATOMICS
|
||||
.elif ${MACHINE_CPUARCH} == "mips"
|
||||
.PATH: ${.CURDIR}/../../sys/mips/mips
|
||||
|
||||
|
@ -100,6 +100,7 @@ Number of receive descriptors per ring allocated by the driver.
|
||||
The default value is 256.
|
||||
The value must be a multiple of 32, and the maximum is 2048.
|
||||
There are two rings so the actual usage is doubled.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
The following entry must be added to the VMware configuration file
|
||||
to provide the
|
||||
|
@ -1863,6 +1863,7 @@ pmap_pinit0(pmap_t pmap)
|
||||
pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys);
|
||||
pmap->pm_root.rt_root = 0;
|
||||
CPU_ZERO(&pmap->pm_active);
|
||||
CPU_ZERO(&pmap->pm_save);
|
||||
PCPU_SET(curpmap, pmap);
|
||||
TAILQ_INIT(&pmap->pm_pvchunk);
|
||||
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
|
||||
@ -5939,7 +5940,6 @@ pmap_activate(struct thread *td)
|
||||
critical_enter();
|
||||
pmap = vmspace_pmap(td->td_proc->p_vmspace);
|
||||
oldpmap = PCPU_GET(curpmap);
|
||||
CPU_ZERO(&pmap->pm_save);
|
||||
cpuid = PCPU_GET(cpuid);
|
||||
#ifdef SMP
|
||||
CPU_CLR_ATOMIC(cpuid, &oldpmap->pm_active);
|
||||
|
@ -1263,7 +1263,7 @@ initarm(struct arm_boot_params *abp)
|
||||
break;
|
||||
/*
|
||||
* Restricted region includes memory region
|
||||
* skip availble region
|
||||
* skip available region
|
||||
*/
|
||||
if ((start >= rstart) && (rend >= end)) {
|
||||
start = rend;
|
||||
|
@ -194,6 +194,7 @@ EMIT_ALL_OPS_N(1, uint8_t)
|
||||
EMIT_ALL_OPS_N(2, uint16_t)
|
||||
EMIT_ALL_OPS_N(4, uint32_t)
|
||||
EMIT_ALL_OPS_N(8, uint64_t)
|
||||
#undef EMIT_ALL_OPS_N
|
||||
|
||||
#else /* !_KERNEL */
|
||||
|
||||
@ -330,6 +331,7 @@ EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_xor, "eor")
|
||||
EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq")
|
||||
EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq")
|
||||
EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq")
|
||||
#undef EMIT_ALL_OPS_N
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
@ -337,7 +339,31 @@ EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq")
|
||||
|
||||
#endif /* __CLANG_ATOMICS || __GNUC_ATOMICS */
|
||||
|
||||
#if defined(__SYNC_ATOMICS)
|
||||
#if defined(__SYNC_ATOMICS) || defined(EMIT_SYNC_ATOMICS)
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma redefine_extname __sync_lock_test_and_set_1_c __sync_lock_test_and_set_1
|
||||
#pragma redefine_extname __sync_lock_test_and_set_2_c __sync_lock_test_and_set_2
|
||||
#pragma redefine_extname __sync_lock_test_and_set_4_c __sync_lock_test_and_set_4
|
||||
#pragma redefine_extname __sync_val_compare_and_swap_1_c __sync_val_compare_and_swap_1
|
||||
#pragma redefine_extname __sync_val_compare_and_swap_2_c __sync_val_compare_and_swap_2
|
||||
#pragma redefine_extname __sync_val_compare_and_swap_4_c __sync_val_compare_and_swap_4
|
||||
#pragma redefine_extname __sync_fetch_and_add_1_c __sync_fetch_and_add_1
|
||||
#pragma redefine_extname __sync_fetch_and_add_2_c __sync_fetch_and_add_2
|
||||
#pragma redefine_extname __sync_fetch_and_add_4_c __sync_fetch_and_add_4
|
||||
#pragma redefine_extname __sync_fetch_and_and_1_c __sync_fetch_and_and_1
|
||||
#pragma redefine_extname __sync_fetch_and_and_2_c __sync_fetch_and_and_2
|
||||
#pragma redefine_extname __sync_fetch_and_and_4_c __sync_fetch_and_and_4
|
||||
#pragma redefine_extname __sync_fetch_and_or_1_c __sync_fetch_and_or_1
|
||||
#pragma redefine_extname __sync_fetch_and_or_2_c __sync_fetch_and_or_2
|
||||
#pragma redefine_extname __sync_fetch_and_or_4_c __sync_fetch_and_or_4
|
||||
#pragma redefine_extname __sync_fetch_and_xor_1_c __sync_fetch_and_xor_1
|
||||
#pragma redefine_extname __sync_fetch_and_xor_2_c __sync_fetch_and_xor_2
|
||||
#pragma redefine_extname __sync_fetch_and_xor_4_c __sync_fetch_and_xor_4
|
||||
#pragma redefine_extname __sync_fetch_and_sub_1_c __sync_fetch_and_sub_1
|
||||
#pragma redefine_extname __sync_fetch_and_sub_2_c __sync_fetch_and_sub_2
|
||||
#pragma redefine_extname __sync_fetch_and_sub_4_c __sync_fetch_and_sub_4
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Old __sync_* API.
|
||||
@ -430,7 +456,7 @@ get_2(const reg_t *r, const uint16_t *offset_ptr)
|
||||
|
||||
#define EMIT_LOCK_TEST_AND_SET_N(N, uintN_t) \
|
||||
uintN_t \
|
||||
__sync_lock_test_and_set_##N(uintN_t *mem, uintN_t val) \
|
||||
__sync_lock_test_and_set_##N##_c(uintN_t *mem, uintN_t val) \
|
||||
{ \
|
||||
uint32_t *mem32; \
|
||||
reg_t val32, negmask, old; \
|
||||
@ -462,7 +488,7 @@ EMIT_LOCK_TEST_AND_SET_N(2, uint16_t)
|
||||
|
||||
#define EMIT_VAL_COMPARE_AND_SWAP_N(N, uintN_t) \
|
||||
uintN_t \
|
||||
__sync_val_compare_and_swap_##N(uintN_t *mem, uintN_t expected, \
|
||||
__sync_val_compare_and_swap_##N##_c(uintN_t *mem, uintN_t expected, \
|
||||
uintN_t desired) \
|
||||
{ \
|
||||
uint32_t *mem32; \
|
||||
@ -503,7 +529,7 @@ EMIT_VAL_COMPARE_AND_SWAP_N(2, uint16_t)
|
||||
|
||||
#define EMIT_ARITHMETIC_FETCH_AND_OP_N(N, uintN_t, name, op) \
|
||||
uintN_t \
|
||||
__sync_##name##_##N(uintN_t *mem, uintN_t val) \
|
||||
__sync_##name##_##N##_c(uintN_t *mem, uintN_t val) \
|
||||
{ \
|
||||
uint32_t *mem32; \
|
||||
reg_t val32, posmask, old; \
|
||||
@ -541,7 +567,7 @@ EMIT_ARITHMETIC_FETCH_AND_OP_N(2, uint16_t, fetch_and_sub, "sub")
|
||||
|
||||
#define EMIT_BITWISE_FETCH_AND_OP_N(N, uintN_t, name, op, idempotence) \
|
||||
uintN_t \
|
||||
__sync_##name##_##N(uintN_t *mem, uintN_t val) \
|
||||
__sync_##name##_##N##_c(uintN_t *mem, uintN_t val) \
|
||||
{ \
|
||||
uint32_t *mem32; \
|
||||
reg_t val32, old; \
|
||||
@ -577,7 +603,7 @@ EMIT_BITWISE_FETCH_AND_OP_N(2, uint16_t, fetch_and_xor, "eor", 0)
|
||||
*/
|
||||
|
||||
uint32_t
|
||||
__sync_lock_test_and_set_4(uint32_t *mem, uint32_t val)
|
||||
__sync_lock_test_and_set_4_c(uint32_t *mem, uint32_t val)
|
||||
{
|
||||
uint32_t old, temp;
|
||||
|
||||
@ -594,7 +620,7 @@ __sync_lock_test_and_set_4(uint32_t *mem, uint32_t val)
|
||||
}
|
||||
|
||||
uint32_t
|
||||
__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected,
|
||||
__sync_val_compare_and_swap_4_c(uint32_t *mem, uint32_t expected,
|
||||
uint32_t desired)
|
||||
{
|
||||
uint32_t old, temp;
|
||||
@ -616,7 +642,7 @@ __sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected,
|
||||
|
||||
#define EMIT_FETCH_AND_OP_4(name, op) \
|
||||
uint32_t \
|
||||
__sync_##name##_4(uint32_t *mem, uint32_t val) \
|
||||
__sync_##name##_4##_c(uint32_t *mem, uint32_t val) \
|
||||
{ \
|
||||
uint32_t old, temp1, temp2; \
|
||||
\
|
||||
@ -694,6 +720,7 @@ EMIT_ALL_OPS_N(1, uint8_t)
|
||||
EMIT_ALL_OPS_N(2, uint16_t)
|
||||
EMIT_ALL_OPS_N(4, uint32_t)
|
||||
EMIT_ALL_OPS_N(8, uint64_t)
|
||||
#undef EMIT_ALL_OPS_N
|
||||
|
||||
#else /* !_KERNEL */
|
||||
|
||||
@ -705,7 +732,7 @@ EMIT_ALL_OPS_N(8, uint64_t)
|
||||
|
||||
#define EMIT_LOCK_TEST_AND_SET_N(N, uintN_t, ldr, str) \
|
||||
uintN_t \
|
||||
__sync_lock_test_and_set_##N(uintN_t *mem, uintN_t val) \
|
||||
__sync_lock_test_and_set_##N##_c(uintN_t *mem, uintN_t val) \
|
||||
{ \
|
||||
uint32_t old, temp, ras_start; \
|
||||
\
|
||||
@ -734,7 +761,7 @@ __sync_lock_test_and_set_##N(uintN_t *mem, uintN_t val) \
|
||||
|
||||
#define EMIT_VAL_COMPARE_AND_SWAP_N(N, uintN_t, ldr, streq) \
|
||||
uintN_t \
|
||||
__sync_val_compare_and_swap_##N(uintN_t *mem, uintN_t expected, \
|
||||
__sync_val_compare_and_swap_##N##_c(uintN_t *mem, uintN_t expected, \
|
||||
uintN_t desired) \
|
||||
{ \
|
||||
uint32_t old, temp, ras_start; \
|
||||
@ -766,7 +793,7 @@ __sync_val_compare_and_swap_##N(uintN_t *mem, uintN_t expected, \
|
||||
|
||||
#define EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, name, op) \
|
||||
uintN_t \
|
||||
__sync_##name##_##N(uintN_t *mem, uintN_t val) \
|
||||
__sync_##name##_##N##_c(uintN_t *mem, uintN_t val) \
|
||||
{ \
|
||||
uint32_t old, temp, ras_start; \
|
||||
\
|
||||
@ -807,6 +834,30 @@ EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "streqb")
|
||||
EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "streqh")
|
||||
EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq")
|
||||
|
||||
#ifndef __clang__
|
||||
__strong_reference(__sync_lock_test_and_set_1_c, __sync_lock_test_and_set_1);
|
||||
__strong_reference(__sync_lock_test_and_set_2_c, __sync_lock_test_and_set_2);
|
||||
__strong_reference(__sync_lock_test_and_set_4_c, __sync_lock_test_and_set_4);
|
||||
__strong_reference(__sync_val_compare_and_swap_1_c, __sync_val_compare_and_swap_1);
|
||||
__strong_reference(__sync_val_compare_and_swap_2_c, __sync_val_compare_and_swap_2);
|
||||
__strong_reference(__sync_val_compare_and_swap_4_c, __sync_val_compare_and_swap_4);
|
||||
__strong_reference(__sync_fetch_and_add_1_c, __sync_fetch_and_add_1);
|
||||
__strong_reference(__sync_fetch_and_add_2_c, __sync_fetch_and_add_2);
|
||||
__strong_reference(__sync_fetch_and_add_4_c, __sync_fetch_and_add_4);
|
||||
__strong_reference(__sync_fetch_and_and_1_c, __sync_fetch_and_and_1);
|
||||
__strong_reference(__sync_fetch_and_and_2_c, __sync_fetch_and_and_2);
|
||||
__strong_reference(__sync_fetch_and_and_4_c, __sync_fetch_and_and_4);
|
||||
__strong_reference(__sync_fetch_and_sub_1_c, __sync_fetch_and_sub_1);
|
||||
__strong_reference(__sync_fetch_and_sub_2_c, __sync_fetch_and_sub_2);
|
||||
__strong_reference(__sync_fetch_and_sub_4_c, __sync_fetch_and_sub_4);
|
||||
__strong_reference(__sync_fetch_and_or_1_c, __sync_fetch_and_or_1);
|
||||
__strong_reference(__sync_fetch_and_or_2_c, __sync_fetch_and_or_2);
|
||||
__strong_reference(__sync_fetch_and_or_4_c, __sync_fetch_and_or_4);
|
||||
__strong_reference(__sync_fetch_and_xor_1_c, __sync_fetch_and_xor_1);
|
||||
__strong_reference(__sync_fetch_and_xor_2_c, __sync_fetch_and_xor_2);
|
||||
__strong_reference(__sync_fetch_and_xor_4_c, __sync_fetch_and_xor_4);
|
||||
#endif
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif
|
||||
|
@ -111,6 +111,7 @@ struct acpi_tz_softc {
|
||||
|
||||
struct acpi_tz_zone tz_zone; /*Thermal zone parameters*/
|
||||
int tz_validchecks;
|
||||
int tz_insane_tmp_notified;
|
||||
|
||||
/* passive cooling */
|
||||
struct proc *tz_cooling_proc;
|
||||
@ -161,6 +162,8 @@ static driver_t acpi_tz_driver = {
|
||||
sizeof(struct acpi_tz_softc),
|
||||
};
|
||||
|
||||
static char *acpi_tz_tmp_name = "_TMP";
|
||||
|
||||
static devclass_t acpi_tz_devclass;
|
||||
DRIVER_MODULE(acpi_tz, acpi, acpi_tz_driver, acpi_tz_devclass, 0, 0);
|
||||
MODULE_DEPEND(acpi_tz, acpi, 1, 1, 1);
|
||||
@ -456,12 +459,11 @@ acpi_tz_get_temperature(struct acpi_tz_softc *sc)
|
||||
{
|
||||
int temp;
|
||||
ACPI_STATUS status;
|
||||
static char *tmp_name = "_TMP";
|
||||
|
||||
ACPI_FUNCTION_NAME ("acpi_tz_get_temperature");
|
||||
|
||||
/* Evaluate the thermal zone's _TMP method. */
|
||||
status = acpi_GetInteger(sc->tz_handle, tmp_name, &temp);
|
||||
status = acpi_GetInteger(sc->tz_handle, acpi_tz_tmp_name, &temp);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
|
||||
"error fetching current temperature -- %s\n",
|
||||
@ -470,7 +472,7 @@ acpi_tz_get_temperature(struct acpi_tz_softc *sc)
|
||||
}
|
||||
|
||||
/* Check it for validity. */
|
||||
acpi_tz_sanity(sc, &temp, tmp_name);
|
||||
acpi_tz_sanity(sc, &temp, acpi_tz_tmp_name);
|
||||
if (temp == -1)
|
||||
return (FALSE);
|
||||
|
||||
@ -696,10 +698,29 @@ static void
|
||||
acpi_tz_sanity(struct acpi_tz_softc *sc, int *val, char *what)
|
||||
{
|
||||
if (*val != -1 && (*val < TZ_ZEROC || *val > TZ_ZEROC + 2000)) {
|
||||
device_printf(sc->tz_dev, "%s value is absurd, ignored (%d.%dC)\n",
|
||||
what, TZ_KELVTOC(*val));
|
||||
/*
|
||||
* If the value we are checking is _TMP, warn the user only
|
||||
* once. This avoids spamming messages if, for instance, the
|
||||
* sensor is broken and always returns an invalid temperature.
|
||||
*
|
||||
* This is only done for _TMP; other values always emit a
|
||||
* warning.
|
||||
*/
|
||||
if (what != acpi_tz_tmp_name || !sc->tz_insane_tmp_notified) {
|
||||
device_printf(sc->tz_dev, "%s value is absurd, ignored (%d.%dC)\n",
|
||||
what, TZ_KELVTOC(*val));
|
||||
|
||||
/* Don't warn the user again if the read value doesn't improve. */
|
||||
if (what == acpi_tz_tmp_name)
|
||||
sc->tz_insane_tmp_notified = 1;
|
||||
}
|
||||
*val = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* This value is correct. Warn if it's incorrect again. */
|
||||
if (what == acpi_tz_tmp_name)
|
||||
sc->tz_insane_tmp_notified = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -826,7 +826,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
|
||||
vm_object_pip_add(sc->object, 1);
|
||||
for (i = bp->bio_offset / PAGE_SIZE; i <= lastp; i++) {
|
||||
len = ((i == lastp) ? lastend : PAGE_SIZE) - offs;
|
||||
m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL);
|
||||
m = vm_page_grab(sc->object, i, VM_ALLOC_SYSTEM);
|
||||
if (bp->bio_cmd == BIO_READ) {
|
||||
if (m->valid == VM_PAGE_BITS_ALL)
|
||||
rv = VM_PAGER_OK;
|
||||
|
@ -465,7 +465,7 @@ ns8250_bus_attach(struct uart_softc *sc)
|
||||
* accidental manner as before. More analysis is warranted, but
|
||||
* at least now we fixed a known regression.
|
||||
*/
|
||||
DELAY(150);
|
||||
DELAY(200);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -515,11 +515,13 @@ vendor USR 0x0baf U.S. Robotics
|
||||
vendor AMBIT 0x0bb2 Ambit Microsystems
|
||||
vendor HTC 0x0bb4 HTC
|
||||
vendor REALTEK 0x0bda Realtek
|
||||
vendor ERICSSON2 0x0bdb Ericsson
|
||||
vendor MEI 0x0bed MEI
|
||||
vendor ADDONICS2 0x0bf6 Addonics Technology
|
||||
vendor FSC 0x0bf8 Fujitsu Siemens Computers
|
||||
vendor AGATE 0x0c08 Agate Technologies
|
||||
vendor DMI 0x0c0b DMI
|
||||
vendor CANYON 0x0c10 Canyon
|
||||
vendor ICOM 0x0c26 Icom Inc.
|
||||
vendor GNOTOMETRICS 0x0c33 GN Otometrics
|
||||
vendor CHICONY2 0x0c45 Chicony
|
||||
|
@ -65,5 +65,6 @@ device loop
|
||||
device ether
|
||||
device le
|
||||
device miibus
|
||||
device bpf
|
||||
device md
|
||||
device uart
|
||||
|
@ -31,6 +31,8 @@ makeoptions MODULES_OVERRIDE=""
|
||||
options TICK_USE_YAMON_FREQ=defined
|
||||
#options TICK_USE_MALTA_RTC=defined
|
||||
|
||||
makeoptions KERNLOADADDR=0xffffffff80100000
|
||||
|
||||
include "../malta/std.malta"
|
||||
|
||||
hints "MALTA.hints" #Default places to look for devices.
|
||||
@ -66,4 +68,5 @@ device ether
|
||||
device le
|
||||
device miibus
|
||||
device md
|
||||
device bpf
|
||||
device uart
|
||||
|
68
sys/mips/conf/PICOSTATION_M2HP
Normal file
68
sys/mips/conf/PICOSTATION_M2HP
Normal file
@ -0,0 +1,68 @@
|
||||
#
|
||||
# Specific board setup for the Picostation M2 HP board.
|
||||
#
|
||||
# This board has the following hardware:
|
||||
#
|
||||
# + AR7241 CPU SoC
|
||||
# + AR9287 Wifi
|
||||
# + Integrated switch (XXX speed?)
|
||||
# + 8MB flash
|
||||
# + 32MB RAM
|
||||
# + uboot environment
|
||||
|
||||
# $FreeBSD$
|
||||
|
||||
include "AR724X_BASE"
|
||||
ident "PICOSTATION_M2HP"
|
||||
hints "PICOSTATION_M2HP.hints"
|
||||
|
||||
options AR71XX_REALMEM=32*1024*1024
|
||||
|
||||
options AR71XX_ENV_UBOOT
|
||||
|
||||
# Limit inlines
|
||||
makeoptions INLINE_LIMIT=768
|
||||
|
||||
# We bite the performance overhead for now; the kernel won't
|
||||
# fit if the mutexes are inlined.
|
||||
options MUTEX_NOINLINE
|
||||
options RWLOCK_NOINLINE
|
||||
options SX_NOINLINE
|
||||
|
||||
# There's no need to enable swapping on this platform.
|
||||
options NO_SWAPPING
|
||||
|
||||
# For DOS - enable if required
|
||||
# options MSDOSFS
|
||||
|
||||
# uncompress - to boot read-only lzma natively from flash
|
||||
device geom_uncompress
|
||||
options GEOM_UNCOMPRESS
|
||||
options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\"
|
||||
|
||||
# Not enough space for these..
|
||||
nooptions INVARIANTS
|
||||
nooptions INVARIANT_SUPPORT
|
||||
nooptions WITNESS
|
||||
nooptions WITNESS_SKIPSPIN
|
||||
nooptions DEBUG_REDZONE
|
||||
nooptions DEBUG_MEMGUARD
|
||||
|
||||
# Used for the static uboot partition map
|
||||
device geom_map
|
||||
|
||||
# Options needed for the EEPROM based calibration/PCI configuration data.
|
||||
options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash
|
||||
options ATH_EEPROM_FIRMWARE # Use EEPROM from flash
|
||||
device firmware # Used by the above
|
||||
|
||||
# Options required for miiproxy and mdiobus
|
||||
options ARGE_MDIO # Export an MDIO bus separate from arge
|
||||
device miiproxy # MDIO bus <-> MII PHY rendezvous
|
||||
|
||||
device etherswitch
|
||||
device arswitch
|
||||
|
||||
# Enable GPIO
|
||||
device gpio
|
||||
device gpioled
|
103
sys/mips/conf/PICOSTATION_M2HP.hints
Normal file
103
sys/mips/conf/PICOSTATION_M2HP.hints
Normal file
@ -0,0 +1,103 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# arge1 MDIO bus
|
||||
hint.argemdio.0.at="nexus0"
|
||||
hint.argemdio.0.maddr=0x1a000000
|
||||
hint.argemdio.0.msize=0x1000
|
||||
hint.argemdio.0.order=0
|
||||
|
||||
# Override MAC Address with the one on EEPROM
|
||||
hint.arge.0.eeprommac=0x1fff0000
|
||||
|
||||
# arge0: dedicated switch port; RMII; dedicated PHY 4 on switch, connected
|
||||
# via internal switch MDIO bus.
|
||||
hint.arge.0.media=100 # Map to 100/full
|
||||
hint.arge.0.fduplex=1 #
|
||||
hint.arge.0.phymask=0x10 # PHY4
|
||||
hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus
|
||||
|
||||
# arge1: nail to 1000/full, RMII - connected to the switch
|
||||
hint.arge.1.media=1000 # Map to 1000/full
|
||||
hint.arge.1.fduplex=1 #
|
||||
hint.arge.1.phymask=0x0 # no directly mapped PHYs
|
||||
|
||||
#
|
||||
# AR7240 switch config
|
||||
#
|
||||
hint.arswitch.0.at="mdio0"
|
||||
hint.arswitch.0.is_7240=1 # We need to be explicitly told this
|
||||
hint.arswitch.0.numphys=4 # 4 active switch PHYs (PHY 0 -> 3)
|
||||
hint.arswitch.0.phy4cpu=1 # Yes, PHY 4 == dedicated PHY
|
||||
hint.arswitch.0.is_rgmii=0 # No, not RGMII
|
||||
hint.arswitch.0.is_gmii=0 # No, not GMII
|
||||
|
||||
# ath0 hint - pcie slot 0
|
||||
hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000
|
||||
hint.pcib.0.bus.0.0.0.ath_fixup_size=4096
|
||||
|
||||
# ath
|
||||
hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware"
|
||||
|
||||
# GPIO pins
|
||||
# Pin 0: red led (sig1)
|
||||
# Pin 1: yellow led (sig2)
|
||||
# Pin 11: green len (sig3)
|
||||
# Pin 7: green len (sig4)
|
||||
# Pin 12: Reset switch
|
||||
hint.gpio.0.pinmask=0x1883
|
||||
|
||||
# Signal leds
|
||||
hint.gpioled.0.at="gpiobus0"
|
||||
hint.gpioled.0.name="sig1"
|
||||
hint.gpioled.0.pins=0x0001 # pin 0
|
||||
hint.gpioled.1.at="gpiobus0"
|
||||
hint.gpioled.1.name="sig2"
|
||||
hint.gpioled.1.pins=0x0002 # pin 1
|
||||
hint.gpioled.2.at="gpiobus0"
|
||||
hint.gpioled.2.name="sig3"
|
||||
hint.gpioled.2.pins=0x0800 # pin 11
|
||||
hint.gpioled.3.at="gpiobus0"
|
||||
hint.gpioled.3.name="sig4"
|
||||
hint.gpioled.3.pins=0x0080 # pin 7
|
||||
|
||||
# GEOM_MAP
|
||||
#
|
||||
# Picostation M2 HP
|
||||
#
|
||||
# mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),1024k(kernel),6528k(rootfs),256k(cfg),64k(EEPROM)
|
||||
|
||||
hint.map.0.at="flash/spi0"
|
||||
hint.map.0.start=0x00000000
|
||||
hint.map.0.end=0x00040000 # 256k u-boot
|
||||
hint.map.0.name="u-boot"
|
||||
hint.map.0.readonly=1
|
||||
|
||||
hint.map.1.at="flash/spi0"
|
||||
hint.map.1.start=0x00040000
|
||||
hint.map.1.end=0x00050000 # 64k u-boot-env
|
||||
hint.map.1.name="u-boot-env"
|
||||
hint.map.1.readonly=1
|
||||
|
||||
hint.map.2.at="flash/spi0"
|
||||
hint.map.2.start=0x00050000
|
||||
hint.map.2.end=0x00130000 # 896k kernel
|
||||
hint.map.2.name="kernel"
|
||||
hint.map.2.readonly=1
|
||||
|
||||
hint.map.3.at="flash/spi0"
|
||||
hint.map.3.start=0x130000
|
||||
hint.map.3.end=0x007b0000 # 6656k rootfs
|
||||
hint.map.3.name="rootfs"
|
||||
hint.map.3.readonly=0
|
||||
|
||||
hint.map.4.at="flash/spi0"
|
||||
hint.map.4.start=0x007b0000
|
||||
hint.map.4.end=0x007f0000 # 256k cfg
|
||||
hint.map.4.name="cfg"
|
||||
hint.map.4.readonly=0
|
||||
|
||||
hint.map.5.at="flash/spi0"
|
||||
hint.map.5.start=0x007f0000
|
||||
hint.map.5.end=0x00800000 # 64k EEPROM
|
||||
hint.map.5.name="eeprom"
|
||||
hint.map.5.readonly=1
|
@ -1,6 +1,7 @@
|
||||
# $FreeBSD$
|
||||
mips/malta/gt.c standard
|
||||
mips/malta/gt_pci.c standard
|
||||
mips/malta/gt_pci_bus_space.c standard
|
||||
mips/malta/obio.c optional uart
|
||||
mips/malta/uart_cpu_maltausart.c optional uart
|
||||
mips/malta/uart_bus_maltausart.c optional uart
|
||||
|
@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <dev/pci/pcib_private.h>
|
||||
#include "pcib_if.h"
|
||||
|
||||
#include <mips/malta/gt_pci_bus_space.h>
|
||||
|
||||
#define ICU_LEN 16 /* number of ISA IRQs */
|
||||
|
||||
@ -635,7 +636,6 @@ gt_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
struct gt_pci_softc *sc = device_get_softc(bus);
|
||||
struct resource *rv = NULL;
|
||||
struct rman *rm;
|
||||
bus_space_tag_t bt = 0;
|
||||
bus_space_handle_t bh = 0;
|
||||
|
||||
switch (type) {
|
||||
@ -644,12 +644,10 @@ gt_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
break;
|
||||
case SYS_RES_MEMORY:
|
||||
rm = &sc->sc_mem_rman;
|
||||
bt = sc->sc_st;
|
||||
bh = sc->sc_mem;
|
||||
break;
|
||||
case SYS_RES_IOPORT:
|
||||
rm = &sc->sc_io_rman;
|
||||
bt = sc->sc_st;
|
||||
bh = sc->sc_io;
|
||||
break;
|
||||
default:
|
||||
@ -663,7 +661,7 @@ gt_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
if (type != SYS_RES_IRQ) {
|
||||
bh += (rman_get_start(rv));
|
||||
|
||||
rman_set_bustag(rv, bt);
|
||||
rman_set_bustag(rv, gt_pci_bus_space);
|
||||
rman_set_bushandle(rv, bh);
|
||||
if (flags & RF_ACTIVE) {
|
||||
if (bus_activate_resource(child, type, *rid, rv)) {
|
||||
|
409
sys/mips/malta/gt_pci_bus_space.c
Normal file
409
sys/mips/malta/gt_pci_bus_space.c
Normal file
@ -0,0 +1,409 @@
|
||||
/* $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $ */
|
||||
/*-
|
||||
* $Id: bus.h,v 1.6 2007/08/09 11:23:32 katta Exp $
|
||||
*
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
|
||||
* NASA Ames Research Center.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Charles M. Hannum. All rights reserved.
|
||||
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Christopher G. Demetriou
|
||||
* for the NetBSD Project.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* from: src/sys/alpha/include/bus.h,v 1.5 1999/08/28 00:38:40 peter
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/endian.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/ktr.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/vm_extern.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/cache.h>
|
||||
#include <mips/malta/gt_pci_bus_space.h>
|
||||
|
||||
static bs_r_2_proto(gt_pci);
|
||||
static bs_r_4_proto(gt_pci);
|
||||
static bs_w_2_proto(gt_pci);
|
||||
static bs_w_4_proto(gt_pci);
|
||||
static bs_rm_2_proto(gt_pci);
|
||||
static bs_rm_4_proto(gt_pci);
|
||||
static bs_wm_2_proto(gt_pci);
|
||||
static bs_wm_4_proto(gt_pci);
|
||||
static bs_rr_2_proto(gt_pci);
|
||||
static bs_rr_4_proto(gt_pci);
|
||||
static bs_wr_2_proto(gt_pci);
|
||||
static bs_wr_4_proto(gt_pci);
|
||||
static bs_sm_2_proto(gt_pci);
|
||||
static bs_sm_4_proto(gt_pci);
|
||||
static bs_sr_2_proto(gt_pci);
|
||||
static bs_sr_4_proto(gt_pci);
|
||||
|
||||
static struct bus_space gt_pci_space = {
|
||||
/* cookie */
|
||||
.bs_cookie = (void *) 0,
|
||||
|
||||
/* mapping/unmapping */
|
||||
.bs_map = generic_bs_map,
|
||||
.bs_unmap = generic_bs_unmap,
|
||||
.bs_subregion = generic_bs_subregion,
|
||||
|
||||
/* allocation/deallocation */
|
||||
.bs_alloc = generic_bs_alloc,
|
||||
.bs_free = generic_bs_free,
|
||||
|
||||
/* barrier */
|
||||
.bs_barrier = generic_bs_barrier,
|
||||
|
||||
/* read (single) */
|
||||
.bs_r_1 = generic_bs_r_1,
|
||||
.bs_r_2 = gt_pci_bs_r_2,
|
||||
.bs_r_4 = gt_pci_bs_r_4,
|
||||
.bs_r_8 = NULL,
|
||||
|
||||
/* read multiple */
|
||||
.bs_rm_1 = generic_bs_rm_1,
|
||||
.bs_rm_2 = gt_pci_bs_rm_2,
|
||||
.bs_rm_4 = gt_pci_bs_rm_4,
|
||||
.bs_rm_8 = NULL,
|
||||
|
||||
/* read region */
|
||||
.bs_rr_1 = generic_bs_rr_1,
|
||||
.bs_rr_2 = gt_pci_bs_rr_2,
|
||||
.bs_rr_4 = gt_pci_bs_rr_4,
|
||||
.bs_rr_8 = NULL,
|
||||
|
||||
/* write (single) */
|
||||
.bs_w_1 = generic_bs_w_1,
|
||||
.bs_w_2 = gt_pci_bs_w_2,
|
||||
.bs_w_4 = gt_pci_bs_w_4,
|
||||
.bs_w_8 = NULL,
|
||||
|
||||
/* write multiple */
|
||||
.bs_wm_1 = generic_bs_wm_1,
|
||||
.bs_wm_2 = gt_pci_bs_wm_2,
|
||||
.bs_wm_4 = gt_pci_bs_wm_4,
|
||||
.bs_wm_8 = NULL,
|
||||
|
||||
/* write region */
|
||||
.bs_wr_1 = generic_bs_wr_1,
|
||||
.bs_wr_2 = gt_pci_bs_wr_2,
|
||||
.bs_wr_4 = gt_pci_bs_wr_4,
|
||||
.bs_wr_8 = NULL,
|
||||
|
||||
/* set multiple */
|
||||
.bs_sm_1 = generic_bs_sm_1,
|
||||
.bs_sm_2 = gt_pci_bs_sm_2,
|
||||
.bs_sm_4 = gt_pci_bs_sm_4,
|
||||
.bs_sm_8 = NULL,
|
||||
|
||||
/* set region */
|
||||
.bs_sr_1 = generic_bs_sr_1,
|
||||
.bs_sr_2 = gt_pci_bs_sr_2,
|
||||
.bs_sr_4 = gt_pci_bs_sr_4,
|
||||
.bs_sr_8 = NULL,
|
||||
|
||||
/* copy */
|
||||
.bs_c_1 = generic_bs_c_1,
|
||||
.bs_c_2 = generic_bs_c_2,
|
||||
.bs_c_4 = generic_bs_c_4,
|
||||
.bs_c_8 = NULL,
|
||||
|
||||
/* read (single) stream */
|
||||
.bs_r_1_s = generic_bs_r_1,
|
||||
.bs_r_2_s = generic_bs_r_2,
|
||||
.bs_r_4_s = generic_bs_r_4,
|
||||
.bs_r_8_s = NULL,
|
||||
|
||||
/* read multiple stream */
|
||||
.bs_rm_1_s = generic_bs_rm_1,
|
||||
.bs_rm_2_s = generic_bs_rm_2,
|
||||
.bs_rm_4_s = generic_bs_rm_4,
|
||||
.bs_rm_8_s = NULL,
|
||||
|
||||
/* read region stream */
|
||||
.bs_rr_1_s = generic_bs_rr_1,
|
||||
.bs_rr_2_s = generic_bs_rr_2,
|
||||
.bs_rr_4_s = generic_bs_rr_4,
|
||||
.bs_rr_8_s = NULL,
|
||||
|
||||
/* write (single) stream */
|
||||
.bs_w_1_s = generic_bs_w_1,
|
||||
.bs_w_2_s = generic_bs_w_2,
|
||||
.bs_w_4_s = generic_bs_w_4,
|
||||
.bs_w_8_s = NULL,
|
||||
|
||||
/* write multiple stream */
|
||||
.bs_wm_1_s = generic_bs_wm_1,
|
||||
.bs_wm_2_s = generic_bs_wm_2,
|
||||
.bs_wm_4_s = generic_bs_wm_4,
|
||||
.bs_wm_8_s = NULL,
|
||||
|
||||
/* write region stream */
|
||||
.bs_wr_1_s = generic_bs_wr_1,
|
||||
.bs_wr_2_s = generic_bs_wr_2,
|
||||
.bs_wr_4_s = generic_bs_wr_4,
|
||||
.bs_wr_8_s = NULL,
|
||||
};
|
||||
|
||||
#define rd16(a) le16toh(readw(a))
|
||||
#define rd32(a) le32toh(readl(a))
|
||||
#define wr16(a, v) writew(a, htole16(v))
|
||||
#define wr32(a, v) writel(a, htole32(v))
|
||||
|
||||
/* generic bus_space tag */
|
||||
bus_space_tag_t gt_pci_bus_space = >_pci_space;
|
||||
|
||||
uint16_t
|
||||
gt_pci_bs_r_2(void *t, bus_space_handle_t handle,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return (rd16(handle + offset));
|
||||
}
|
||||
|
||||
uint32_t
|
||||
gt_pci_bs_r_4(void *t, bus_space_handle_t handle,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return (rd32(handle + offset));
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_rm_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint16_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--)
|
||||
*addr++ = rd16(baddr);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_rm_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint32_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--)
|
||||
*addr++ = rd32(baddr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read `count' 2 or 4 byte quantities from bus space
|
||||
* described by tag/handle and starting at `offset' and copy into
|
||||
* buffer provided.
|
||||
*/
|
||||
void
|
||||
gt_pci_bs_rr_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint16_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--) {
|
||||
*addr++ = rd16(baddr);
|
||||
baddr += 2;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_rr_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint32_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--) {
|
||||
*addr++ = rd32(baddr);
|
||||
baddr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the 2 or 4 byte value `value' to bus space
|
||||
* described by tag/handle/offset.
|
||||
*/
|
||||
void
|
||||
gt_pci_bs_w_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint16_t value)
|
||||
{
|
||||
|
||||
wr16(bsh + offset, value);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_w_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint32_t value)
|
||||
{
|
||||
|
||||
wr32(bsh + offset, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write `count' 2 or 4 byte quantities from the buffer
|
||||
* provided to bus space described by tag/handle/offset.
|
||||
*/
|
||||
void
|
||||
gt_pci_bs_wm_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const uint16_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--)
|
||||
wr16(baddr, *addr++);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_wm_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const uint32_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--)
|
||||
wr32(baddr, *addr++);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write `count' 2 or 4 byte quantities from the buffer provided
|
||||
* to bus space described by tag/handle starting at `offset'.
|
||||
*/
|
||||
void
|
||||
gt_pci_bs_wr_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const uint16_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--) {
|
||||
wr16(baddr, *addr++);
|
||||
baddr += 2;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_wr_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const uint32_t *addr, size_t count)
|
||||
{
|
||||
bus_addr_t baddr = bsh + offset;
|
||||
|
||||
while (count--) {
|
||||
wr32(baddr, *addr++);
|
||||
baddr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the 2 or 4 byte value `val' to bus space described
|
||||
* by tag/handle/offset `count' times.
|
||||
*/
|
||||
void
|
||||
gt_pci_bs_sm_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint16_t value, size_t count)
|
||||
{
|
||||
bus_addr_t addr = bsh + offset;
|
||||
|
||||
while (count--)
|
||||
wr16(addr, value);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_sm_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint32_t value, size_t count)
|
||||
{
|
||||
bus_addr_t addr = bsh + offset;
|
||||
|
||||
while (count--)
|
||||
wr32(addr, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write `count' 2 or 4 byte value `val' to bus space described
|
||||
* by tag/handle starting at `offset'.
|
||||
*/
|
||||
void
|
||||
gt_pci_bs_sr_2(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint16_t value, size_t count)
|
||||
{
|
||||
bus_addr_t addr = bsh + offset;
|
||||
|
||||
for (; count != 0; count--, addr += 2)
|
||||
wr16(addr, value);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pci_bs_sr_4(void *t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, uint32_t value, size_t count)
|
||||
{
|
||||
bus_addr_t addr = bsh + offset;
|
||||
|
||||
for (; count != 0; count--, addr += 4)
|
||||
wr32(addr, value);
|
||||
}
|
36
sys/mips/malta/gt_pci_bus_space.h
Normal file
36
sys/mips/malta/gt_pci_bus_space.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*-
|
||||
* Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice unmodified, this list of conditions, and the following
|
||||
* disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __GT_PCI_BUS_SPACEH__
|
||||
#define __GT_PCI_BUS_SPACEH__
|
||||
|
||||
extern bus_space_tag_t gt_pci_bus_space;
|
||||
|
||||
#endif /* __GT_PCI_BUS_SPACEH__ */
|
@ -269,8 +269,8 @@ platform_start(__register_t a0, __register_t a1, __register_t a2,
|
||||
vm_offset_t kernend;
|
||||
uint64_t platform_counter_freq;
|
||||
int argc = a0;
|
||||
char **argv = (char **)a1;
|
||||
char **envp = (char **)a2;
|
||||
int32_t *argv = (int32_t*)a1;
|
||||
int32_t *envp = (int32_t*)a2;
|
||||
unsigned int memsize = a3;
|
||||
int i;
|
||||
|
||||
@ -289,15 +289,20 @@ platform_start(__register_t a0, __register_t a1, __register_t a2,
|
||||
printf("entry: platform_start()\n");
|
||||
|
||||
bootverbose = 1;
|
||||
/*
|
||||
* YAMON uses 32bit pointers to strings so
|
||||
* convert them to proper type manually
|
||||
*/
|
||||
if (bootverbose) {
|
||||
printf("cmd line: ");
|
||||
for (i = 0; i < argc; i++)
|
||||
printf("%s ", argv[i]);
|
||||
printf("%s ", (char*)(intptr_t)argv[i]);
|
||||
printf("\n");
|
||||
|
||||
printf("envp:\n");
|
||||
for (i = 0; envp[i]; i += 2)
|
||||
printf("\t%s = %s\n", envp[i], envp[i+1]);
|
||||
printf("\t%s = %s\n", (char*)(intptr_t)envp[i],
|
||||
(char*)(intptr_t)envp[i+1]);
|
||||
|
||||
printf("memsize = %08x\n", memsize);
|
||||
}
|
||||
|
@ -437,6 +437,66 @@ static const STRUCT_USB_HOST_ID ubt_devs[] =
|
||||
USB_IFACE_CLASS(UICLASS_VENDOR),
|
||||
USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
|
||||
USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
|
||||
|
||||
/* Apple-specific (Broadcom) devices */
|
||||
{ USB_VENDOR(USB_VENDOR_APPLE),
|
||||
USB_IFACE_CLASS(UICLASS_VENDOR),
|
||||
USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
|
||||
USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
|
||||
|
||||
/* Foxconn - Hon Hai */
|
||||
{ USB_VENDOR(USB_VENDOR_FOXCONN),
|
||||
USB_IFACE_CLASS(UICLASS_VENDOR),
|
||||
USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
|
||||
USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
|
||||
|
||||
/* MediaTek MT76x0E */
|
||||
{ USB_VPI(USB_VENDOR_MEDIATEK, 0x763f, 0) },
|
||||
|
||||
/* Broadcom SoftSailing reporting vendor specific */
|
||||
{ USB_VPI(USB_VENDOR_BROADCOM, 0x21e1, 0) },
|
||||
|
||||
/* Apple MacBookPro 7,1 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x8213, 0) },
|
||||
|
||||
/* Apple iMac11,1 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x8215, 0) },
|
||||
|
||||
/* Apple MacBookPro6,2 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x8218, 0) },
|
||||
|
||||
/* Apple MacBookAir3,1, MacBookAir3,2 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x821b, 0) },
|
||||
|
||||
/* Apple MacBookAir4,1 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x821f, 0) },
|
||||
|
||||
/* MacBookAir6,1 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x828f, 0) },
|
||||
|
||||
/* Apple MacBookPro8,2 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x821a, 0) },
|
||||
|
||||
/* Apple MacMini5,1 */
|
||||
{ USB_VPI(USB_VENDOR_APPLE, 0x8281, 0) },
|
||||
|
||||
/* Bluetooth Ultraport Module from IBM */
|
||||
{ USB_VPI(USB_VENDOR_TDK, 0x030a, 0) },
|
||||
|
||||
/* ALPS Modules with non-standard ID */
|
||||
{ USB_VPI(USB_VENDOR_ALPS, 0x3001, 0) },
|
||||
{ USB_VPI(USB_VENDOR_ALPS, 0x3002, 0) },
|
||||
|
||||
{ USB_VPI(USB_VENDOR_ERICSSON2, 0x1002, 0) },
|
||||
|
||||
/* Canyon CN-BTU1 with HID interfaces */
|
||||
{ USB_VPI(USB_VENDOR_CANYON, 0x0000, 0) },
|
||||
|
||||
/* Broadcom BCM20702A0 */
|
||||
{ USB_VPI(USB_VENDOR_ASUS, 0x17b5, 0) },
|
||||
{ USB_VPI(USB_VENDOR_LITEON, 0x2003, 0) },
|
||||
{ USB_VPI(USB_VENDOR_FOXCONN, 0xe042, 0) },
|
||||
{ USB_VPI(USB_VENDOR_DELL, 0x8197, 0) },
|
||||
};
|
||||
|
||||
/*
|
||||
|
285
sys/sys/sysctl.h
285
sys/sys/sysctl.h
@ -48,7 +48,7 @@ struct thread;
|
||||
* respective subsystem header files.
|
||||
*/
|
||||
|
||||
#define CTL_MAXNAME 24 /* largest number of components supported */
|
||||
#define CTL_MAXNAME 24 /* largest number of components supported */
|
||||
|
||||
/*
|
||||
* Each subsystem defined by sysctl defines a list of variables
|
||||
@ -59,10 +59,10 @@ struct thread;
|
||||
*/
|
||||
struct ctlname {
|
||||
char *ctl_name; /* subsystem name */
|
||||
int ctl_type; /* type of name */
|
||||
int ctl_type; /* type of name */
|
||||
};
|
||||
|
||||
#define CTLTYPE 0xf /* Mask for the type */
|
||||
#define CTLTYPE 0xf /* mask for the type */
|
||||
#define CTLTYPE_NODE 1 /* name is a node */
|
||||
#define CTLTYPE_INT 2 /* name describes an integer */
|
||||
#define CTLTYPE_STRING 3 /* name describes a string */
|
||||
@ -74,35 +74,35 @@ struct ctlname {
|
||||
#define CTLTYPE_ULONG 8 /* name describes an unsigned long */
|
||||
#define CTLTYPE_U64 9 /* name describes an unsigned 64-bit number */
|
||||
|
||||
#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
|
||||
#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
|
||||
#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
|
||||
#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
|
||||
#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
|
||||
#define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */
|
||||
#define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */
|
||||
#define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */
|
||||
#define CTLMASK_SECURE 0x00F00000 /* Secure level */
|
||||
#define CTLFLAG_TUN 0x00080000 /* Tunable variable */
|
||||
#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
|
||||
#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
|
||||
#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
|
||||
#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
|
||||
#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
|
||||
#define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */
|
||||
#define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */
|
||||
#define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */
|
||||
#define CTLMASK_SECURE 0x00F00000 /* Secure level */
|
||||
#define CTLFLAG_TUN 0x00080000 /* Tunable variable */
|
||||
#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN)
|
||||
#define CTLFLAG_RWTUN (CTLFLAG_RW|CTLFLAG_TUN)
|
||||
#define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */
|
||||
#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */
|
||||
#define CTLFLAG_DYING 0x00010000 /* oid is being removed */
|
||||
#define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */
|
||||
#define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */
|
||||
#define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */
|
||||
#define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR)
|
||||
#define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */
|
||||
#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */
|
||||
#define CTLFLAG_DYING 0x00010000 /* Oid is being removed */
|
||||
#define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */
|
||||
#define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */
|
||||
#define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */
|
||||
#define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR)
|
||||
|
||||
/*
|
||||
* Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1.
|
||||
* Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1.
|
||||
*
|
||||
* Secure when the securelevel is raised to at least N.
|
||||
*/
|
||||
#define CTLSHIFT_SECURE 20
|
||||
#define CTLFLAG_SECURE1 (CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE))
|
||||
#define CTLFLAG_SECURE2 (CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE))
|
||||
#define CTLFLAG_SECURE3 (CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE))
|
||||
#define CTLSHIFT_SECURE 20
|
||||
#define CTLFLAG_SECURE1 (CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE))
|
||||
#define CTLFLAG_SECURE2 (CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE))
|
||||
#define CTLFLAG_SECURE3 (CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE))
|
||||
|
||||
/*
|
||||
* USE THIS instead of a hardwired number from the categories below
|
||||
@ -110,19 +110,19 @@ struct ctlname {
|
||||
* technology. This is the way nearly all new sysctl variables should
|
||||
* be implemented.
|
||||
* e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
|
||||
*/
|
||||
#define OID_AUTO (-1)
|
||||
*/
|
||||
#define OID_AUTO (-1)
|
||||
|
||||
/*
|
||||
* The starting number for dynamically-assigned entries. WARNING!
|
||||
* ALL static sysctl entries should have numbers LESS than this!
|
||||
*/
|
||||
#define CTL_AUTO_START 0x100
|
||||
#define CTL_AUTO_START 0x100
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/linker_set.h>
|
||||
|
||||
#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \
|
||||
#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \
|
||||
intptr_t arg2, struct sysctl_req *req
|
||||
|
||||
/* definitions for sysctl_req 'lock' member */
|
||||
@ -130,8 +130,8 @@ struct ctlname {
|
||||
#define REQ_WIRED 2
|
||||
|
||||
/* definitions for sysctl_req 'flags' member */
|
||||
#if defined(__amd64__) || defined(__ia64__) || defined(__powerpc64__) || \
|
||||
(defined(__mips__) && defined(__mips_n64))
|
||||
#if defined(__amd64__) || defined(__ia64__) || defined(__powerpc64__) ||\
|
||||
(defined(__mips__) && defined(__mips_n64))
|
||||
#define SCTL_MASK32 1 /* 32 bit emulation */
|
||||
#endif
|
||||
|
||||
@ -141,17 +141,17 @@ struct ctlname {
|
||||
*/
|
||||
struct sysctl_req {
|
||||
struct thread *td; /* used for access checking */
|
||||
int lock; /* wiring state */
|
||||
int lock; /* wiring state */
|
||||
void *oldptr;
|
||||
size_t oldlen;
|
||||
size_t oldidx;
|
||||
size_t oldlen;
|
||||
size_t oldidx;
|
||||
int (*oldfunc)(struct sysctl_req *, const void *, size_t);
|
||||
void *newptr;
|
||||
size_t newlen;
|
||||
size_t newidx;
|
||||
size_t newlen;
|
||||
size_t newidx;
|
||||
int (*newfunc)(struct sysctl_req *, void *, size_t);
|
||||
size_t validlen;
|
||||
int flags;
|
||||
size_t validlen;
|
||||
int flags;
|
||||
};
|
||||
|
||||
SLIST_HEAD(sysctl_oid_list, sysctl_oid);
|
||||
@ -163,20 +163,20 @@ SLIST_HEAD(sysctl_oid_list, sysctl_oid);
|
||||
struct sysctl_oid {
|
||||
struct sysctl_oid_list *oid_parent;
|
||||
SLIST_ENTRY(sysctl_oid) oid_link;
|
||||
int oid_number;
|
||||
u_int oid_kind;
|
||||
int oid_number;
|
||||
u_int oid_kind;
|
||||
void *oid_arg1;
|
||||
intptr_t oid_arg2;
|
||||
intptr_t oid_arg2;
|
||||
const char *oid_name;
|
||||
int (*oid_handler)(SYSCTL_HANDLER_ARGS);
|
||||
int (*oid_handler)(SYSCTL_HANDLER_ARGS);
|
||||
const char *oid_fmt;
|
||||
int oid_refcnt;
|
||||
u_int oid_running;
|
||||
int oid_refcnt;
|
||||
u_int oid_running;
|
||||
const char *oid_descr;
|
||||
};
|
||||
|
||||
#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
|
||||
#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l)
|
||||
#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
|
||||
#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l)
|
||||
|
||||
int sysctl_handle_int(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS);
|
||||
@ -197,18 +197,16 @@ void sysctl_register_oid(struct sysctl_oid *oidp);
|
||||
void sysctl_unregister_oid(struct sysctl_oid *oidp);
|
||||
|
||||
/* Declare a static oid to allow child oids to be added to it. */
|
||||
#define SYSCTL_DECL(name) \
|
||||
#define SYSCTL_DECL(name) \
|
||||
extern struct sysctl_oid_list sysctl_##name##_children
|
||||
|
||||
/* Hide these in macros */
|
||||
#define SYSCTL_CHILDREN(oid_ptr) (struct sysctl_oid_list *) \
|
||||
(oid_ptr)->oid_arg1
|
||||
#define SYSCTL_CHILDREN_SET(oid_ptr, val) \
|
||||
(oid_ptr)->oid_arg1 = (val);
|
||||
#define SYSCTL_STATIC_CHILDREN(oid_name) \
|
||||
(&sysctl_##oid_name##_children)
|
||||
/* Hide these in macros. */
|
||||
#define SYSCTL_CHILDREN(oid_ptr) \
|
||||
(struct sysctl_oid_list *)(oid_ptr)->oid_arg1
|
||||
#define SYSCTL_CHILDREN_SET(oid_ptr, val) (oid_ptr)->oid_arg1 = (val)
|
||||
#define SYSCTL_STATIC_CHILDREN(oid_name) (&sysctl_##oid_name##_children)
|
||||
|
||||
/* === Structs and macros related to context handling === */
|
||||
/* === Structs and macros related to context handling. === */
|
||||
|
||||
/* All dynamically created sysctls can be tracked in a context list. */
|
||||
struct sysctl_ctx_entry {
|
||||
@ -218,7 +216,7 @@ struct sysctl_ctx_entry {
|
||||
|
||||
TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
|
||||
|
||||
#define SYSCTL_NODE_CHILDREN(parent, name) \
|
||||
#define SYSCTL_NODE_CHILDREN(parent, name) \
|
||||
sysctl_##parent##_##name##_children
|
||||
|
||||
/*
|
||||
@ -269,37 +267,48 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
struct __hack
|
||||
|
||||
#ifndef NO_SYSCTL_DESCR
|
||||
#define __DESCR(d) d
|
||||
#define __DESCR(d) d
|
||||
#else
|
||||
#define __DESCR(d) ""
|
||||
#define __DESCR(d) ""
|
||||
#endif
|
||||
|
||||
/* This constructs a "raw" MIB oid. */
|
||||
#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
|
||||
static struct sysctl_oid sysctl__##parent##_##name = { \
|
||||
&sysctl_##parent##_children, { NULL }, nbr, kind, \
|
||||
a1, a2, #name, handler, fmt, 0, 0, __DESCR(descr) }; \
|
||||
#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\
|
||||
static struct sysctl_oid sysctl__##parent##_##name = { \
|
||||
&sysctl_##parent##_children, \
|
||||
{ NULL }, \
|
||||
nbr, \
|
||||
kind, \
|
||||
a1, \
|
||||
a2, \
|
||||
#name, \
|
||||
handler, \
|
||||
fmt, \
|
||||
0, \
|
||||
0, \
|
||||
__DESCR(descr) \
|
||||
}; \
|
||||
DATA_SET(sysctl_set, sysctl__##parent##_##name)
|
||||
|
||||
#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
|
||||
#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr))
|
||||
|
||||
/* This constructs a node from which other oids can hang. */
|
||||
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
|
||||
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
|
||||
struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \
|
||||
(void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr)
|
||||
|
||||
#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
|
||||
#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
|
||||
NULL, 0, handler, "N", __DESCR(descr))
|
||||
|
||||
/* Oid for a string. len can be 0 to indicate '\0' termination. */
|
||||
#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
|
||||
#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
|
||||
arg, len, sysctl_handle_string, "A", descr)
|
||||
|
||||
#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
|
||||
#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
|
||||
arg, len, sysctl_handle_string, "A", __DESCR(descr))
|
||||
|
||||
@ -394,31 +403,31 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
sysctl_handle_counter_u64, "QU", __DESCR(descr))
|
||||
|
||||
/* Oid for an opaque object. Specified by a pointer and a length. */
|
||||
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
|
||||
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, len, sysctl_handle_opaque, fmt, descr)
|
||||
|
||||
#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
|
||||
#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr))
|
||||
|
||||
/* Oid for a struct. Specified by a pointer and a type. */
|
||||
#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
|
||||
#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, sizeof(struct type), sysctl_handle_opaque, \
|
||||
"S," #type, descr)
|
||||
|
||||
#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
|
||||
#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, __DESCR(descr))
|
||||
|
||||
/* Oid for a procedure. Specified by a pointer and an arg. */
|
||||
#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
|
||||
#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
|
||||
CTASSERT(((access) & CTLTYPE) != 0); \
|
||||
SYSCTL_OID(parent, nbr, name, (access), \
|
||||
ptr, arg, handler, fmt, descr)
|
||||
|
||||
#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
|
||||
#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, (access), \
|
||||
ptr, arg, handler, fmt, __DESCR(descr))
|
||||
|
||||
@ -428,7 +437,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
*/
|
||||
#define FEATURE(name, desc) \
|
||||
SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \
|
||||
0, 1, desc)
|
||||
NULL, 1, desc)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
@ -450,15 +459,15 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
/*
|
||||
* CTL_KERN identifiers
|
||||
*/
|
||||
#define KERN_OSTYPE 1 /* string: system version */
|
||||
#define KERN_OSRELEASE 2 /* string: system release */
|
||||
#define KERN_OSREV 3 /* int: system revision */
|
||||
#define KERN_VERSION 4 /* string: compile time info */
|
||||
#define KERN_MAXVNODES 5 /* int: max vnodes */
|
||||
#define KERN_MAXPROC 6 /* int: max processes */
|
||||
#define KERN_MAXFILES 7 /* int: max open files */
|
||||
#define KERN_ARGMAX 8 /* int: max arguments to exec */
|
||||
#define KERN_SECURELVL 9 /* int: system security level */
|
||||
#define KERN_OSTYPE 1 /* string: system version */
|
||||
#define KERN_OSRELEASE 2 /* string: system release */
|
||||
#define KERN_OSREV 3 /* int: system revision */
|
||||
#define KERN_VERSION 4 /* string: compile time info */
|
||||
#define KERN_MAXVNODES 5 /* int: max vnodes */
|
||||
#define KERN_MAXPROC 6 /* int: max processes */
|
||||
#define KERN_MAXFILES 7 /* int: max open files */
|
||||
#define KERN_ARGMAX 8 /* int: max arguments to exec */
|
||||
#define KERN_SECURELVL 9 /* int: system security level */
|
||||
#define KERN_HOSTNAME 10 /* string: hostname */
|
||||
#define KERN_HOSTID 11 /* int: host identifier */
|
||||
#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
|
||||
@ -471,14 +480,14 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
#define KERN_JOB_CONTROL 19 /* int: is job control available */
|
||||
#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
|
||||
#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
|
||||
#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
|
||||
#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
|
||||
#define KERN_OSRELDATE 24 /* int: kernel release date */
|
||||
#define KERN_NTP_PLL 25 /* node: NTP PLL control */
|
||||
#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
|
||||
#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
|
||||
#define KERN_OSRELDATE 24 /* int: kernel release date */
|
||||
#define KERN_NTP_PLL 25 /* node: NTP PLL control */
|
||||
#define KERN_BOOTFILE 26 /* string: name of booted kernel */
|
||||
#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
|
||||
#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
|
||||
#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */
|
||||
#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
|
||||
#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */
|
||||
#define KERN_IPC 30 /* node: anything related to IPC */
|
||||
#define KERN_DUMMY 31 /* unused */
|
||||
#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
|
||||
@ -488,11 +497,10 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
#define KERN_HOSTUUID 36 /* string: host UUID identifier */
|
||||
#define KERN_ARND 37 /* int: from arc4rand() */
|
||||
#define KERN_MAXID 38 /* number of valid kern ids */
|
||||
|
||||
/*
|
||||
* KERN_PROC subtypes
|
||||
*/
|
||||
#define KERN_PROC_ALL 0 /* everything */
|
||||
#define KERN_PROC_ALL 0 /* everything */
|
||||
#define KERN_PROC_PID 1 /* by process id */
|
||||
#define KERN_PROC_PGRP 2 /* by process group id */
|
||||
#define KERN_PROC_SESSION 3 /* by session of pid */
|
||||
@ -526,7 +534,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
/*
|
||||
* KERN_IPC identifiers
|
||||
*/
|
||||
#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
|
||||
#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
|
||||
#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */
|
||||
#define KIPC_SOMAXCONN 3 /* int: max length of connection q */
|
||||
#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */
|
||||
@ -546,8 +554,8 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
#define HW_PAGESIZE 7 /* int: software page size */
|
||||
#define HW_DISKNAMES 8 /* strings: disk drive names */
|
||||
#define HW_DISKSTATS 9 /* struct: diskstats[] */
|
||||
#define HW_FLOATINGPT 10 /* int: has HW floating point? */
|
||||
#define HW_MACHINE_ARCH 11 /* string: machine architecture */
|
||||
#define HW_FLOATINGPT 10 /* int: has HW floating point? */
|
||||
#define HW_MACHINE_ARCH 11 /* string: machine architecture */
|
||||
#define HW_REALMEM 12 /* int: 'real' memory */
|
||||
#define HW_MAXID 13 /* number of valid hw ids */
|
||||
|
||||
@ -576,33 +584,33 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
|
||||
#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
|
||||
#define USER_MAXID 21 /* number of valid user ids */
|
||||
|
||||
#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */
|
||||
#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */
|
||||
#define CTL_P1003_1B_MEMLOCK 3 /* boolean */
|
||||
#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */
|
||||
#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */
|
||||
#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */
|
||||
#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */
|
||||
#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */
|
||||
#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */
|
||||
#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */
|
||||
#define CTL_P1003_1B_FSYNC 11 /* boolean */
|
||||
#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */
|
||||
#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */
|
||||
#define CTL_P1003_1B_TIMERS 14 /* boolean */
|
||||
#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */
|
||||
#define CTL_P1003_1B_AIO_MAX 16 /* int */
|
||||
#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */
|
||||
#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */
|
||||
#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */
|
||||
#define CTL_P1003_1B_PAGESIZE 20 /* int */
|
||||
#define CTL_P1003_1B_RTSIG_MAX 21 /* int */
|
||||
#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */
|
||||
#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */
|
||||
#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */
|
||||
#define CTL_P1003_1B_TIMER_MAX 25 /* int */
|
||||
#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */
|
||||
#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */
|
||||
#define CTL_P1003_1B_MEMLOCK 3 /* boolean */
|
||||
#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */
|
||||
#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */
|
||||
#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */
|
||||
#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */
|
||||
#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */
|
||||
#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */
|
||||
#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */
|
||||
#define CTL_P1003_1B_FSYNC 11 /* boolean */
|
||||
#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */
|
||||
#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */
|
||||
#define CTL_P1003_1B_TIMERS 14 /* boolean */
|
||||
#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */
|
||||
#define CTL_P1003_1B_AIO_MAX 16 /* int */
|
||||
#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */
|
||||
#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */
|
||||
#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */
|
||||
#define CTL_P1003_1B_PAGESIZE 20 /* int */
|
||||
#define CTL_P1003_1B_RTSIG_MAX 21 /* int */
|
||||
#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */
|
||||
#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */
|
||||
#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */
|
||||
#define CTL_P1003_1B_TIMER_MAX 25 /* int */
|
||||
|
||||
#define CTL_P1003_1B_MAXID 26
|
||||
#define CTL_P1003_1B_MAXID 26
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
@ -643,43 +651,42 @@ extern char kern_ident[];
|
||||
|
||||
/* Dynamic oid handling */
|
||||
struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist,
|
||||
struct sysctl_oid_list *parent, int nbr, const char *name,
|
||||
int kind, void *arg1, intptr_t arg2,
|
||||
int (*handler) (SYSCTL_HANDLER_ARGS),
|
||||
const char *fmt, const char *descr);
|
||||
struct sysctl_oid_list *parent, int nbr, const char *name, int kind,
|
||||
void *arg1, intptr_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS),
|
||||
const char *fmt, const char *descr);
|
||||
int sysctl_remove_name(struct sysctl_oid *parent, const char *name, int del,
|
||||
int recurse);
|
||||
int recurse);
|
||||
void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name);
|
||||
int sysctl_move_oid(struct sysctl_oid *oidp,
|
||||
struct sysctl_oid_list *parent);
|
||||
struct sysctl_oid_list *parent);
|
||||
int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse);
|
||||
int sysctl_ctx_init(struct sysctl_ctx_list *clist);
|
||||
int sysctl_ctx_free(struct sysctl_ctx_list *clist);
|
||||
struct sysctl_ctx_entry *sysctl_ctx_entry_add(struct sysctl_ctx_list *clist,
|
||||
struct sysctl_oid *oidp);
|
||||
struct sysctl_oid *oidp);
|
||||
struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist,
|
||||
struct sysctl_oid *oidp);
|
||||
struct sysctl_oid *oidp);
|
||||
int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist,
|
||||
struct sysctl_oid *oidp);
|
||||
struct sysctl_oid *oidp);
|
||||
|
||||
int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old,
|
||||
size_t *oldlenp, void *new, size_t newlen,
|
||||
size_t *retval, int flags);
|
||||
int kernel_sysctlbyname(struct thread *td, char *name,
|
||||
void *old, size_t *oldlenp, void *new, size_t newlen,
|
||||
size_t *retval, int flags);
|
||||
size_t *oldlenp, void *new, size_t newlen, size_t *retval,
|
||||
int flags);
|
||||
int kernel_sysctlbyname(struct thread *td, char *name, void *old,
|
||||
size_t *oldlenp, void *new, size_t newlen, size_t *retval,
|
||||
int flags);
|
||||
int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
|
||||
size_t *oldlenp, int inkernel, void *new, size_t newlen,
|
||||
size_t *retval, int flags);
|
||||
size_t *oldlenp, int inkernel, void *new, size_t newlen,
|
||||
size_t *retval, int flags);
|
||||
int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
|
||||
int *nindx, struct sysctl_req *req);
|
||||
int *nindx, struct sysctl_req *req);
|
||||
void sysctl_lock(void);
|
||||
void sysctl_unlock(void);
|
||||
int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
|
||||
|
||||
struct sbuf;
|
||||
struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int,
|
||||
struct sysctl_req *);
|
||||
struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int,
|
||||
struct sysctl_req *);
|
||||
#else /* !_KERNEL */
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
|
3
tools/regression/bin/sh/builtins/type3.0
Normal file
3
tools/regression/bin/sh/builtins/type3.0
Normal file
@ -0,0 +1,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
[ "$(type type)" = "$(type -- type)" ]
|
Loading…
Reference in New Issue
Block a user