svn commit: r255094 - in projects/random_number_generator: bin/sh contrib/libcxxrt contrib/llvm/lib/Transforms/InstCombine lib/libcompiler_rt share/man/man4 sys/amd64/amd64 sys/arm/arm sys/dev/acpi...
Mark Murray
markm at FreeBSD.org
Sat Aug 31 13:41:25 UTC 2013
Author: markm
Date: Sat Aug 31 13:41:20 2013
New Revision: 255094
URL: http://svnweb.freebsd.org/changeset/base/255094
Log:
MFC
Added:
projects/random_number_generator/sys/mips/conf/PICOSTATION_M2HP
- copied unchanged from r255093, head/sys/mips/conf/PICOSTATION_M2HP
projects/random_number_generator/sys/mips/conf/PICOSTATION_M2HP.hints
- copied unchanged from r255093, head/sys/mips/conf/PICOSTATION_M2HP.hints
projects/random_number_generator/sys/mips/malta/gt_pci_bus_space.c
- copied unchanged from r255093, head/sys/mips/malta/gt_pci_bus_space.c
projects/random_number_generator/sys/mips/malta/gt_pci_bus_space.h
- copied unchanged from r255093, head/sys/mips/malta/gt_pci_bus_space.h
projects/random_number_generator/tools/regression/bin/sh/builtins/type3.0
- copied unchanged from r255093, head/tools/regression/bin/sh/builtins/type3.0
Modified:
projects/random_number_generator/bin/sh/exec.c
projects/random_number_generator/bin/sh/parser.c
projects/random_number_generator/contrib/libcxxrt/exception.cc
projects/random_number_generator/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
projects/random_number_generator/lib/libcompiler_rt/Makefile
projects/random_number_generator/share/man/man4/vmx.4
projects/random_number_generator/sys/amd64/amd64/pmap.c
projects/random_number_generator/sys/arm/arm/machdep.c
projects/random_number_generator/sys/arm/arm/stdatomic.c
projects/random_number_generator/sys/dev/acpica/acpi_thermal.c
projects/random_number_generator/sys/dev/md/md.c
projects/random_number_generator/sys/dev/uart/uart_dev_ns8250.c
projects/random_number_generator/sys/dev/usb/usbdevs
projects/random_number_generator/sys/mips/conf/MALTA
projects/random_number_generator/sys/mips/conf/MALTA64
projects/random_number_generator/sys/mips/malta/files.malta
projects/random_number_generator/sys/mips/malta/gt_pci.c
projects/random_number_generator/sys/mips/malta/malta_machdep.c
projects/random_number_generator/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
projects/random_number_generator/sys/sys/sysctl.h
Directory Properties:
projects/random_number_generator/ (props changed)
projects/random_number_generator/contrib/libcxxrt/ (props changed)
projects/random_number_generator/contrib/llvm/ (props changed)
projects/random_number_generator/share/man/man4/ (props changed)
projects/random_number_generator/sys/ (props changed)
Modified: projects/random_number_generator/bin/sh/exec.c
==============================================================================
--- projects/random_number_generator/bin/sh/exec.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/bin/sh/exec.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -762,5 +762,7 @@ typecmd_impl(int argc, char **argv, int
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));
}
Modified: projects/random_number_generator/bin/sh/parser.c
==============================================================================
--- projects/random_number_generator/bin/sh/parser.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/bin/sh/parser.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -108,12 +108,13 @@ static int funclinno; /* line # where t
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", tokna
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", tokna
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", tokna
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", tokna
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", tokna
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 *
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 *
} 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 @@ done:
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
Modified: projects/random_number_generator/contrib/libcxxrt/exception.cc
==============================================================================
--- projects/random_number_generator/contrib/libcxxrt/exception.cc Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/contrib/libcxxrt/exception.cc Sat Aug 31 13:41:20 2013 (r255094)
@@ -715,7 +715,9 @@ static void report_failure(_Unwind_Reaso
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();
Modified: projects/random_number_generator/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
==============================================================================
--- projects/random_number_generator/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp Sat Aug 31 13:41:20 2013 (r255094)
@@ -845,21 +845,26 @@ Value *InstCombiner::SimplifyDemandedUse
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) :
Modified: projects/random_number_generator/lib/libcompiler_rt/Makefile
==============================================================================
--- projects/random_number_generator/lib/libcompiler_rt/Makefile Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/lib/libcompiler_rt/Makefile Sat Aug 31 13:41:20 2013 (r255094)
@@ -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
Modified: projects/random_number_generator/share/man/man4/vmx.4
==============================================================================
--- projects/random_number_generator/share/man/man4/vmx.4 Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/share/man/man4/vmx.4 Sat Aug 31 13:41:20 2013 (r255094)
@@ -100,6 +100,7 @@ Number of receive descriptors per ring a
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
Modified: projects/random_number_generator/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/random_number_generator/sys/amd64/amd64/pmap.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/amd64/amd64/pmap.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -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);
Modified: projects/random_number_generator/sys/arm/arm/machdep.c
==============================================================================
--- projects/random_number_generator/sys/arm/arm/machdep.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/arm/arm/machdep.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -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;
Modified: projects/random_number_generator/sys/arm/arm/stdatomic.c
==============================================================================
--- projects/random_number_generator/sys/arm/arm/stdatomic.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/arm/arm/stdatomic.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -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, fe
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"
#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 *of
#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
#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,
*/
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
-__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 *
#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 *me
#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
#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
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
Modified: projects/random_number_generator/sys/dev/acpica/acpi_thermal.c
==============================================================================
--- projects/random_number_generator/sys/dev/acpica/acpi_thermal.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/dev/acpica/acpi_thermal.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -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_s
{
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_s
}
/* 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;
}
/*
Modified: projects/random_number_generator/sys/dev/md/md.c
==============================================================================
--- projects/random_number_generator/sys/dev/md/md.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/dev/md/md.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -826,7 +826,7 @@ mdstart_swap(struct md_s *sc, struct bio
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;
Modified: projects/random_number_generator/sys/dev/uart/uart_dev_ns8250.c
==============================================================================
--- projects/random_number_generator/sys/dev/uart/uart_dev_ns8250.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/dev/uart/uart_dev_ns8250.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -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);
}
Modified: projects/random_number_generator/sys/dev/usb/usbdevs
==============================================================================
--- projects/random_number_generator/sys/dev/usb/usbdevs Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/dev/usb/usbdevs Sat Aug 31 13:41:20 2013 (r255094)
@@ -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
Modified: projects/random_number_generator/sys/mips/conf/MALTA
==============================================================================
--- projects/random_number_generator/sys/mips/conf/MALTA Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/mips/conf/MALTA Sat Aug 31 13:41:20 2013 (r255094)
@@ -65,5 +65,6 @@ device loop
device ether
device le
device miibus
+device bpf
device md
device uart
Modified: projects/random_number_generator/sys/mips/conf/MALTA64
==============================================================================
--- projects/random_number_generator/sys/mips/conf/MALTA64 Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/mips/conf/MALTA64 Sat Aug 31 13:41:20 2013 (r255094)
@@ -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
Copied: projects/random_number_generator/sys/mips/conf/PICOSTATION_M2HP (from r255093, head/sys/mips/conf/PICOSTATION_M2HP)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/random_number_generator/sys/mips/conf/PICOSTATION_M2HP Sat Aug 31 13:41:20 2013 (r255094, copy of r255093, head/sys/mips/conf/PICOSTATION_M2HP)
@@ -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
Copied: projects/random_number_generator/sys/mips/conf/PICOSTATION_M2HP.hints (from r255093, head/sys/mips/conf/PICOSTATION_M2HP.hints)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/random_number_generator/sys/mips/conf/PICOSTATION_M2HP.hints Sat Aug 31 13:41:20 2013 (r255094, copy of r255093, head/sys/mips/conf/PICOSTATION_M2HP.hints)
@@ -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
Modified: projects/random_number_generator/sys/mips/malta/files.malta
==============================================================================
--- projects/random_number_generator/sys/mips/malta/files.malta Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/mips/malta/files.malta Sat Aug 31 13:41:20 2013 (r255094)
@@ -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
Modified: projects/random_number_generator/sys/mips/malta/gt_pci.c
==============================================================================
--- projects/random_number_generator/sys/mips/malta/gt_pci.c Sat Aug 31 08:56:33 2013 (r255093)
+++ projects/random_number_generator/sys/mips/malta/gt_pci.c Sat Aug 31 13:41:20 2013 (r255094)
@@ -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, devi
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, devi
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list