Re: svn commit: r268566 - head/usr.bin/users
On Jul 12, 2014, at 8:31 AM, Ian Lepore i...@freebsd.org wrote: It is in no way established that any kind of mess exists. All we have is some people who appear to hate C++ expressing their opinions about how they hate C++. All the whining about how many more bytes the compiled code is or many milliseconds something takes to compile don't add up to any actual problem. Some people have good reason to care about the size of the compiled code. (Witness Adrian's complaints a couple days ago about disk and memory usage for libreadline.) Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r259058 - head/usr.bin/bc
On Dec 7, 2013, at 2:04 PM, Tom Rhodes trho...@freebsd.org wrote: On Sat, 7 Dec 2013 01:44:19 -0500 Eitan Adler ead...@freebsd.org wrote: On Sat, Dec 7, 2013 at 1:27 AM, Xin LI delp...@freebsd.org wrote: Author: delphij Date: Sat Dec 7 06:27:54 2013 New Revision: 259058 URL: http://svnweb.freebsd.org/changeset/base/259058 Log: Remove mention of the compatibility option 'q', which is intentionally undocumented and its only purpose is that we do not bail out when used as a drop-in replacement of a different implementation. As I mentioned in the reply to the PR this change goes in the wrong direction. We should instead document -q as a compatibility option. Undocumented flags, even as NOPS, are bugs. It should be documented as a do-nothing option. It should be documented in the manpage as a do-nothing option. It should not be included in Usage. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver
On Oct 25, 2013, at 2:34 AM, Dimitry Andric dimi...@andric.com wrote: On 25 Oct 2013, at 11:09, Steven Hartland s...@freebsd.org wrote: Author: smh Date: Fri Oct 25 09:09:00 2013 New Revision: 257109 URL: http://svnweb.freebsd.org/changeset/base/257109 Log: Add clang-CC and CC to list of hints allowing clang to identify its operating mode as c++ instead of defaulting to c for the binary names CC and clang-CC. This fixes builds that use cmake, which automatically sets CXX to /usr/bin/CC by default. Huh, I’ve never seen that behavior with cmake? At least, not with any fairly recent version... Anyway, I do not really agree with this change, and I would rather just get rid of the /usr/bin/CC link instead. Even if FreeBSD removes the default symlink, clang should still default to C++ mode when invoked as CC (possibly through a symlink created by an individual user). Build scripts and Makefiles should use c++ instead, which is the standard name for a C++ compiler. Ours should, yes. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r255775 - head/include
Ian, Sorry for being a little slow to respond. It took me a while, but I have verified that a recent checkout, in my environment: * Does build with this patch. * Does not build without it. Please commit. Thanks, Tim On Sep 23, 2013, at 7:38 AM, Ian Lepore i...@freebsd.org wrote: Yeah, I think the moral of this neverending story is that relying on $0 for pathnames is a Bad Idea. Apparently in addition to the patch from PR 160646, we still need something like the patch I proposed in PR 174422. I'll attach an updated version of that. I've got a test build running now, I'll see about getting it commited if it fixes the problem you're seeing. -- Ian On Mon, 2013-09-23 at 06:49 -0700, Tim Kientzle wrote: This breaks the build in the peculiar case where you have a git checkout of some other project, then a FreeBSD SVN checkout inside of that: Project/.git Project/src/ -- FreeBSD source tree. For some reason newvers.sh is now looking one level too far up, so it's seeing the dir containing the source tree instead of the root of the source tree. This may be related to the use of '.' to run newvers.sh combined with newvers.sh using $(basename $0) to determine the script dir, but I haven't dug through in detail yet. Tim On Sep 21, 2013, at 3:36 PM, Ian Lepore i...@freebsd.org wrote: Author: ian Date: Sat Sep 21 22:36:07 2013 New Revision: 255775 URL: http://svnweb.freebsd.org/changeset/base/255775 Log: Create a separate script to generate osreldate.h rather than sourcing newvers.sh into a temporary subshell with inline make rules. Using a separate script fixes a variety of problems, including establishing the correct dependencies in the makefiles. It also eliminates a problem with the way newvers.sh uses `realpath $0`, because $0 expands differently within a script sourced into a rule in a makefile depending on the version of make and of /bin/sh being used. The latter can cause build breakage in a cross-build environment, and can also make it difficult to compile 10.0 on older pre-10.0 systems. PR: 160646 174422 Submitted by: Garrett Cooper yaneurab...@gmail.com Approved by:re (gjb) MFC after: 2 weeks Added: head/include/mk-osreldate.sh (contents, props changed) Modified: head/include/Makefile Modified: head/include/Makefile == --- head/include/Makefile Sat Sep 21 22:24:10 2013(r255774) +++ head/include/Makefile Sat Sep 21 22:36:07 2013(r255775) @@ -104,19 +104,16 @@ SHARED?= copies INCS+= osreldate.h -osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ -${.CURDIR}/Makefile - @${ECHO} creating osreldate.h from newvers.sh - @MAKE=${MAKE}; \ - PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ - . ${.CURDIR}/../sys/conf/newvers.sh; \ - echo $$COPYRIGHT osreldate.h; \ - echo #ifdef _KERNEL osreldate.h; \ - echo #error \osreldate.h cannot be used in the kernel, use sys/param.h\ osreldate.h; \ - echo #else osreldate.h; \ - echo #undef __FreeBSD_version osreldate.h; \ - echo #define __FreeBSD_version $$RELDATE osreldate.h; \ - echo #endif osreldate.h +NEWVERS_SH=${.CURDIR}/../sys/conf/newvers.sh +PARAM_H= ${.CURDIR}/../sys/sys/param.h +MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh + +osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} + env ECHO=${ECHO} \ + MAKE=${MAKE} \ + NEWVERS_SH=${NEWVERS_SH} \ + PARAM_H=${PARAM_H} \ + ${MK_OSRELDATE_SH} .for i in ${LHDRS} INCSLINKS+= sys/$i ${INCLUDEDIR}/$i Added: head/include/mk-osreldate.sh == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/mk-osreldate.shSat Sep 21 22:36:07 2013 (r255775) @@ -0,0 +1,49 @@ +#!/bin/sh - +# Copyright (c) 2013 Garrett Cooper +# 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. +# +# 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
Re: svn commit: r255775 - head/include
This breaks the build in the peculiar case where you have a git checkout of some other project, then a FreeBSD SVN checkout inside of that: Project/.git Project/src/ -- FreeBSD source tree. For some reason newvers.sh is now looking one level too far up, so it's seeing the dir containing the source tree instead of the root of the source tree. This may be related to the use of '.' to run newvers.sh combined with newvers.sh using $(basename $0) to determine the script dir, but I haven't dug through in detail yet. Tim On Sep 21, 2013, at 3:36 PM, Ian Lepore i...@freebsd.org wrote: Author: ian Date: Sat Sep 21 22:36:07 2013 New Revision: 255775 URL: http://svnweb.freebsd.org/changeset/base/255775 Log: Create a separate script to generate osreldate.h rather than sourcing newvers.sh into a temporary subshell with inline make rules. Using a separate script fixes a variety of problems, including establishing the correct dependencies in the makefiles. It also eliminates a problem with the way newvers.sh uses `realpath $0`, because $0 expands differently within a script sourced into a rule in a makefile depending on the version of make and of /bin/sh being used. The latter can cause build breakage in a cross-build environment, and can also make it difficult to compile 10.0 on older pre-10.0 systems. PR: 160646 174422 Submitted by:Garrett Cooper yaneurab...@gmail.com Approved by: re (gjb) MFC after: 2 weeks Added: head/include/mk-osreldate.sh (contents, props changed) Modified: head/include/Makefile Modified: head/include/Makefile == --- head/include/Makefile Sat Sep 21 22:24:10 2013(r255774) +++ head/include/Makefile Sat Sep 21 22:36:07 2013(r255775) @@ -104,19 +104,16 @@ SHARED?=copies INCS+=osreldate.h -osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ -${.CURDIR}/Makefile - @${ECHO} creating osreldate.h from newvers.sh - @MAKE=${MAKE}; \ - PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ - . ${.CURDIR}/../sys/conf/newvers.sh; \ - echo $$COPYRIGHT osreldate.h; \ - echo #ifdef _KERNEL osreldate.h; \ - echo #error \osreldate.h cannot be used in the kernel, use sys/param.h\ osreldate.h; \ - echo #else osreldate.h; \ - echo #undef __FreeBSD_version osreldate.h; \ - echo #define __FreeBSD_version $$RELDATE osreldate.h; \ - echo #endif osreldate.h +NEWVERS_SH= ${.CURDIR}/../sys/conf/newvers.sh +PARAM_H= ${.CURDIR}/../sys/sys/param.h +MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh + +osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} + env ECHO=${ECHO} \ + MAKE=${MAKE} \ + NEWVERS_SH=${NEWVERS_SH} \ + PARAM_H=${PARAM_H} \ + ${MK_OSRELDATE_SH} .for i in ${LHDRS} INCSLINKS+= sys/$i ${INCLUDEDIR}/$i Added: head/include/mk-osreldate.sh == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/mk-osreldate.sh Sat Sep 21 22:36:07 2013 (r255775) @@ -0,0 +1,49 @@ +#!/bin/sh - +# Copyright (c) 2013 Garrett Cooper +# 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. +# +# 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$ + +set -e + +CURDIR=$(pwd) +ECHO=${ECHO:=echo} + +tmpfile=$(mktemp osreldate.) +trap rm -f $tmpfile EXIT + +${ECHO} creating osreldate.h from newvers.sh + +export PARAMFILE=${PARAM_H:=$CURDIR/../sys/sys/param.h} +. ${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh} +cat
svn commit: r253714 - head/sys/boot/arm/uboot
Author: kientzle Date: Sat Jul 27 18:18:46 2013 New Revision: 253714 URL: http://svnweb.freebsd.org/changeset/base/253714 Log: Install Forth infrastructure along with ubldr. Note: loader.rc is installed as loader.rc.sample so that by default, none of this is actually used. Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile == --- head/sys/boot/arm/uboot/MakefileSat Jul 27 17:25:43 2013 (r253713) +++ head/sys/boot/arm/uboot/MakefileSat Jul 27 18:18:46 2013 (r253714) @@ -134,7 +134,20 @@ ldscript.generated:: mv ldscript.generated.tmp ldscript.generated; \ fi +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader.help +FILES+=loader.help loader.4th support.4th loader.conf +FILES+=screen.4th frames.4th beastie.4th +FILES+=brand.4th check-password.4th color.4th delay.4th +FILES+=menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th +FILESDIR_loader.conf= /boot/defaults + +# Put sample loader.rc and menu.rc on disk but don't enable them +# by default. +FILES+=loader.rc +FILESNAME_loader.rc= loader.rc.sample +FILES+=menu.rc +FILESNAME_menu.rc= menu.rc.sample +.endif .include bsd.prog.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r253715 - head/sys/boot/forth
Author: kientzle Date: Sat Jul 27 18:19:28 2013 New Revision: 253715 URL: http://svnweb.freebsd.org/changeset/base/253715 Log: Put in commented-out version of beastie menu commands so that non-i386 users can easily experiment with this. Modified: head/sys/boot/forth/loader.rc Modified: head/sys/boot/forth/loader.rc == --- head/sys/boot/forth/loader.rc Sat Jul 27 18:18:46 2013 (r253714) +++ head/sys/boot/forth/loader.rc Sat Jul 27 18:19:28 2013 (r253715) @@ -10,5 +10,9 @@ start \ Tests for password -- executes autoboot first if a password was defined check-password +\ Uncomment to enable boot menu +\ include /boot/beastie.4th +\ beastie-start + \ Unless set otherwise, autoboot is automatic at this point ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r253636 - head/sys/vm
Author: kientzle Date: Thu Jul 25 03:48:37 2013 New Revision: 253636 URL: http://svnweb.freebsd.org/changeset/base/253636 Log: Clear entire map structure including locks so that the locks don't accidentally appear to have been already initialized. In particular, this fixes a consistent kernel crash on armv6 with: panic: lock vm map (user) 0xc09cc050 already initialized that appeared with r251709. PR: arm/180820 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c == --- head/sys/vm/vm_map.cThu Jul 25 03:44:12 2013(r253635) +++ head/sys/vm/vm_map.cThu Jul 25 03:48:37 2013(r253636) @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl vm_map_t map; map = (vm_map_t)mem; - map-nentries = 0; - map-size = 0; + memset(map, 0, sizeof(*map)); mtx_init(map-system_mtx, vm map (system), NULL, MTX_DEF | MTX_DUPOK); sx_init(map-lock, vm map (user)); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r251709 - head/sys/vm
On Sat, 15 Jun 2013 11:35:03 +0100 Andrew Turner and...@fubar.geek.nz wrote: On Thu, 13 Jun 2013 21:05:38 + (UTC) Jeff Roberson j...@freebsd.org wrote: Author: jeff Date: Thu Jun 13 21:05:38 2013 New Revision: 251709 URL: http://svnweb.freebsd.org/changeset/base/251709 Log: - Convert the slab free item list from a linked array of indices to a bitmap using sys/bitset. This is much simpler, has lower space overhead and is cheaper in most cases. - Use a second bitmap for invariants asserts and improve the quality of the asserts as well as the number of erroneous conditions that we will catch. - Drastically simplify sizing code. Special case refcnt zones since they will be going away. - Update stale comments. This broke booting for my on the Raspberry Pi for me. If I revert just this change the board boots as expected. Kernel output from the boot failure follows. As Andrew pointed out some time ago, this broke armv6 with: panic: lock vm map (user) 0xc09cc050 already initialized I put in some debug printfs and verified that this is actually the first time that vm_map_zinit is called. So I don't think the lock is actually being re-initialized; rather I think it's a problem with uninitialized memory. The following seems to fix it for me: Index: sys/vm/vm_map.c === --- sys/vm/vm_map.c (revision 253514) +++ sys/vm/vm_map.c (working copy) @@ -239,8 +239,7 @@ vm_map_t map; map = (vm_map_t)mem; - map-nentries = 0; - map-size = 0; + memset(map, 0, sizeof(*map)); mtx_init(map-system_mtx, vm map (system), NULL, MTX_DEF | MTX_DUPOK); sx_init(map-lock, vm map (user)); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r252373 - head/usr.bin
Author: kientzle Date: Sat Jun 29 15:31:23 2013 New Revision: 252373 URL: http://svnweb.freebsd.org/changeset/base/252373 Log: Enable svnlite on armv6. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Sat Jun 29 12:27:50 2013(r252372) +++ head/usr.bin/Makefile Sat Jun 29 15:31:23 2013(r252373) @@ -366,7 +366,7 @@ SUBDIR+=users SUBDIR+= who .endif -.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == ia64 || ${MACHINE_ARCH} == sparc64 || ${MACHINE_ARCH} == i386 +.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == ia64 || ${MACHINE_ARCH} == sparc64 || ${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == armv6 .if ${MK_SVN} == yes || ${MK_SVNLITE} == yes SUBDIR+= svn .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r252374 - head/bin/ed
Author: kientzle Date: Sat Jun 29 15:49:26 2013 New Revision: 252374 URL: http://svnweb.freebsd.org/changeset/base/252374 Log: Fix a -Wunsequenced warning. Submitted by: d...@gmx.com Modified: head/bin/ed/re.c Modified: head/bin/ed/re.c == --- head/bin/ed/re.cSat Jun 29 15:31:23 2013(r252373) +++ head/bin/ed/re.cSat Jun 29 15:49:26 2013(r252374) @@ -89,7 +89,7 @@ extract_pattern(int delimiter) default: break; case '[': - if ((nd = parse_char_class(++nd)) == NULL) { + if ((nd = parse_char_class(nd + 1)) == NULL) { errmsg = unbalanced brackets ([]); return NULL; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r252375 - head/lib/libfetch
Author: kientzle Date: Sat Jun 29 15:51:27 2013 New Revision: 252375 URL: http://svnweb.freebsd.org/changeset/base/252375 Log: Fix -Wunsequenced warning. Submitted by: d...@gmx.com Modified: head/lib/libfetch/fetch.c Modified: head/lib/libfetch/fetch.c == --- head/lib/libfetch/fetch.c Sat Jun 29 15:49:26 2013(r252374) +++ head/lib/libfetch/fetch.c Sat Jun 29 15:51:27 2013(r252375) @@ -376,7 +376,7 @@ fetchParseURL(const char *URL) /* password */ if (*q == ':') - q = fetch_pctdecode(u-pwd, ++q, URL_PWDLEN); + q = fetch_pctdecode(u-pwd, q + 1, URL_PWDLEN); p++; } else { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r252376 - head/lib/libutil
Author: kientzle Date: Sat Jun 29 15:52:48 2013 New Revision: 252376 URL: http://svnweb.freebsd.org/changeset/base/252376 Log: Fix -Wunsequenced warning Submitted by: d...@gmx.com Modified: head/lib/libutil/login_times.c Modified: head/lib/libutil/login_times.c == --- head/lib/libutil/login_times.c Sat Jun 29 15:51:27 2013 (r252375) +++ head/lib/libutil/login_times.c Sat Jun 29 15:52:48 2013 (r252376) @@ -96,7 +96,7 @@ parse_lt(const char *str) else m.lt_start = 0; if (*p == '-') - p = parse_time(++p, m.lt_end); + p = parse_time(p + 1, m.lt_end); else m.lt_end = 1440; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r252377 - head/usr.sbin/pw
Author: kientzle Date: Sat Jun 29 15:54:17 2013 New Revision: 252377 URL: http://svnweb.freebsd.org/changeset/base/252377 Log: Fix -Wunsequenced warning Submitted by: d...@gmx.com Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c == --- head/usr.sbin/pw/pw_user.c Sat Jun 29 15:52:48 2013(r252376) +++ head/usr.sbin/pw/pw_user.c Sat Jun 29 15:54:17 2013(r252377) @@ -200,7 +200,7 @@ pw_user(struct userconf * cnf, int mode, strlcpy(dbuf, cnf-home, sizeof(dbuf)); p = dbuf; if (stat(dbuf, st) == -1) { - while ((p = strchr(++p, '/')) != NULL) { + while ((p = strchr(p + 1, '/')) != NULL) { *p = '\0'; if (stat(dbuf, st) == -1) { if (mkdir(dbuf, _DEF_DIRMODE) == -1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r252378 - head/usr.sbin/newsyslog
Author: kientzle Date: Sat Jun 29 15:58:03 2013 New Revision: 252378 URL: http://svnweb.freebsd.org/changeset/base/252378 Log: Fix -Wunsequenced Submitted by: d...@gmx.com Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Sat Jun 29 15:54:17 2013 (r252377) +++ head/usr.sbin/newsyslog/newsyslog.c Sat Jun 29 15:58:03 2013 (r252378) @@ -1083,7 +1083,7 @@ parse_file(FILE *cf, struct cflist *work * at any time, etc). */ if (strcasecmp(DEBUG_MARKER, q) == 0) { - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) warnx(debug line specifies no option:\n%s, @@ -1096,7 +1096,7 @@ parse_file(FILE *cf, struct cflist *work } else if (strcasecmp(INCLUDE_MARKER, q) == 0) { if (verbose) printf(Found: %s, errline); - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) { warnx(include line missing argument:\n%s, @@ -1138,7 +1138,7 @@ parse_file(FILE *cf, struct cflist *work defconf_p = working; } - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) errx(1, malformed line (missing fields):\n%s, @@ -1172,7 +1172,7 @@ parse_file(FILE *cf, struct cflist *work } else working-gid = (gid_t)-1; - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) errx(1, malformed line (missing fields):\n%s, @@ -1187,7 +1187,7 @@ parse_file(FILE *cf, struct cflist *work errx(1, error in config file; bad permissions:\n%s, errline); - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) errx(1, malformed line (missing fields):\n%s, @@ -1197,7 +1197,7 @@ parse_file(FILE *cf, struct cflist *work errx(1, error in config file; bad value for count of logs to save:\n%s, errline); - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) errx(1, malformed line (missing fields):\n%s, @@ -1215,7 +1215,7 @@ parse_file(FILE *cf, struct cflist *work working-flags = 0; working-compress = COMPRESS_NONE; - q = parse = missing_field(sob(++parse), errline); + q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); eol = !*parse; *parse = '\0'; @@ -1257,7 +1257,7 @@ no_trimat: if (eol) q = NULL; else { - q = parse = sob(++parse); /* Optional field */ + q = parse = sob(parse + 1); /* Optional field */ parse = son(parse); if (!*parse) eol = 1; @@ -1327,7 +1327,7 @@ no_trimat: if (eol) q = NULL; else { - q = parse = sob(++parse); /* Optional field */ + q = parse = sob(parse + 1); /* Optional field */ parse = son(parse); if (!*parse) eol = 1; @@ -1348,7 +1348,7 @@ no_trimat: if (eol) q = NULL; else { - q = parse = sob(++parse); /* Optional field */ + q = parse = sob(parse + 1); /* Optional field */ *(parse = son(parse)) = '\0'; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to
Re: svn commit: r252376 - head/lib/libutil
On Jun 29, 2013, at 9:19 AM, Konstantin Belousov wrote: On Sat, Jun 29, 2013 at 03:52:49PM +, Tim Kientzle wrote: Author: kientzle Date: Sat Jun 29 15:52:48 2013 New Revision: 252376 URL: http://svnweb.freebsd.org/changeset/base/252376 Log: Fix -Wunsequenced warning What is this ? From the name of the warning, it sounds as if the problem is in the lack of sequence point between two modifications of the same variable in the expression ? But, there function' argument evaluation and function call are separated by seq point, AFAIR. Could you, please, clarify ? I think you're right about that, though I'd have to look at the spec to be sure. Not sure why clang would report this as a -Wunsequenced warning. The implied store here is certainly redundant, though. Tim Submitted by: d...@gmx.com Modified: head/lib/libutil/login_times.c Modified: head/lib/libutil/login_times.c == --- head/lib/libutil/login_times.c Sat Jun 29 15:51:27 2013 (r252375) +++ head/lib/libutil/login_times.c Sat Jun 29 15:52:48 2013 (r252376) @@ -96,7 +96,7 @@ parse_lt(const char *str) else m.lt_start = 0; if (*p == '-') -p = parse_time(++p, m.lt_end); +p = parse_time(p + 1, m.lt_end); else m.lt_end = 1440; signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r252013 - head/contrib/apr/include
Author: kientzle Date: Thu Jun 20 02:04:03 2013 New Revision: 252013 URL: http://svnweb.freebsd.org/changeset/base/252013 Log: Try to fix build of apr on FreeBSD/arm. Modified: head/contrib/apr/include/apr_general.h Modified: head/contrib/apr/include/apr_general.h == --- head/contrib/apr/include/apr_general.h Thu Jun 20 00:00:33 2013 (r252012) +++ head/contrib/apr/include/apr_general.h Thu Jun 20 02:04:03 2013 (r252013) @@ -76,7 +76,7 @@ typedef int apr_signum_t; * @return offset */ -#if defined(CRAY) || (defined(__arm) !defined(LINUX)) +#if defined(CRAY) || (defined(__arm) !defined(LINUX) !defined(__FreeBSD__)) #ifdef __STDC__ #define APR_OFFSET(p_type,field) _Offsetof(p_type,field) #else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r250768 - head/sys/arm/ti
Author: kientzle Date: Sat May 18 12:53:20 2013 New Revision: 250768 URL: http://svnweb.freebsd.org/changeset/base/250768 Log: Label the mmc child after the parent. Modified: head/sys/arm/ti/ti_mmchs.c Modified: head/sys/arm/ti/ti_mmchs.c == --- head/sys/arm/ti/ti_mmchs.c Sat May 18 12:01:38 2013(r250767) +++ head/sys/arm/ti/ti_mmchs.c Sat May 18 12:53:20 2013(r250768) @@ -1747,7 +1747,7 @@ ti_mmchs_attach(device_t dev) sc-host.host_ocr = MMC_OCR_290_300 | MMC_OCR_300_310; sc-host.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; - device_add_child(dev, mmc, 0); + device_add_child(dev, mmc, sc-device_id); device_set_ivars(dev, sc-host); err = bus_generic_attach(dev); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r250769 - head/sys/boot/fdt/dts
Author: kientzle Date: Sat May 18 12:54:37 2013 New Revision: 250769 URL: http://svnweb.freebsd.org/changeset/base/250769 Log: Correct the spelling of okay. Add pinmux setting for the Reset GPIO pin for MMC1. Modified: head/sys/boot/fdt/dts/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/beaglebone-black.dts == --- head/sys/boot/fdt/dts/beaglebone-black.dts Sat May 18 12:53:20 2013 (r250768) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Sat May 18 12:54:37 2013 (r250769) @@ -78,6 +78,7 @@ /* MMC1 */ GPMC_CSn1, mmc1_clk, input_pulldown, GPMC_CSn2, mmc1_cmd, input_pulldown, + GPMC_CSn3, gpio2_0, output, /* Reset */ GPMC_AD0, mmc1_dat0, input_pulldown, GPMC_AD1, mmc1_dat1, input_pulldown, GPMC_AD2, mmc1_dat2, input_pulldown, @@ -130,7 +131,7 @@ }; mmchs1@481D8000 { - status = ok; + status = okay; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r250791 - head/sys/arm/ti
Author: kientzle Date: Sat May 18 22:42:21 2013 New Revision: 250791 URL: http://svnweb.freebsd.org/changeset/base/250791 Log: Back out r250768 until I can further investigate why it might be causing problems with the BeagleBone Black boot. Modified: head/sys/arm/ti/ti_mmchs.c Modified: head/sys/arm/ti/ti_mmchs.c == --- head/sys/arm/ti/ti_mmchs.c Sat May 18 22:42:05 2013(r250790) +++ head/sys/arm/ti/ti_mmchs.c Sat May 18 22:42:21 2013(r250791) @@ -1747,7 +1747,7 @@ ti_mmchs_attach(device_t dev) sc-host.host_ocr = MMC_OCR_290_300 | MMC_OCR_300_310; sc-host.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; - device_add_child(dev, mmc, sc-device_id); + device_add_child(dev, mmc, 0); device_set_ivars(dev, sc-host); err = bus_generic_attach(dev); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r250692 - head/sys/arm/conf
On May 16, 2013, at 9:49 PM, Rui Paulo wrote: On 2013/05/16, at 2:02, Tim Kientzle kient...@freebsd.org wrote: I don't object, but I'm not sure why we need this. I'd rather see a comment in the BEAGLEBONE config indicating that it can be used with beaglebone-black.dts. Generally, I want us to move away from compiled-in DTBs. The BEAGLEBONE config works just fine on either one and it's what I plan to continue using going forward. Part of the boot loader's job is to load the correct DTB. The images built by Crochet today already do this and produce images that boot on either old or new BeagleBone using the BEAGLEBONE config. U-Boot already has logic to detect the board, load the correct DTB, and the same BEAGLEBONE kernel then runs just fine. Here are the U-Boot patches if you'd like to do this as well: https://github.com/kientzle/crochet-freebsd/tree/master/board/BeagleBone/files (There's also a copy of the compiled U-Boot and associated files at: http://people.freebsd.org/~kientzle/beaglebone-and-black-bootfiles.tgz Moving forward, I'd like to see us generally consolidate ARM kernel configurations. I have some (still very experimental) ideas for combining the RPi and BeagleBone kernels into a single kernel, but with my limited time, that will be a fairly long-term project. If anyone's at BSDCan who would like to talk about it…. I'll be at the Beyond BuildWorld session on Thursday…. ;-) Yes, this is certainly useful for people net booting the BeagleBone Black for developing kernel drivers, but I'm not sure why we would bother having it checked-in. I understand your point, but what about drivers that only apply to the BeagleBone Black, such as a driver for HDMI? Wouldn't that require a separate kernel config file or are we expecting to use only kernel modules? Such a driver should be in the BeagleBone kernel config but will only get turned on (by the FDT) on appropriate boards. Yes, people who need small kernels for various reasons will definitely need to hand-tune their kernel configs to leave out drivers they don't want (such as an HDMI driver on a BeagleBone white). But that doesn't mean we need separate kernel configs in the tree for every possible combination of hardware. That's what FDT is for. The proliferation of kernel configs is getting to be a headache. * make universe has to build all kernels, so we're better off with fewer bulkier kernel configs. * To more rapidly support new systems, we want to be able to mix-and-match existing drivers. Right now, drivers originally developed for different SoCs don't even compile together, so we can't effectively leverage existing code. There's a *lot* of cut-and-paste copying of code in our ARM tree right now. I have some ideas about how to unify some of the ARMv6 kernels and I'm hoping to start gradually working on that over the next few months. Ideally, I'd like to have a handful of GENERIC kernel configs in the tree, each supporting a range of SoCs. This will give us confidence that large sets of drivers do all compile and play reasonably well together. It will also make it feasible for people working on generic driver infrastructure to get some real traction on things like generic irq routing and pinmux support. (Brooks has some interesting ideas about IRQ routing and Warner has talked about better ways to do pinmux mapping.) It's easy for folks to trim configs if they need to do so for particular applications. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r250692 - head/sys/arm/conf
I don't object, but I'm not sure why we need this. I'd rather see a comment in the BEAGLEBONE config indicating that it can be used with beaglebone-black.dts. Generally, I want us to move away from compiled-in DTBs. The BEAGLEBONE config works just fine on either one and it's what I plan to continue using going forward. Part of the boot loader's job is to load the correct DTB. The images built by Crochet today already do this and produce images that boot on either old or new BeagleBone using the BEAGLEBONE config. U-Boot already has logic to detect the board, load the correct DTB, and the same BEAGLEBONE kernel then runs just fine. Here are the U-Boot patches if you'd like to do this as well: https://github.com/kientzle/crochet-freebsd/tree/master/board/BeagleBone/files (There's also a copy of the compiled U-Boot and associated files at: http://people.freebsd.org/~kientzle/beaglebone-and-black-bootfiles.tgz Moving forward, I'd like to see us generally consolidate ARM kernel configurations. I have some (still very experimental) ideas for combining the RPi and BeagleBone kernels into a single kernel, but with my limited time, that will be a fairly long-term project. If anyone's at BSDCan who would like to talk about it…. I'll be at the Beyond BuildWorld session on Thursday…. ;-) Yes, this is certainly useful for people net booting the BeagleBone Black for developing kernel drivers, but I'm not sure why we would bother having it checked-in. Tim On May 15, 2013, at 11:51 PM, Rui Paulo wrote: Author: rpaulo Date: Thu May 16 03:51:00 2013 New Revision: 250692 URL: http://svnweb.freebsd.org/changeset/base/250692 Log: Add a kernel config file for the BeableBone Black SoC. +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beaglebone-black.dts signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r250531 - head/sys/arm/arm
Author: kientzle Date: Sat May 11 22:32:43 2013 New Revision: 250531 URL: http://svnweb.freebsd.org/changeset/base/250531 Log: Don't use the old stack-walking code with EABI ARM kernels or clang-compiled ARM kernels. This fixes a crash seen in clang-compiled ARM kernels that include WITNESS. This code could be easily modified to walk the stack for current clang-generated code (including EABI) but Andrew Turner has raised concerns that the stack frame currently emitted by clang isn't actually required by EABI so such a change might cause problems down the road. In case anyone wants to experiment, the change to support current clang-compiled kernels involves simply setting FR_RFP=0 and FR_SCP=1. Modified: head/sys/arm/arm/stack_machdep.c Modified: head/sys/arm/arm/stack_machdep.c == --- head/sys/arm/arm/stack_machdep.cSat May 11 22:13:24 2013 (r250530) +++ head/sys/arm/arm/stack_machdep.cSat May 11 22:32:43 2013 (r250531) @@ -39,17 +39,16 @@ __FBSDID($FreeBSD$); static void stack_capture(struct stack *st, u_int32_t *frame) { +#if !defined(__ARM_EABI__) !defined(__clang__) vm_offset_t callpc; - stack_zero(st); - while (1) { - if (!INKERNEL(frame)) - break; + while (INKERNEL(frame)) { callpc = frame[FR_SCP]; if (stack_put(st, callpc) == -1) break; frame = (u_int32_t *)(frame[FR_RFP]); } +#endif } void @@ -63,6 +62,7 @@ stack_save_td(struct stack *st, struct t panic(stack_save_td: running); frame = (u_int32_t *)td-td_pcb-un_32.pcb32_r11; + stack_zero(st); stack_capture(st, frame); } @@ -72,5 +72,6 @@ stack_save(struct stack *st) u_int32_t *frame; frame = (u_int32_t *)__builtin_frame_address(0); + stack_zero(st); stack_capture(st, frame); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r250435 - head/sys/boot/fdt/dts
Author: kientzle Date: Fri May 10 05:34:08 2013 New Revision: 250435 URL: http://svnweb.freebsd.org/changeset/base/250435 Log: Move 'compatible' line out of the common am335x.dtsi and into the beaglebone-specific .dts file. Add a new .dts for the BeagleBone Black with more memory, slightly different pinmux initialization, and with mmchs1 configured (though the latter doesn't quite work yet). Added: head/sys/boot/fdt/dts/beaglebone-black.dts - copied, changed from r250434, head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi == --- head/sys/boot/fdt/dts/am335x.dtsi Fri May 10 04:49:40 2013 (r250434) +++ head/sys/boot/fdt/dts/am335x.dtsi Fri May 10 05:34:08 2013 (r250435) @@ -27,7 +27,6 @@ */ / { - compatible = ti,am335x; #address-cells = 1; #size-cells = 1; @@ -107,7 +106,7 @@ interrupt-parent = AINTC; }; - mmchs0@4809C000 { + mmchs0@4806 { compatible = ti,mmchs; reg =0x4806 0x1000 ; interrupts = 64; @@ -115,6 +114,15 @@ mmchs-device-id = 0; }; + mmchs1@481D8000 { + compatible = ti,mmchs; + reg =0x481D8000 0x1000 ; + interrupts = 28; + interrupt-parent = AINTC; + mmchs-device-id = 1; + status = disabled; + }; + enet0: ethernet@4A10 { #address-cells = 1; #size-cells = 1; Copied and modified: head/sys/boot/fdt/dts/beaglebone-black.dts (from r250434, head/sys/boot/fdt/dts/beaglebone.dts) == --- head/sys/boot/fdt/dts/beaglebone.dtsFri May 10 04:49:40 2013 (r250434, copy source) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Fri May 10 05:34:08 2013 (r250435) @@ -31,7 +31,9 @@ /include/ am335x.dtsi / { - model = beaglebone; + model = beaglebone-black; + compatible = beaglebone-black, beaglebone, ti,am335x; + aliases { soc = SOC; @@ -40,7 +42,7 @@ memory { device_type = memory; - reg = 0x8000 0x1000 ;/* 256MB RAM */ + reg = 0x8000 0x2000 ;/* 512MB RAM */ }; am335x { @@ -73,18 +75,21 @@ MMC0_DAT1, mmc0_dat1, input_pullup, MMC0_DAT2, mmc0_dat2, input_pullup, MMC0_DAT3, mmc0_dat3, input_pullup, + /* MMC1 */ + GPMC_CSn1, mmc1_clk, input_pulldown, + GPMC_CSn2, mmc1_cmd, input_pulldown, + GPMC_AD0, mmc1_dat0, input_pulldown, + GPMC_AD1, mmc1_dat1, input_pulldown, + GPMC_AD2, mmc1_dat2, input_pulldown, + GPMC_AD3, mmc1_dat3, input_pulldown, + GPMC_AD4, mmc1_dat4, input_pulldown, + GPMC_AD5, mmc1_dat5, input_pulldown, + GPMC_AD6, mmc1_dat6, input_pulldown, + GPMC_AD7, mmc1_dat7, input_pulldown, /* GPIO */ ECAP0_IN_PWM0_OUT, gpio0_7, input_pulldown, GPMC_AD10, gpio0_26, input_pulldown, GPMC_AD11, gpio0_27, input_pulldown, - GPMC_AD0, gpio1_0, input_pulldown, - GPMC_AD1, gpio1_1, input_pulldown, - GPMC_AD2, gpio1_2, input_pulldown, - GPMC_AD3, gpio1_3, input_pulldown, - GPMC_AD4, gpio1_4, input_pulldown, - GPMC_AD5, gpio1_5, input_pulldown, - GPMC_AD6, gpio1_6, input_pulldown, - GPMC_AD7, gpio1_7, input_pulldown, GPMC_AD12, gpio1_12, input_pulldown, GPMC_AD13, gpio1_13, input_pulldown, GPMC_AD14, gpio1_14, input_pulldown, @@ -97,8 +102,6 @@ GPMC_A8, gpio1_24, output, /* User LED 4 */ GPMC_BEn1, gpio1_28, input_pulldown, GPMC_CSn0, gpio1_29, input_pulldown, - GPMC_CSn1, gpio1_30, input_pulldown, -
svn commit: r250255 - head/sys/arm/arm
Author: kientzle Date: Sat May 4 21:26:11 2013 New Revision: 250255 URL: http://svnweb.freebsd.org/changeset/base/250255 Log: Make a debugging printf a little more useful. Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c == --- head/sys/arm/arm/trap.c Sat May 4 20:02:34 2013(r250254) +++ head/sys/arm/arm/trap.c Sat May 4 21:26:11 2013(r250255) @@ -240,8 +240,8 @@ data_abort_handler(trapframe_t *tf) far = cpu_faultaddress(); fsr = cpu_faultstatus(); #if 0 - printf(data abort: %p (from %p %p)\n, (void*)far, (void*)tf-tf_pc, - (void*)tf-tf_svc_lr); + printf(data abort: fault address=%p (from pc=%p lr=%p)\n, + (void*)far, (void*)tf-tf_pc, (void*)tf-tf_svc_lr); #endif /* Update vmmeter statistics */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r249774 - head/sys/boot/fdt/dts
On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: Author: gonzo Date: Mon Apr 22 18:53:36 2013 New Revision: 249774 URL: http://svnweb.freebsd.org/changeset/base/249774 Log: Split BeagleBone DTS to generic AM335x part and Beagle-bone specific Added: head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/beaglebone.dts Added: head/sys/boot/fdt/dts/am335x.dtsi == + +/ { + compatible = ti,am335x; Modified: head/sys/boot/fdt/dts/beaglebone.dts == +/include/ am335x.dtsi + / { model = beaglebone; - compatible = beaglebone, ti,am335x; This used to have two compatible names; now it only has one. Is there a way to have both again? (Mostly I'm just curious; I'm still learning FDT conventions.) Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r249484 - head/lib
On Apr 17, 2013, at 10:33 AM, Dimitry Andric wrote: In any case, the layout has been like this since the initial clangbsd import, and I never saw any reason to change it. Maybe Ed can tell a bit more, since he seems to have done the initial infrastructure setup. FreeBSD/ARM just switched from GCC to Clang, which is why this just got noticed. U-Boot is used quite heavily for FreeBSD/ARM (and MIPS and PowerPC as well, I believe). Here are the options I see for getting cc -print-file-name=include to work again: * Hack clang to handle -print-file-name=include specially. I did this for GCC already, but I'm not thrilled about it. * Configure clang differently so that this option works. * Symlink /usr/include to appear somewhere that clang expects. * Rearrange our directory layout slightly to match clang's expectations. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r249633 - head/lib
Author: kientzle Date: Fri Apr 19 05:01:14 2013 New Revision: 249633 URL: http://svnweb.freebsd.org/changeset/base/249633 Log: Fix the symlink creation from r249484 so that repeated installs work correctly. Suggested by Tijl Coosemans. Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Fri Apr 19 03:55:54 2013(r249632) +++ head/lib/Makefile Fri Apr 19 05:01:14 2013(r249633) @@ -253,6 +253,6 @@ _libusb=libusb .endif afterinstall: - ln -fs ../include ${DESTDIR}/usr/lib/include + ln -fs ../include ${DESTDIR}/usr/lib/ .include bsd.subdir.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r249634 - head/lib
Author: kientzle Date: Fri Apr 19 05:13:57 2013 New Revision: 249634 URL: http://svnweb.freebsd.org/changeset/base/249634 Log: An even more refined version of r249484, until we can come up with a good fix for the -print-file-name=include breakage. As suggested by Andrey Chernov. Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Fri Apr 19 05:01:14 2013(r249633) +++ head/lib/Makefile Fri Apr 19 05:13:57 2013(r249634) @@ -253,6 +253,6 @@ _libusb=libusb .endif afterinstall: - ln -fs ../include ${DESTDIR}/usr/lib/ + ln -hfs ../include ${DESTDIR}/usr/lib/include .include bsd.subdir.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r249484 - head/lib
On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: On 2013-04-14 21:13, Tim Kientzle wrote: Author: kientzle Date: Sun Apr 14 19:13:51 2013 New Revision: 249484 URL: http://svnweb.freebsd.org/changeset/base/249484 Log: Install a symlink /usr/lib/include == /usr/include This fixes -print-file-name=include in clang (and is arguably a better way to fix the same issue in GCC than the change I made in r231336). MFC after: 1 week Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/MakefileSun Apr 14 18:36:30 2013(r249483) +++ head/lib/MakefileSun Apr 14 19:13:51 2013(r249484) @@ -252,4 +252,7 @@ _libusbhid= libusbhid _libusb= libusb .endif +afterinstall: +ln -fs ../include ${DESTDIR}/usr/lib/include + .include bsd.subdir.mk This breaks with -DNO_CLEAN defined, because then ${DESTDIR}/usr/lib/include/include is created. That's a good point. Would this work better? afterinstall: if [ ! -e $(DESTDIR)/usr/lib/include ]; then ln -fs ../include $(DESTDIR)/usr/lib/include fi I'm not that fond of this patch by the way, but I don't fully understand the problem it's trying to solve so I won't object. It just looks too much like a hack to me It's a subtle issue and I'm not surprised that it raised some eyebrows. I spent a long time looking for a better solution. In short, both GCC and Clang make some assumptions about the layout of headers used for freestanding compiles. (My earlier commit said these assumptions were undocumented, but that's not quite true, they're just rather obscure.) This symlink is the simplest way I've found to reconcile those assumptions with the FreeBSD directory layout. I'm happy to consider alternatives. Tim signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r249484 - head/lib
On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle kient...@freebsd.org wrote: On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: On 2013-04-14 21:13, Tim Kientzle wrote: Author: kientzle Date: Sun Apr 14 19:13:51 2013 New Revision: 249484 URL: http://svnweb.freebsd.org/changeset/base/249484 Log: Install a symlink /usr/lib/include == /usr/include This fixes -print-file-name=include in clang (and is arguably a better way to fix the same issue in GCC than the change I made in r231336). MFC after: 1 week Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/MakefileSun Apr 14 18:36:30 2013(r249483) +++ head/lib/MakefileSun Apr 14 19:13:51 2013(r249484) @@ -252,4 +252,7 @@ _libusbhid= libusbhid _libusb= libusb .endif +afterinstall: +ln -fs ../include ${DESTDIR}/usr/lib/include + .include bsd.subdir.mk This breaks with -DNO_CLEAN defined, because then ${DESTDIR}/usr/lib/include/include is created. That's a good point. Would this work better? afterinstall: if [ ! -e $(DESTDIR)/usr/lib/include ]; then ln -fs ../include $(DESTDIR)/usr/lib/include fi I'm not that fond of this patch by the way, but I don't fully understand the problem it's trying to solve so I won't object. It just looks too much like a hack to me It's a subtle issue and I'm not surprised that it raised some eyebrows. I spent a long time looking for a better solution. In short, both GCC and Clang make some assumptions about the layout of headers used for freestanding compiles. (My earlier commit said these assumptions were undocumented, but that's not quite true, they're just rather obscure.) If you're doing a freestanding compile...shouldn't you also be specifying both include and library paths explicitly? Yes, of course. But the correct directories to use vary somewhat across platforms, so we would like to have some reasonably portable way to find the right directory to use for building on a particular system. Both gcc and clang support a -print-file-name=include option which is supposed to print out the directory containing headers used for freestanding compiles. You can then take that path and use it as the explicit include directory path for freestanding builds. I just feel more confused by this explanation. Why not just specify -I/usr/include? That would be FreeBSD-specific. Not everyone lumps all header files together like we do. (Or even better, if you're doing a freestanding compile, but want the default include paths, get the compiler to dump the default include paths and process that.) That's precisely what this is for. I've been working with U-Boot sources which compile on many systems and use -print-file-name=include to identify the directory containing the basic freestanding header files. The -print-file-name=include option works on Linux, works on MacOS, and --- with this one symlink --- can work on FreeBSD as well. I've been using it to cross-build U-Boot using the FreeBSD xdev toolchain with both GCC and Clang. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r249484 - head/lib
On Apr 17, 2013, at 5:05 AM, Tijl Coosemans wrote: On 2013-04-17 08:26, Tim Kientzle wrote: On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle wrote: On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: On 2013-04-14 21:13, Tim Kientzle wrote: Modified: head/lib/Makefile == --- head/lib/MakefileSun Apr 14 18:36:30 2013(r249483) +++ head/lib/MakefileSun Apr 14 19:13:51 2013(r249484) @@ -252,4 +252,7 @@ _libusbhid= libusbhid _libusb= libusb .endif +afterinstall: +ln -fs ../include ${DESTDIR}/usr/lib/include + .include bsd.subdir.mk This breaks with -DNO_CLEAN defined, because then ${DESTDIR}/usr/lib/include/include is created. That's a good point. Would this work better? afterinstall: if [ ! -e $(DESTDIR)/usr/lib/include ]; then ln -fs ../include $(DESTDIR)/usr/lib/include fi Maybe just: ln -fs ../include $(DESTDIR)/usr/lib/ Ah, yes. That is the obvious answer. I'll change it to that for now. I'm happy to remove it once we have a better answer in place. I'm not that fond of this patch by the way, but I don't fully understand the problem it's trying to solve so I won't object. It just looks too much like a hack to me It's a subtle issue and I'm not surprised that it raised some eyebrows. I spent a long time looking for a better solution. In short, both GCC and Clang make some assumptions about the layout of headers used for freestanding compiles. (My earlier commit said these assumptions were undocumented, but that's not quite true, they're just rather obscure.) If you're doing a freestanding compile...shouldn't you also be specifying both include and library paths explicitly? Yes, of course. But the correct directories to use vary somewhat across platforms, so we would like to have some reasonably portable way to find the right directory to use for building on a particular system. Both gcc and clang support a -print-file-name=include option which is supposed to print out the directory containing headers used for freestanding compiles. You can then take that path and use it as the explicit include directory path for freestanding builds. (Or even better, if you're doing a freestanding compile, but want the default include paths, get the compiler to dump the default include paths and process that.) That's precisely what this is for. I've been working with U-Boot sources which compile on many systems and use -print-file-name=include to identify the directory containing the basic freestanding header files. So you compile with -ffreestanding -nostdinc? And then add the include path returned by -print-file-name=include? That's what the U-Boot sources do, yes. The -print-file-name=include option works on Linux, works on MacOS, and --- with this one symlink --- can work on FreeBSD as well. I've been using it to cross-build U-Boot using the FreeBSD xdev toolchain with both GCC and Clang. clang -E -v - /dev/null shows it passes -resource-dir /usr/bin/../lib/clang/3.3 to cc1 stage which then complains about nonexistent directory /usr/bin/../lib/clang/3.3/include. So how about moving /usr/include/clang/3.3 to /usr/lib/clang/3.3/include? That seems to be the location clang expects and what lang/clang port uses (in /usr/local). I would certainly like to see that. I presumed that there was some reason this wasn't done in the initial import. The path from -resource-dir is also searched by -print-file-name. All headers from contrib/llvm/tools/clang/lib/Headers would have to be installed there to have a complete freestanding environment, but some of those headers would have to be patched to use the base system header in the hosted case like the stdint.h header does: #if __STDC_HOSTED__ \ defined(__has_include_next) __has_include_next(stdint.h) # include_next stdint.h #else ... #endif In the lang/clang port files/patch-tools_clang_lib_Headers_Makefile should be removed I think. It prevents too many useful headers from being installed (e.g. avxintrin.h) That would be great! I can certainly help with some of this but my time is a little tight. While we're talking about freestanding brokenness, is anyone interested in fixing the fact that FreeBSD/ARM requires freestanding programs to be linked against libc? Tim signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r249484 - head/lib
Author: kientzle Date: Sun Apr 14 19:13:51 2013 New Revision: 249484 URL: http://svnweb.freebsd.org/changeset/base/249484 Log: Install a symlink /usr/lib/include == /usr/include This fixes -print-file-name=include in clang (and is arguably a better way to fix the same issue in GCC than the change I made in r231336). MFC after:1 week Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Sun Apr 14 18:36:30 2013(r249483) +++ head/lib/Makefile Sun Apr 14 19:13:51 2013(r249484) @@ -252,4 +252,7 @@ _libusbhid= libusbhid _libusb= libusb .endif +afterinstall: + ln -fs ../include ${DESTDIR}/usr/lib/include + .include bsd.subdir.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r249222 - head/sys/boot/ficl/arm
Author: kientzle Date: Sun Apr 7 05:40:49 2013 New Revision: 249222 URL: http://svnweb.freebsd.org/changeset/base/249222 Log: Fix two broken macros. Modified: head/sys/boot/ficl/arm/sysdep.h Modified: head/sys/boot/ficl/arm/sysdep.h == --- head/sys/boot/ficl/arm/sysdep.h Sun Apr 7 01:30:51 2013 (r249221) +++ head/sys/boot/ficl/arm/sysdep.h Sun Apr 7 05:40:49 2013 (r249222) @@ -59,7 +59,7 @@ #include assert.h #if !defined IGNORE/* Macro to silence unused param warnings */ -#define IGNORE(x) x +#define IGNORE(x) (void)(x) #endif /* @@ -406,7 +406,7 @@ void *ficlRealloc(void *p, size_t size); #if FICL_MULTITHREAD int ficlLockDictionary(short fLock); #else -#define ficlLockDictionary(x) 0 /* ignore */ +#define ficlLockDictionary(x) /* ignore */ #endif /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r249223 - head/sys/boot/ficl
Author: kientzle Date: Sun Apr 7 05:53:42 2013 New Revision: 249223 URL: http://svnweb.freebsd.org/changeset/base/249223 Log: The CELL fields can be various integer types depending on the platform (ARM uses 'int' and 'unsigned'; i386 uses 'long' and 'unsigned long'), so we need explicit casts to long and unsigned long here to ensure that the result matches the printf %ld and %lx specifiers. Modified: head/sys/boot/ficl/tools.c Modified: head/sys/boot/ficl/tools.c == --- head/sys/boot/ficl/tools.c Sun Apr 7 05:40:49 2013(r249222) +++ head/sys/boot/ficl/tools.c Sun Apr 7 05:53:42 2013(r249223) @@ -216,10 +216,11 @@ static void seeColon(FICL_VM *pVM, CELL { FICL_WORD *pLit = (FICL_WORD *)c.p; sprintf(cp, %.*s ( %#lx literal ), -pLit-nName, pLit-name, c.u); +pLit-nName, pLit-name, (unsigned long)c.u); } else -sprintf(cp, literal %ld (%#lx), c.i, c.u); +sprintf(cp, literal %ld (%#lx), +(long)c.i, (unsigned long)c.u); break; case STRINGLIT: { @@ -281,7 +282,7 @@ static void seeColon(FICL_VM *pVM, CELL } else /* probably not a word - punt and print value */ { -sprintf(cp, %ld ( %#lx ), pc-i, pc-u); +sprintf(cp, %ld ( %#lx ), (long)pc-i, (unsigned long)pc-u); } vmTextOut(pVM, pVM-pad, 1); @@ -324,19 +325,22 @@ static void seeXT(FICL_VM *pVM) break; case VARIABLE: -sprintf(pVM-pad, variable = %ld (%#lx), pFW-param-i, pFW-param-u); +sprintf(pVM-pad, variable = %ld (%#lx), +(long)pFW-param-i, (unsigned long)pFW-param-u); vmTextOut(pVM, pVM-pad, 1); break; #if FICL_WANT_USER case USER: -sprintf(pVM-pad, user variable %ld (%#lx), pFW-param-i, pFW-param-u); +sprintf(pVM-pad, user variable %ld (%#lx), +(long)pFW-param-i, (unsigned long)pFW-param-u); vmTextOut(pVM, pVM-pad, 1); break; #endif case CONSTANT: -sprintf(pVM-pad, constant = %ld (%#lx), pFW-param-i, pFW-param-u); +sprintf(pVM-pad, constant = %ld (%#lx), +(long)pFW-param-i, (unsigned long)pFW-param-u); vmTextOut(pVM, pVM-pad, 1); default: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r248934 - head/sys/boot/fdt
Author: kientzle Date: Sat Mar 30 16:33:16 2013 New Revision: 248934 URL: http://svnweb.freebsd.org/changeset/base/248934 Log: Initialize sym_count to 0. This fixes a compiler warning introduced in r248121. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Mar 30 15:09:04 2013 (r248933) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Mar 30 16:33:16 2013 (r248934) @@ -128,7 +128,7 @@ fdt_find_static_dtb() char *strp; int i, sym_count; - symtab = strtab = 0; + sym_count = symtab = strtab = 0; strp = NULL; offs = __elfN(relocation_offset); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r248028 - head/sys/arm/arm
Author: kientzle Date: Fri Mar 8 03:29:05 2013 New Revision: 248028 URL: http://svnweb.freebsd.org/changeset/base/248028 Log: This file is specific to arm11x6 processors, so tell the assembler it's okay to use arm11x6 instructions. Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S == --- head/sys/arm/arm/cpufunc_asm_arm11x6.S Fri Mar 8 02:40:07 2013 (r248027) +++ head/sys/arm/arm/cpufunc_asm_arm11x6.S Fri Mar 8 03:29:05 2013 (r248028) @@ -62,6 +62,8 @@ #include machine/asm.h __FBSDID($FreeBSD$); + .cpu arm1136js + #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ mcr p15, 0, Rtmp1, c7, c5, 0/* Invalidate Entire I cache */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r247609 - head/sys/arm/conf
On Mar 1, 2013, at 7:23 PM, Andrew Turner wrote: Author: andrew Date: Sat Mar 2 03:23:14 2013 New Revision: 247609 URL: http://svnweb.freebsd.org/changeset/base/247609 Log: Build the Raspberry Pi dtb file when building the kernel so we can copy it to the boot partition for U-Boot. Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B == --- head/sys/arm/conf/RPI-B Sat Mar 2 02:19:04 2013(r247608) +++ head/sys/arm/conf/RPI-B Sat Mar 2 03:23:14 2013(r247609) @@ -117,4 +117,4 @@ options FDT # Note: DTB is normally loaded and modified by RPi boot loader, then # handed to kernel via U-Boot and ubldr. #options FDT_DTB_STATIC -#makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts +makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts FWIW, I personally find it easier to just run dtc to compile the DTS file as required. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247269 - head/sbin/fsck_ffs
Author: kientzle Date: Mon Feb 25 16:25:38 2013 New Revision: 247269 URL: http://svnweb.freebsd.org/changeset/base/247269 Log: Fix ARM build by assigning the computed time here to a variable of the right type for printf. Modified: head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsutil.c == --- head/sbin/fsck_ffs/fsutil.c Mon Feb 25 16:22:40 2013(r247268) +++ head/sbin/fsck_ffs/fsutil.c Mon Feb 25 16:25:38 2013(r247269) @@ -448,8 +448,8 @@ static void printIOstats(void) clock_gettime(CLOCK_REALTIME_PRECISE, finishpass); timespecsub(finishpass, startpass); - printf(Running time: %ld msec\n, - finishpass.tv_sec * 1000 + finishpass.tv_nsec / 100); + msec = finishpass.tv_sec * 1000 + finishpass.tv_nsec / 100; + printf(Running time: %lld msec\n, msec); printf(buffer reads by type:\n); for (totalmsec = 0, i = 0; i BT_NUMBUFTYPES; i++) totalmsec += readtime[i].tv_sec * 1000 + ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247304 - head/sys/arm/conf
Author: kientzle Date: Tue Feb 26 04:59:02 2013 New Revision: 247304 URL: http://svnweb.freebsd.org/changeset/base/247304 Log: RPi users might want to touch the boot partition, which is always FAT formatted on this board, so compile-in MSDOSFS. Comment out the compiled-in FDT and explain why. Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B == --- head/sys/arm/conf/RPI-B Tue Feb 26 03:46:35 2013(r247303) +++ head/sys/arm/conf/RPI-B Tue Feb 26 04:59:02 2013(r247304) @@ -42,6 +42,7 @@ options FFS #Berkeley Fast Filesystem optionsSOFTUPDATES #Enable FFS soft updates support optionsUFS_ACL #Support for access control lists optionsUFS_DIRHASH #Improve performance on big directories +optionsMSDOSFS #MSDOS Filesystem device snp optionsNFSCL #Network Filesystem Client @@ -113,5 +114,7 @@ device smsc # Flattened Device Tree options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts +# Note: DTB is normally loaded and modified by RPi boot loader, then +# handed to kernel via U-Boot and ubldr. +#options FDT_DTB_STATIC +#makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247250 - in head/sys/boot: common fdt
Author: kientzle Date: Mon Feb 25 01:50:04 2013 New Revision: 247250 URL: http://svnweb.freebsd.org/changeset/base/247250 Log: Fix the bug I introduced in r247045. After digging through more carefully, it looks like there's no real need to have the DTB in the module directory. So we can simplify a lot: Just copy DTB into local heap for fdt addr and U-Boot integration, drop all the extra COPYIN() calls. I've left one final COPYIN() to update the in-kernel DTB for consistency with how this code used to work, but I'm no longer convinced it's appropriate here. I've also remove the mem_load_raw() utility that I added to boot/common/module.c with r247045 since it's no longer necessary. Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/common/bootstrap.h == --- head/sys/boot/common/bootstrap.hMon Feb 25 00:08:28 2013 (r247249) +++ head/sys/boot/common/bootstrap.hMon Feb 25 01:50:04 2013 (r247250) @@ -237,8 +237,6 @@ void file_discard(struct preloaded_file void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, struct kernel_module **newmp); -/* Load from a buffer in memory. */ -struct preloaded_file *mem_load_raw(char *type, char *name, const void *p, size_t len); /* MI module loaders */ #ifdef __elfN Modified: head/sys/boot/common/module.c == --- head/sys/boot/common/module.c Mon Feb 25 00:08:28 2013 (r247249) +++ head/sys/boot/common/module.c Mon Feb 25 01:50:04 2013 (r247250) @@ -422,42 +422,6 @@ file_loadraw(char *type, char *name) } /* - * Load a chunk of data as if it had been read from a file. - */ -struct preloaded_file * -mem_load_raw(char *type, char *name, const void *p, size_t len) -{ -struct preloaded_file *fp; - -/* We can't load first */ -if ((file_findfile(NULL, NULL)) == NULL) { - command_errmsg = can't load file before kernel; - return(NULL); -} - -if (archsw.arch_loadaddr != NULL) - loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); -archsw.arch_copyin(p, loadaddr, len); - -/* Looks OK so far; create populate control structure */ -fp = file_alloc(); -fp-f_name = strdup(name); -fp-f_type = strdup(type); -fp-f_args = NULL; -fp-f_metadata = NULL; -fp-f_loader = -1; -fp-f_addr = loadaddr; -fp-f_size = len; - -/* recognise space consumption */ -loadaddr += len; - -/* Add to the list of loaded files */ -file_insert_tail(fp); -return fp; -} - -/* * Load the module (name), pass it (argc),(argv), add container file * to the list of loaded files. * If module is already loaded just assign new argc/argv. Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Mon Feb 25 00:08:28 2013 (r247249) +++ head/sys/boot/fdt/fdt_loader_cmd.c Mon Feb 25 01:50:04 2013 (r247250) @@ -63,12 +63,16 @@ __FBSDID($FreeBSD$); #defineCMD_REQUIRES_BLOB 0x01 /* Location of FDT yet to be loaded. */ +/* This may be in read-only memory, so can't be manipulated directly. */ static struct fdt_header *fdt_to_load = NULL; -/* Local copy of FDT on heap. */ +/* Location of FDT on heap. */ +/* This is the copy we actually manipulate. */ static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ static size_t fdtp_size = 0; -/* Location of FDT in kernel or module */ +/* Location of FDT in kernel or module. */ +/* This won't be set if FDT is loaded from disk or memory. */ +/* If it is set, we'll update it when fdt_copy() gets called. */ static vm_offset_t fdtp_va = 0; static int fdt_load_dtb(vm_offset_t va); @@ -191,7 +195,6 @@ fdt_find_static_dtb() fdt_start = (vm_offset_t)sym.st_value + offs; free(strp); } - printf(fdt_start: 0x%08jX\n, (intmax_t)fdt_start); return (fdt_start); } @@ -239,14 +242,19 @@ fdt_load_dtb(vm_offset_t va) static int fdt_load_dtb_addr(struct fdt_header *header) { - struct preloaded_file *bfp; - bfp = mem_load_raw(dtb, memory.dtb, header, fdt_totalsize(header)); - if (bfp == NULL) { - command_errmsg = unable to copy DTB into module directory; + // TODO: Verify that there really is an FDT at + // the specified location. + fdtp_size = fdt_totalsize(header); + free(fdtp); + if ((fdtp = malloc(fdtp_size)) == NULL) { + command_errmsg = can't allocate memory for device tree copy; return (1); } - return fdt_load_dtb(bfp-f_addr); + +
svn commit: r247200 - head/sys/boot/uboot/lib
Author: kientzle Date: Sat Feb 23 20:27:03 2013 New Revision: 247200 URL: http://svnweb.freebsd.org/changeset/base/247200 Log: Print kernel args as late as possible before jumping into kernel. Modified: head/sys/boot/uboot/lib/elf_freebsd.c Modified: head/sys/boot/uboot/lib/elf_freebsd.c == --- head/sys/boot/uboot/lib/elf_freebsd.c Sat Feb 23 19:45:43 2013 (r247199) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sat Feb 23 20:27:03 2013 (r247200) @@ -82,9 +82,9 @@ __elfN(uboot_exec)(struct preloaded_file entry = uboot_vm_translate(e-e_entry); printf(Kernel entry at 0x%x...\n, (unsigned)entry); - printf(Kernel args: %s\n, fp-f_args); dev_cleanup(); + printf(Kernel args: %s\n, fp-f_args); (*entry)((void *)mdp); panic(exec returned); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247201 - head/sys/boot/fdt
Author: kientzle Date: Sat Feb 23 20:34:47 2013 New Revision: 247201 URL: http://svnweb.freebsd.org/changeset/base/247201 Log: fdt addr gets run from loader.rc before the kernel is loaded. This was broken by r247045 which tried to copy the FDT into the module directory immediately. Instead, store the address and arrange for the FDT to get copied into the module directory later when the usual FDT initialization runs. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 23 20:27:03 2013 (r247200) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 23 20:34:47 2013 (r247201) @@ -62,7 +62,9 @@ __FBSDID($FreeBSD$); #defineCMD_REQUIRES_BLOB 0x01 -/* Local copy of FDT */ +/* Location of FDT yet to be loaded. */ +static struct fdt_header *fdt_to_load = NULL; +/* Local copy of FDT on heap. */ static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ static size_t fdtp_size = 0; @@ -252,13 +254,20 @@ fdt_setup_fdtp() { struct preloaded_file *bfp; struct fdt_header *hdr; - const char *s, *p; + const char *s; + char *p; vm_offset_t va; if ((bfp = file_findfile(NULL, dtb)) != NULL) { printf(Using DTB from loaded file.\n); return fdt_load_dtb(bfp-f_addr); - } + } + + if (fdt_to_load != NULL) { + printf(Using DTB from memory address 0x%08X.\n, +(unsigned int)fdt_to_load); + return fdt_load_dtb_addr(fdt_to_load); + } s = ub_env_get(fdtaddr); if (s != NULL *s != '\0') { @@ -810,8 +819,12 @@ command_fdt_internal(int argc, char *arg static int fdt_cmd_addr(int argc, char *argv[]) { + struct preloaded_file *fp; struct fdt_header *hdr; - const char *addr, *cp; + const char *addr; + char *cp; + + fdt_to_load = NULL; if (argc 2) addr = argv[2]; @@ -820,15 +833,17 @@ fdt_cmd_addr(int argc, char *argv[]) return (CMD_ERROR); } - hdr = (struct fdt_header *)strtoul(addr, cp, 0); + hdr = (struct fdt_header *)strtoul(addr, cp, 16); if (cp == addr) { sprintf(command_errbuf, Invalid address: %s, addr); return (CMD_ERROR); } - if (fdt_load_dtb_addr(hdr) != 0) - return (CMD_ERROR); + while ((fp = file_findfile(NULL, dtb)) != NULL) { + file_discard(fp); + } + fdt_to_load = hdr; return (CMD_OK); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247167 - stable/9/contrib/gcc
Author: kientzle Date: Sat Feb 23 04:51:20 2013 New Revision: 247167 URL: http://svnweb.freebsd.org/changeset/base/247167 Log: MFC support for -print-file-name=include. Modified: stable/9/contrib/gcc/gcc.c Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/gcc.c == --- stable/9/contrib/gcc/gcc.c Fri Feb 22 22:40:10 2013(r247166) +++ stable/9/contrib/gcc/gcc.c Sat Feb 23 04:51:20 2013(r247167) @@ -2696,6 +2696,17 @@ find_a_file (const struct path_prefix *p return xstrdup (DEFAULT_LINKER); #endif +#ifdef FREEBSD_NATIVE + if (! strcmp(name, include)) +{ +#ifdef CROSS_INCLUDE_DIR + return xstrdup(CROSS_INCLUDE_DIR); +#else + return xstrdup(STANDARD_INCLUDE_DIR); +#endif +} +#endif + /* Determine the filename to execute (special case for absolute paths). */ if (IS_ABSOLUTE_PATH (name)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247045 - head/sys/boot/fdt
Author: kientzle Date: Wed Feb 20 16:32:38 2013 New Revision: 247045 URL: http://svnweb.freebsd.org/changeset/base/247045 Log: Fix fdt addr to accept literal addresses rather than va offsets. When initializing the fdt, query U-Boot as well. With this change, it is now feasible to have U-Boot load the FDT, ubldr will pull it from U-Boot and hand it to the kernel. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Wed Feb 20 15:44:40 2013 (r247044) +++ head/sys/boot/fdt/fdt_loader_cmd.c Wed Feb 20 16:32:38 2013 (r247045) @@ -235,26 +235,47 @@ fdt_load_dtb(vm_offset_t va) } static int -fdt_setup_fdtp() +fdt_load_dtb_addr(struct fdt_header *header) { struct preloaded_file *bfp; - vm_offset_t va; - bfp = file_findfile(NULL, dtb); + bfp = mem_load_raw(dtb, memory.dtb, header, fdt_totalsize(header)); if (bfp == NULL) { - if ((va = fdt_find_static_dtb()) == 0) { - command_errmsg = no device tree blob found!; - return (1); - } - } else { - /* Dynamic blob has precedence over static. */ - va = bfp-f_addr; + command_errmsg = unable to copy DTB into module directory; + return (1); } + return fdt_load_dtb(bfp-f_addr); +} - if (fdt_load_dtb(va) != 0) - return (1); - - return (0); +static int +fdt_setup_fdtp() +{ + struct preloaded_file *bfp; + struct fdt_header *hdr; + const char *s, *p; + vm_offset_t va; + + if ((bfp = file_findfile(NULL, dtb)) != NULL) { + printf(Using DTB from loaded file.\n); + return fdt_load_dtb(bfp-f_addr); + } + + s = ub_env_get(fdtaddr); + if (s != NULL *s != '\0') { + hdr = (struct fdt_header *)strtoul(s, p, 16); + if (*p == '\0') { + printf(Using DTB provided by U-Boot.\n); + return fdt_load_dtb_addr(hdr); + } + } + + if ((va = fdt_find_static_dtb()) != 0) { + printf(Using DTB compiled into kernel.\n); + return (fdt_load_dtb(va)); + } + + command_errmsg = no device tree blob found!; + return (1); } #define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ @@ -789,8 +810,8 @@ command_fdt_internal(int argc, char *arg static int fdt_cmd_addr(int argc, char *argv[]) { - vm_offset_t va; - char *addr, *cp; + struct fdt_header *hdr; + const char *addr, *cp; if (argc 2) addr = argv[2]; @@ -799,13 +820,13 @@ fdt_cmd_addr(int argc, char *argv[]) return (CMD_ERROR); } - va = strtol(addr, cp, 0); + hdr = (struct fdt_header *)strtoul(addr, cp, 0); if (cp == addr) { sprintf(command_errbuf, Invalid address: %s, addr); return (CMD_ERROR); } - if (fdt_load_dtb(va) != 0) + if (fdt_load_dtb_addr(hdr) != 0) return (CMD_ERROR); return (CMD_OK); @@ -1484,6 +1505,7 @@ fdt_cmd_mkprop(int argc, char *argv[]) if (fdt_modprop(o, propname, value, 1)) return (CMD_ERROR); + COPYIN(fdtp, fdtp_va, fdtp_size); return (CMD_OK); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r247001 - head/lib/libstand
Author: kientzle Date: Tue Feb 19 17:09:23 2013 New Revision: 247001 URL: http://svnweb.freebsd.org/changeset/base/247001 Log: Fix includes for use in libstand. Modified: head/lib/libstand/strtoul.c Modified: head/lib/libstand/strtoul.c == --- head/lib/libstand/strtoul.c Tue Feb 19 16:43:48 2013(r247000) +++ head/lib/libstand/strtoul.c Tue Feb 19 17:09:23 2013(r247001) @@ -38,10 +38,8 @@ static char sccsid[] = @(#)strtoul.c8. #include sys/cdefs.h __FBSDID($FreeBSD$); +#include stand.h #include limits.h -#include ctype.h -#include errno.h -#include stdlib.h /* * Convert a string to an unsigned long integer. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r246948 - head/sys/boot/uboot/lib
Author: kientzle Date: Mon Feb 18 20:11:20 2013 New Revision: 246948 URL: http://svnweb.freebsd.org/changeset/base/246948 Log: Clarify an error message. The addresses here are really offsets within the primary mapped memory block (which may not start at address zero). Modified: head/sys/boot/uboot/lib/copy.c Modified: head/sys/boot/uboot/lib/copy.c == --- head/sys/boot/uboot/lib/copy.c Mon Feb 18 19:33:07 2013 (r246947) +++ head/sys/boot/uboot/lib/copy.c Mon Feb 18 20:11:20 2013 (r246948) @@ -66,7 +66,7 @@ uboot_vm_translate(vm_offset_t o) { */ } if (o size) - panic(Address 0x%08jX bigger than size 0x%08X\n, + panic(Address offset 0x%08jX bigger than size 0x%08X\n, (intmax_t)o, size); return (void *)(start + o); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r246953 - head/sys/boot/common
Author: kientzle Date: Mon Feb 18 23:13:13 2013 New Revision: 246953 URL: http://svnweb.freebsd.org/changeset/base/246953 Log: Add mem_load_raw() for loading data from another location in memory. This will be used by some upcoming changes to loader(8) FDT handling to allow it to use an FDT provided by an earlier boot stage the same as an FDT loaded from disk. Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c Modified: head/sys/boot/common/bootstrap.h == --- head/sys/boot/common/bootstrap.hMon Feb 18 22:47:59 2013 (r246952) +++ head/sys/boot/common/bootstrap.hMon Feb 18 23:13:13 2013 (r246953) @@ -237,6 +237,8 @@ void file_discard(struct preloaded_file void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, struct kernel_module **newmp); +/* Load from a buffer in memory. */ +struct preloaded_file *mem_load_raw(char *type, char *name, const void *p, size_t len); /* MI module loaders */ #ifdef __elfN Modified: head/sys/boot/common/module.c == --- head/sys/boot/common/module.c Mon Feb 18 22:47:59 2013 (r246952) +++ head/sys/boot/common/module.c Mon Feb 18 23:13:13 2013 (r246953) @@ -351,6 +351,7 @@ file_load_dependencies(struct preloaded_ } return (error); } + /* * We've been asked to load (name) as (type), so just suck it in, * no arguments or anything. @@ -421,6 +422,42 @@ file_loadraw(char *type, char *name) } /* + * Load a chunk of data as if it had been read from a file. + */ +struct preloaded_file * +mem_load_raw(char *type, char *name, const void *p, size_t len) +{ +struct preloaded_file *fp; + +/* We can't load first */ +if ((file_findfile(NULL, NULL)) == NULL) { + command_errmsg = can't load file before kernel; + return(NULL); +} + +if (archsw.arch_loadaddr != NULL) + loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); +archsw.arch_copyin(p, loadaddr, len); + +/* Looks OK so far; create populate control structure */ +fp = file_alloc(); +fp-f_name = strdup(name); +fp-f_type = strdup(type); +fp-f_args = NULL; +fp-f_metadata = NULL; +fp-f_loader = -1; +fp-f_addr = loadaddr; +fp-f_size = len; + +/* recognise space consumption */ +loadaddr += len; + +/* Add to the list of loaded files */ +file_insert_tail(fp); +return fp; +} + +/* * Load the module (name), pass it (argc),(argv), add container file * to the list of loaded files. * If module is already loaded just assign new argc/argv. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r246931 - head/lib/libstand
Author: kientzle Date: Mon Feb 18 01:55:53 2013 New Revision: 246931 URL: http://svnweb.freebsd.org/changeset/base/246931 Log: Add strtoul() to libstand by copying from libc and clipping out locale code. Added: head/lib/libstand/strtoul.c - copied, changed from r246713, head/lib/libc/stdlib/strtoul.c Modified: head/lib/libstand/Makefile head/lib/libstand/stand.h Modified: head/lib/libstand/Makefile == --- head/lib/libstand/Makefile Mon Feb 18 01:37:55 2013(r246930) +++ head/lib/libstand/Makefile Mon Feb 18 01:55:53 2013(r246931) @@ -39,7 +39,7 @@ CFLAGS+= -msoft-float -D_STANDALONE # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \ + globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ sbrk.c twiddle.c zalloc.c zalloc_malloc.c # private (pruned) versions of libc string functions Modified: head/lib/libstand/stand.h == --- head/lib/libstand/stand.h Mon Feb 18 01:37:55 2013(r246930) +++ head/lib/libstand/stand.h Mon Feb 18 01:55:53 2013(r246931) @@ -261,6 +261,7 @@ extern u_long random(void); /* imports from stdlib, locally modified */ extern longstrtol(const char *, char **, int); +extern unsigned long strtoul(const char *, char **, int); extern char*optarg;/* getopt(3) external variables */ extern int optind, opterr, optopt, optreset; extern int getopt(int, char * const [], const char *); Copied and modified: head/lib/libstand/strtoul.c (from r246713, head/lib/libc/stdlib/strtoul.c) == --- head/lib/libc/stdlib/strtoul.c Tue Feb 12 16:57:20 2013 (r246713, copy source) +++ head/lib/libstand/strtoul.c Mon Feb 18 01:55:53 2013(r246931) @@ -42,7 +42,6 @@ __FBSDID($FreeBSD$); #include ctype.h #include errno.h #include stdlib.h -#include xlocale_private.h /* * Convert a string to an unsigned long integer. @@ -51,14 +50,13 @@ __FBSDID($FreeBSD$); * alphabets and digits are each contiguous. */ unsigned long -strtoul_l(const char * __restrict nptr, char ** __restrict endptr, int base, locale_t locale) +strtoul(const char * __restrict nptr, char ** __restrict endptr, int base) { const char *s; unsigned long acc; char c; unsigned long cutoff; int neg, any, cutlim; - FIX_LOCALE(locale); /* * See strtol for comments as to the logic used. @@ -66,7 +64,7 @@ strtoul_l(const char * __restrict nptr, s = nptr; do { c = *s++; - } while (isspace_l((unsigned char)c, locale)); + } while (isspace((unsigned char)c)); if (c == '-') { neg = 1; c = *s++; @@ -123,8 +121,3 @@ noconv: *endptr = (char *)(any ? s - 1 : nptr); return (acc); } -unsigned long -strtoul(const char * __restrict nptr, char ** __restrict endptr, int base) -{ - return strtoul_l(nptr, endptr, base, __get_locale()); -} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r246647 - in head/sys/boot: arm/uboot fdt powerpc/ps3 powerpc/uboot
Author: kientzle Date: Mon Feb 11 02:15:26 2013 New Revision: 246647 URL: http://svnweb.freebsd.org/changeset/base/246647 Log: Provide verbose help for fdt commands on platforms that use it. Added: head/sys/boot/fdt/help.fdt (contents, props changed) Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile == --- head/sys/boot/arm/uboot/MakefileMon Feb 11 00:50:52 2013 (r246646) +++ head/sys/boot/arm/uboot/MakefileMon Feb 11 02:15:26 2013 (r246647) @@ -118,7 +118,7 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} vers.c:${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} -loader.help: help.common help.uboot +loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk ${.TARGET} Added: head/sys/boot/fdt/help.fdt == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/help.fdt Mon Feb 11 02:15:26 2013(r246647) @@ -0,0 +1,93 @@ +$FreeBSD$ +### +# Tfdt Dfdt manipulation commands + + fdt subcommand arguments + + Facilities for loading and manipulating device tree data. + +### +# Tfdt Saddr Dload fdt from an address in memory + + fdt addr address + + Copies compiled device tree from a particular location + in memory. + +### +# Tfdt Salias DXXX + + fdt alias address + + Not Yet Implemented + +### +# Tfdt Scd DSelect a particular node for future commands + + fdt cd path + + Changes the current node to the node specified by the path. + Path elements are separated by '/'; a leading '/' represents + the root node. + +### +# Tfdt Sheader DDump the header of the compiled device tree + + fdt header + + Dumps DTB size, format and other key values. + +### +# Tfdt Sls DList subnodes of the current node + + fdt ls path + + Lists the nodes under the specified path. + If no path is specified, lists nodes under the current path. + +### +# Tfdt Smknode DCreate a new node in the device tree + + fdt mknode name + + Creates a new node with the specified name. + +### +# Tfdt Smkprop DAdd a new property to the current node + + fdt mkprop name value ... + + Creates a new property with the specified name and values. + Multiple values can be specified and will be concatenated. + +### +# Tfdt Smres DXXX + + fdt mres + + Dumps the list of reserved memory regions. + +### +# Tfdt Sprop DDump value of a particular property + + fdt prop name value ... + + If value is specified, set the given property to the indicated value. + Otherwise, print the value of the property. + +### +# Tfdt Spwd DPrint path to current node in device tree + + fdt pwd + + Print path to the current node in the device tree. + The current node can be changed with fdt cd. + +### +# Tfdt Srm DRemove node or property from device tree + + fdt rm name + + The named node or property will be removed from the device tree. + +### Modified: head/sys/boot/powerpc/ps3/Makefile == --- head/sys/boot/powerpc/ps3/Makefile Mon Feb 11 00:50:52 2013 (r246646) +++ head/sys/boot/powerpc/ps3/Makefile Mon Feb 11 02:15:26 2013 (r246647) @@ -108,7 +108,7 @@ font.h: vers.c:${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} -loader.help: help.common help.ps3 +loader.help: help.common help.ps3 ${.CURDIR}/../../fdt/help.fdt cat
svn commit: r246600 - head/usr.bin
Author: kientzle Date: Sat Feb 9 18:14:26 2013 New Revision: 246600 URL: http://svnweb.freebsd.org/changeset/base/246600 Log: Add dtc to the build. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Sat Feb 9 18:00:29 2013(r246599) +++ head/usr.bin/Makefile Sat Feb 9 18:14:26 2013(r246600) @@ -37,6 +37,7 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ + dtc \ du \ ee \ elf2aout \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r246601 - head/sys/arm/arm
Author: kientzle Date: Sat Feb 9 21:36:14 2013 New Revision: 246601 URL: http://svnweb.freebsd.org/changeset/base/246601 Log: Fix breakage introduced in r246318. Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c == --- head/sys/arm/arm/vm_machdep.c Sat Feb 9 18:14:26 2013 (r246600) +++ head/sys/arm/arm/vm_machdep.c Sat Feb 9 21:36:14 2013 (r246601) @@ -402,7 +402,8 @@ cpu_thread_alloc(struct thread *td) * the ARM EABI. */ td-td_frame = (struct trapframe *)STACKALIGN((u_int)td-td_kstack + - USPACE_SVC_STACK_TOP - sizeof(struct pcb) - 1); + USPACE_SVC_STACK_TOP - sizeof(struct pcb) - + sizeof(struct trapframe)); #ifdef __XSCALE__ #ifndef CPU_XSCALE_CORE3 pmap_use_minicache(td-td_kstack, td-td_kstack_pages * PAGE_SIZE); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r245803 - in head: . gnu/usr.bin share/man/man5 share/mk usr.bin/dtc
I'm finding it rather annoying that dtc isn't installed on systems that use device trees. Would there be any negative fallout from installing /usr/bin/dtc as part of the regular world? Tim P.S. In particular, I'm moving away from compiled-in device trees (in favor of having the loader read it from a separate file) in part so that the device tree file can be adjusted without having to recompile the kernel. On Jan 22, 2013, at 9:49 AM, David Chisnall wrote: Author: theraven Date: Tue Jan 22 17:49:51 2013 New Revision: 245803 URL: http://svnweb.freebsd.org/changeset/base/245803 Log: Import new (BSDL) device tree compiler. Now built by default, so that it can't be used on the host system (and not installed on the device, if required). The GPL'd one is still available if there are any devices that need it (make universe passes with it, including kernels that use fdt, but there may be some out-of-tree ones). WITH_GPL_DTC can be used to select the old one, for now. Probably won't be MFC'd, but we'll remove the GPL'd version in head after the new one has had a lot more testing and ship it in 10.0. Added: head/usr.bin/dtc/ head/usr.bin/dtc/HACKING (contents, props changed) head/usr.bin/dtc/Makefile (contents, props changed) head/usr.bin/dtc/checking.cc (contents, props changed) head/usr.bin/dtc/checking.hh (contents, props changed) head/usr.bin/dtc/dtb.cc (contents, props changed) head/usr.bin/dtc/dtb.hh (contents, props changed) head/usr.bin/dtc/dtc.1 (contents, props changed) head/usr.bin/dtc/dtc.cc (contents, props changed) head/usr.bin/dtc/fdt.cc (contents, props changed) head/usr.bin/dtc/fdt.hh (contents, props changed) head/usr.bin/dtc/input_buffer.cc (contents, props changed) head/usr.bin/dtc/input_buffer.hh (contents, props changed) head/usr.bin/dtc/string.cc (contents, props changed) head/usr.bin/dtc/string.hh (contents, props changed) head/usr.bin/dtc/util.hh (contents, props changed) Modified: head/Makefile.inc1 head/gnu/usr.bin/Makefile head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 == --- head/Makefile.inc1Tue Jan 22 17:21:08 2013(r245802) +++ head/Makefile.inc1Tue Jan 22 17:49:51 2013(r245803) @@ -1112,7 +1112,10 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif -.if ${MK_FDT} != no +# Default to building the BSDL DTC, but build the GPL one if users explicitly +# request it. +_dtc= /usr.bin/dtc +.if ${MK_GPL_DTC} != no _dtc= gnu/usr.bin/dtc .endif Modified: head/gnu/usr.bin/Makefile == --- head/gnu/usr.bin/Makefile Tue Jan 22 17:21:08 2013(r245802) +++ head/gnu/usr.bin/Makefile Tue Jan 22 17:49:51 2013(r245803) @@ -30,7 +30,7 @@ _groff= groff _cvs= cvs .endif -.if ${MK_FDT}!= no +.if ${MK_GPL_DTC} != no _dtc= dtc .endif Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5Tue Jan 22 17:21:08 2013 (r245802) +++ head/share/man/man5/src.conf.5Tue Jan 22 17:49:51 2013 (r245803) @@ -476,6 +476,9 @@ Set to not build GPIB bus support. Set to not build .Xr gpioctl 8 as part of the base system. +.It Va WITH_GPL_DTC +Set to build the GPL'd version of the device tree compiler from elinux.org, +instead of the BSD licensed one. .It Va WITHOUT_GROFF .\ from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build Modified: head/share/mk/bsd.own.mk == --- head/share/mk/bsd.own.mk Tue Jan 22 17:21:08 2013(r245802) +++ head/share/mk/bsd.own.mk Tue Jan 22 17:49:51 2013(r245803) @@ -364,6 +364,7 @@ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ CTF \ +GPL_DTC \ HESIOD \ ICONV \ IDEA \ Added: head/usr.bin/dtc/HACKING == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/dtc/HACKING Tue Jan 22 17:49:51 2013(r245803) @@ -0,0 +1,65 @@ +$FreeBSD$ + +Notes for people hacking on dtc +=== + +This file contains some notes for people wishing to hack on dtc. + +Upstreaming +--- + +This code is developed in the FreeBSD svn repository: + +https://svn.freebsd.org/base/head/usr.bin/dtc + +If you got the source from anywhere else and wish to make changes, please +ensure that you are working against the latest version, or you may end up +fixing bugs that are already
svn commit: r246276 - head/sys/arm/ti/cpsw
Author: kientzle Date: Sun Feb 3 01:08:01 2013 New Revision: 246276 URL: http://svnweb.freebsd.org/changeset/base/246276 Log: Another overhaul of the CPSW driver for BeagleBone Major changes: * Finally tracked down the flow control setting that seems to have been causing TX stalls and watchdog timeouts * RX and TX paths now share a lot more code * TX interrupt is no longer used; we instead GC finished tx queue entries at the bottom of the start routine. * TX start now queues fragmented packets directly; it only invokes defrag() for occasional very fragmented packets. * sysctl dev.cpsw dumps controller statistics and queue counts * Host Error Interrupt will give extensive debugging information if the controller chokes on the queued data. Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Feb 3 00:19:34 2013 (r246275) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Feb 3 01:08:01 2013 (r246276) @@ -25,8 +25,22 @@ */ /* - * TI 3 Port Switch Ethernet (CPSW) Driver - * Found in TI8148, AM335x SoCs + * TI Common Platform Ethernet Switch (CPSW) Driver + * Found in TI8148 DaVinci and AM335x Sitara SoCs. + * + * This controller is documented in the AM335x Technical Reference + * Manual, in the TMS320DM814x DaVinci Digital Video Processors TRM + * and in the TMS320C6452 3 Port Switch Ethernet Subsystem TRM. + * + * It is basically a single Ethernet port (port 0) wired internally to + * a 3-port store-and-forward switch connected to two independent + * sliver controllers (port 1 and port 2). You can operate the + * controller in a variety of different ways by suitably configuring + * the slivers and the Address Lookup Engine (ALE) that routes packets + * between the ports. + * + * This code was developed and tested on a BeagleBone with + * an AM335x SoC. */ #include sys/cdefs.h @@ -76,44 +90,82 @@ __FBSDID($FreeBSD$); #include miibus_if.h -static int cpsw_probe(device_t dev); -static int cpsw_attach(device_t dev); -static int cpsw_detach(device_t dev); -static int cpsw_shutdown(device_t dev); -static int cpsw_suspend(device_t dev); -static int cpsw_resume(device_t dev); - -static int cpsw_miibus_readreg(device_t dev, int phy, int reg); -static int cpsw_miibus_writereg(device_t dev, int phy, int reg, int value); - -static int cpsw_ifmedia_upd(struct ifnet *ifp); -static void cpsw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); - -static void cpsw_init(void *arg); -static void cpsw_init_locked(void *arg); -static void cpsw_start(struct ifnet *ifp); -static void cpsw_start_locked(struct ifnet *ifp); -static void cpsw_stop_locked(struct cpsw_softc *sc); -static int cpsw_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static int cpsw_init_slot_lists(struct cpsw_softc *sc); -static void cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot); -static void cpsw_fill_rx_queue_locked(struct cpsw_softc *sc); -static void cpsw_tx_watchdog(struct cpsw_softc *sc); +/* Device probe/attach/detach. */ +static int cpsw_probe(device_t); +static void cpsw_init_slots(struct cpsw_softc *); +static int cpsw_attach(device_t); +static void cpsw_free_slot(struct cpsw_softc *, struct cpsw_slot *); +static int cpsw_detach(device_t); + +/* Device Init/shutdown. */ +static void cpsw_init(void *); +static void cpsw_init_locked(void *); +static int cpsw_shutdown(device_t); +static void cpsw_shutdown_locked(struct cpsw_softc *); + +/* Device Suspend/Resume. */ +static int cpsw_suspend(device_t); +static int cpsw_resume(device_t); -static void cpsw_intr_rx_thresh(void *arg); +/* Ioctl. */ +static int cpsw_ioctl(struct ifnet *, u_long command, caddr_t data); + +static int cpsw_miibus_readreg(device_t, int phy, int reg); +static int cpsw_miibus_writereg(device_t, int phy, int reg, int value); + +/* Send/Receive packets. */ static void cpsw_intr_rx(void *arg); -static void cpsw_intr_rx_locked(void *arg); -static void cpsw_intr_tx(void *arg); -static void cpsw_intr_tx_locked(void *arg); -static void cpsw_intr_misc(void *arg); - -static void cpsw_ale_read_entry(struct cpsw_softc *sc, uint16_t idx, uint32_t *ale_entry); -static void cpsw_ale_write_entry(struct cpsw_softc *sc, uint16_t idx, uint32_t *ale_entry); -static int cpsw_ale_uc_entry_set(struct cpsw_softc *sc, uint8_t port, uint8_t *mac); -static int cpsw_ale_mc_entry_set(struct cpsw_softc *sc, uint8_t portmap, uint8_t *mac); -#ifdef CPSW_DEBUG -static void cpsw_ale_dump_table(struct cpsw_softc *sc); -#endif +static struct mbuf *cpsw_rx_dequeue(struct cpsw_softc *); +static void cpsw_rx_enqueue(struct cpsw_softc *); +static void cpsw_start(struct ifnet *); +static void cpsw_tx_enqueue(struct cpsw_softc *); +static int cpsw_tx_dequeue(struct cpsw_softc *);
svn commit: r246228 - head/sys/arm/conf
Author: kientzle Date: Sat Feb 2 06:01:57 2013 New Revision: 246228 URL: http://svnweb.freebsd.org/changeset/base/246228 Log: Tweaks to standard BEAGLEBONE config, as recently discussed on FreeBSD-ARM. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE == --- head/sys/arm/conf/BEAGLEBONESat Feb 2 02:00:29 2013 (r246227) +++ head/sys/arm/conf/BEAGLEBONESat Feb 2 06:01:57 2013 (r246228) @@ -37,6 +37,7 @@ options MSDOSFS #MSDOS Filesystem optionsCD9660 #ISO 9660 Filesystem optionsPROCFS #Process filesystem (requires PSEUDOFS) optionsPSEUDOFS#Pseudo-filesystem framework +optionsTMPFS #Efficient memory filesystem optionsCOMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] optionsSCSI_DELAY=5000 #Delay (in ms) before probing SCSI optionsKTRACE #ktrace(1) support @@ -61,9 +62,9 @@ options WITNESS_SKIPSPIN#Don't run wit #options DIAGNOSTIC # NFS support -#options NFSCL +optionsNFSCL #options NFSD -#options NFSLOCKD +optionsNFSLOCKD # Uncomment this for NFS root #options NFS_ROOT#NFS usable as /, requires NFSCL @@ -124,4 +125,3 @@ device axe # ASIX Electronics USB Eth options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=beaglebone.dts - ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r246229 - in head/contrib/libarchive/libarchive: . test
Author: kientzle Date: Sat Feb 2 06:06:39 2013 New Revision: 246229 URL: http://svnweb.freebsd.org/changeset/base/246229 Log: Fix an obvious typo that broke time specifications of the form 2 hours ago. Modified: head/contrib/libarchive/libarchive/archive_getdate.c head/contrib/libarchive/libarchive/test/test_archive_getdate.c Modified: head/contrib/libarchive/libarchive/archive_getdate.c == --- head/contrib/libarchive/libarchive/archive_getdate.cSat Feb 2 06:01:57 2013(r246228) +++ head/contrib/libarchive/libarchive/archive_getdate.cSat Feb 2 06:06:39 2013(r246229) @@ -369,8 +369,8 @@ relunitphrase(struct gdstate *gds) gds-tokenp[1].token == tSEC_UNIT) { /* 1 day */ gds-HaveRel++; - gds-RelSeconds += gds-tokenp[1].value * gds-tokenp[2].value; - gds-tokenp += 3; + gds-RelSeconds += gds-tokenp[0].value * gds-tokenp[1].value; + gds-tokenp += 2; return 1; } if (gds-tokenp[0].token == '-' @@ -403,7 +403,7 @@ relunitphrase(struct gdstate *gds) /* now, tomorrow */ gds-HaveRel++; gds-RelSeconds += gds-tokenp[0].value; - ++gds-tokenp; + gds-tokenp += 1; return 1; } if (gds-tokenp[0].token == tMONTH_UNIT) { @@ -1022,10 +1022,11 @@ int main(int argc, char **argv) { time_t d; +time_t now = time(NULL); while (*++argv != NULL) { (void)printf(Input: %s\n, *argv); - d = get_date(*argv); + d = get_date(now, *argv); if (d == -1) (void)printf(Bad format - couldn't convert.\n); else Modified: head/contrib/libarchive/libarchive/test/test_archive_getdate.c == --- head/contrib/libarchive/libarchive/test/test_archive_getdate.c Sat Feb 2 06:01:57 2013(r246228) +++ head/contrib/libarchive/libarchive/test/test_archive_getdate.c Sat Feb 2 06:06:39 2013(r246229) @@ -43,6 +43,8 @@ DEFINE_TEST(test_archive_getdate) assertEqualInt(get_date(now, 2004/01/29 513 mest), 1075345980); assertEqualInt(get_date(now, 99/02/17 7pm utc), 919278000); assertEqualInt(get_date(now, 02/17/99 7:11am est), 919253460); + assertEqualInt(get_date(now, now - 2 hours), + get_date(now, 2 hours ago)); /* It's important that we handle ctime() format. */ assertEqualInt(get_date(now, Sun Feb 22 17:38:26 PST 2009), 1235353106); @@ -77,5 +79,6 @@ DEFINE_TEST(test_archive_getdate) /* last tuesday is one week before tuesday */ assertEqualInt(get_date(now, last tuesday UTC), now - 6 * 24 * 60 * 60); + /* TODO: Lots more tests here. */ } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r245703 - head/sys/boot/fdt/dts
Author: kientzle Date: Mon Jan 21 01:02:49 2013 New Revision: 245703 URL: http://svnweb.freebsd.org/changeset/base/245703 Log: Use correct size for AM335x CPSW memory window. Modified: head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/beaglebone.dts == --- head/sys/boot/fdt/dts/beaglebone.dtsMon Jan 21 01:01:32 2013 (r245702) +++ head/sys/boot/fdt/dts/beaglebone.dtsMon Jan 21 01:02:49 2013 (r245703) @@ -161,7 +161,7 @@ #address-cells = 1; #size-cells = 1; compatible = ti,cpsw; - reg = 0x4A10 0x3000; + reg = 0x4A10 0x4000; interrupts = 40 41 42 43; interrupt-parent = AINTC; phy-handle = phy0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r245672 - head/sys/arm/ti
Author: kientzle Date: Sat Jan 19 17:12:23 2013 New Revision: 245672 URL: http://svnweb.freebsd.org/changeset/base/245672 Log: Clarify the error messages for unrecognized pins and muxtypes. Modified: head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_scm.c == --- head/sys/arm/ti/ti_scm.cSat Jan 19 16:22:41 2013(r245671) +++ head/sys/arm/ti/ti_scm.cSat Jan 19 17:12:23 2013(r245672) @@ -155,8 +155,10 @@ ti_scm_padconf_set_internal(struct ti_sc } /* couldn't find the mux mode */ - if (mode = 8) + if (mode = 8) { + printf(Invalid mode \%s\\n, muxmode); return (EINVAL); + } /* set the mux mode */ reg_val |= (uint16_t)(mode ti_scm_dev.padconf_muxmode_mask); @@ -391,13 +393,16 @@ ti_scm_padconf_init_from_fdt(struct ti_s while (padstates-state != NULL) { if (strcmp(padstates-state, padstate) == 0) { err = ti_scm_padconf_set_internal(sc, - padconf, muxname, padstates-reg); + padconf, muxname, padstates-reg); } padstates++; } if (err) - device_printf(sc-sc_dev, err: failed to configure - pin \%s\\n, padconf-ballname); + device_printf(sc-sc_dev, + err: failed to configure + pin \%s\ as \%s\\n, + padconf-ballname, + muxname); } padconf++; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r245673 - head/sys/boot/fdt/dts
Author: kientzle Date: Sat Jan 19 17:22:12 2013 New Revision: 245673 URL: http://svnweb.freebsd.org/changeset/base/245673 Log: Use correct GPIO interrupt lines. Modified: head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/beaglebone.dts == --- head/sys/boot/fdt/dts/beaglebone.dtsSat Jan 19 17:12:23 2013 (r245672) +++ head/sys/boot/fdt/dts/beaglebone.dtsSat Jan 19 17:22:12 2013 (r245673) @@ -125,7 +125,7 @@ 0x4804C000 0x1000 0x481AC000 0x1000 0x481AE000 0x1000 ; - interrupts = 17 19 21 23 ; + interrupts = 96 97 98 99 32 33 62 63 ; interrupt-parent = AINTC; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r245064 - head/sys/arm/ti/cpsw
Author: kientzle Date: Sat Jan 5 17:59:44 2013 New Revision: 245064 URL: http://svnweb.freebsd.org/changeset/base/245064 Log: While trying to track down the root cause for TX stalls in this driver, I've also had some time to evaluate the effectiveness of different watchdog strategies. This is the latest attempt, which consolidates all of the watchdog logic in one place and consistently detects TX stalls and resets within a couple of seconds. Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 17:41:21 2013 (r245063) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 17:59:44 2013 (r245064) @@ -98,7 +98,7 @@ static int cpsw_ioctl(struct ifnet *ifp, static int cpsw_init_slot_lists(struct cpsw_softc *sc); static void cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot); static void cpsw_fill_rx_queue_locked(struct cpsw_softc *sc); -static void cpsw_watchdog(struct cpsw_softc *sc); +static void cpsw_tx_watchdog(struct cpsw_softc *sc); static void cpsw_intr_rx_thresh(void *arg); static void cpsw_intr_rx(void *arg); @@ -737,13 +737,7 @@ cpsw_start_locked(struct ifnet *ifp) cpsw_cpdma_write_txbd_next(prev_slot-index, cpsw_cpdma_txbd_paddr(first_new_slot-index)); } - /* If tx_retires hasn't changed, then we may have - lost a TX interrupt, so let the timer tick. */ sc-tx_enqueues += enqueued; - if (sc-tx_retires_at_wd_reset != sc-tx_retires) { - sc-tx_retires_at_wd_reset = sc-tx_retires; - sc-wd_timer = 5; - } sc-tx_queued += enqueued; if (sc-tx_queued sc-tx_max_queued) { sc-tx_max_queued = sc-tx_queued; @@ -771,7 +765,6 @@ cpsw_stop_locked(struct cpsw_softc *sc) /* Stop tick engine */ callout_stop(sc-wd_callout); - sc-wd_timer = 0; /* Wait for hardware to clear pending ops. */ CPSW_GLOBAL_UNLOCK(sc); @@ -1185,7 +1178,6 @@ cpsw_intr_tx_locked(void *arg) } sc-tx_retires += retires; sc-tx_queued -= retires; - sc-wd_timer = 0; } } @@ -1206,7 +1198,7 @@ cpsw_tick(void *msc) struct cpsw_softc *sc = msc; /* Check for TX timeout */ - cpsw_watchdog(sc); + cpsw_tx_watchdog(sc); mii_tick(sc-mii); @@ -1222,21 +1214,28 @@ cpsw_tick(void *msc) } static void -cpsw_watchdog(struct cpsw_softc *sc) +cpsw_tx_watchdog(struct cpsw_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp = sc-ifp; - ifp = sc-ifp; CPSW_GLOBAL_LOCK(sc); - if (sc-wd_timer == 0 || --sc-wd_timer) { - CPSW_GLOBAL_UNLOCK(sc); - return; + if (sc-tx_retires sc-tx_retires_at_last_tick) { + sc-tx_wd_timer = 0; /* Stuff got sent. */ + } else if (sc-tx_queued == 0) { + sc-tx_wd_timer = 0; /* Nothing to send. */ + } else { + /* There was something to send but we didn't. */ + ++sc-tx_wd_timer; + if (sc-tx_wd_timer 3) { + sc-tx_wd_timer = 0; + ifp-if_oerrors++; + if_printf(ifp, watchdog timeout\n); + cpsw_stop_locked(sc); + cpsw_init_locked(sc); + CPSW_DEBUGF((watchdog reset completed\n)); + } } - - ifp-if_oerrors++; - if_printf(ifp, watchdog timeout\n); - cpsw_stop_locked(sc); - cpsw_init_locked(sc); + sc-tx_retires_at_last_tick = sc-tx_retires; CPSW_GLOBAL_UNLOCK(sc); } @@ -1381,7 +1380,7 @@ cpsw_init_locked(void *arg) /* Activate network interface */ sc-rx_running = 1; sc-tx_running = 1; - sc-wd_timer = 0; + sc-tx_wd_timer = 0; callout_reset(sc-wd_callout, hz, cpsw_tick, sc); sc-ifp-if_drv_flags |= IFF_DRV_RUNNING; sc-ifp-if_drv_flags = ~IFF_DRV_OACTIVE; Modified: head/sys/arm/ti/cpsw/if_cpswvar.h == --- head/sys/arm/ti/cpsw/if_cpswvar.h Sat Jan 5 17:41:21 2013 (r245063) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Sat Jan 5 17:59:44 2013 (r245064) @@ -63,7 +63,7 @@ struct cpsw_softc { int cpsw_media_status; struct callout wd_callout; - int wd_timer; + int tx_wd_timer; bus_dma_tag_t mbuf_dtag; @@ -82,7 +82,7 @@ struct cpsw_softc { /* Statistics */ uint32_ttx_enqueues; /* total TX bufs added to queue */ uint32_ttx_retires; /* total TX bufs removed from queue */ - uint32_ttx_retires_at_wd_reset; /* used
svn commit: r245068 - head/sys/arm/conf
Author: kientzle Date: Sat Jan 5 20:30:10 2013 New Revision: 245068 URL: http://svnweb.freebsd.org/changeset/base/245068 Log: Prefer the new NFS modules Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE == --- head/sys/arm/conf/BEAGLEBONESat Jan 5 20:07:28 2013 (r245067) +++ head/sys/arm/conf/BEAGLEBONESat Jan 5 20:30:10 2013 (r245068) @@ -62,11 +62,11 @@ options WITNESS_SKIPSPIN#Don't run wit # NFS support #options NFSCL -#options NFSSERVER #Network Filesystem Server -#options NFSCLIENT #Network Filesystem Client +#options NFSD +#options NFSLOCKD # Uncomment this for NFS root -#options NFS_ROOT#NFS usable as /, requires NFSCLIENT +#options NFS_ROOT#NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r245070 - head/sys/arm/ti/cpsw
Author: kientzle Date: Sat Jan 5 20:37:40 2013 New Revision: 245070 URL: http://svnweb.freebsd.org/changeset/base/245070 Log: Shuffle the TX underrun to work the same way as the RX underrun, as suggested by YongHyeon PYUN. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 20:37:14 2013 (r245069) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 20:37:40 2013 (r245070) @@ -716,26 +716,22 @@ cpsw_start_locked(struct ifnet *ifp) if (STAILQ_EMPTY(newslots)) return; - /* Attach new segments to the hardware TX queue. */ + /* Attach the list of new buffers to the hardware TX queue. */ prev_slot = STAILQ_LAST(sc-tx_active, cpsw_slot, next); first_new_slot = STAILQ_FIRST(newslots); STAILQ_CONCAT(sc-tx_active, newslots); if (prev_slot == NULL) { /* Start the TX queue fresh. */ cpsw_write_4(CPSW_CPDMA_TX_HDP(0), -cpsw_cpdma_txbd_paddr(first_new_slot-index)); + cpsw_cpdma_txbd_paddr(first_new_slot-index)); } else { - /* Add packets to current queue. */ - /* Race: The hardware might have sent the last packet -* on the queue and stopped the transmitter just -* before we got here. In that case, this is a no-op, -* but it also means there's a TX interrupt waiting -* to be processed as soon as we release the lock here. -* That TX interrupt can detect and recover from this -* situation; see cpsw_intr_tx_locked. -*/ + /* Add buffers to end of current queue. */ cpsw_cpdma_write_txbd_next(prev_slot-index, cpsw_cpdma_txbd_paddr(first_new_slot-index)); + /* If underrun, restart queue. */ + if (cpsw_cpdma_read_txbd_flags(prev_slot-index) CPDMA_BD_EOQ) + cpsw_write_4(CPSW_CPDMA_TX_HDP(0), + cpsw_cpdma_txbd_paddr(first_new_slot-index)); } sc-tx_enqueues += enqueued; sc-tx_queued += enqueued; @@ -1091,14 +1087,10 @@ cpsw_fill_rx_queue_locked(struct cpsw_so cpsw_write_4(CPSW_CPDMA_RX_HDP(0), cpsw_cpdma_rxbd_paddr(next_slot-index)); } else { - /* Extend an existing RX queue. */ + /* Add buffers to end of current queue. */ cpsw_cpdma_write_rxbd_next(prev_slot-index, cpsw_cpdma_rxbd_paddr(next_slot-index)); - /* XXX Order matters: Previous write must complete - before next read begins in order to avoid an - end-of-queue race. I think bus_write and bus_read have - sufficient barriers built-in to ensure this. XXX */ - /* If old RX queue was stopped, restart it. */ + /* If underrun, restart queue. */ if (cpsw_cpdma_read_rxbd_flags(prev_slot-index) CPDMA_BD_EOQ) { cpsw_write_4(CPSW_CPDMA_RX_HDP(0), cpsw_cpdma_rxbd_paddr(next_slot-index)); @@ -1170,12 +1162,6 @@ cpsw_intr_tx_locked(void *arg) /* Tell hardware the last item we dequeued. */ cpsw_write_4(CPSW_CPDMA_TX_CP(0), cpsw_cpdma_txbd_paddr(last_slot-index)); - /* If transmitter stopped and there's more, restart it. */ - /* This resolves the race described in tx_start above. */ - if ((last_flags CPDMA_BD_EOQ) (slot != NULL)) { - cpsw_write_4(CPSW_CPDMA_TX_HDP(0), -cpsw_cpdma_txbd_paddr(slot-index)); - } sc-tx_retires += retires; sc-tx_queued -= retires; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r244939 - head/sys/arm/ti/cpsw
Author: kientzle Date: Tue Jan 1 18:55:04 2013 New Revision: 244939 URL: http://svnweb.freebsd.org/changeset/base/244939 Log: Overhauled CPSW driver for TI CPSW Ethernet module (as used in AM335x SoC for BeagleBone). Among other things: * Watchdog reset doesn't hang the driver. * Disconnecting cable doesn't hang the driver. * ifconfig up/down doesn't hang the driver * Out-of-memory no longer panics the driver. Known issues: * Doesn't have good support for fragmented packets (calls m_defrag() on TX, assumes RX packets are never fragmented) * Promisc and allmulti still unimplimented * addmulti and delmulti still unimplemented * TX queue still stalls (but watchdog now consistently recovers in ~5s) * No sysctl monitoring * Only supports port0 * No switch configuration support * Not tested on anything but BeagleBone Committed from: BeagleBone Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Tue Jan 1 18:54:55 2013 (r244938) +++ head/sys/arm/ti/cpsw/if_cpsw.c Tue Jan 1 18:55:04 2013 (r244939) @@ -95,9 +95,9 @@ static void cpsw_start(struct ifnet *ifp static void cpsw_start_locked(struct ifnet *ifp); static void cpsw_stop_locked(struct cpsw_softc *sc); static int cpsw_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static int cpsw_allocate_dma(struct cpsw_softc *sc); -static int cpsw_free_dma(struct cpsw_softc *sc); -static int cpsw_new_rxbuf(struct cpsw_softc *sc, uint32_t i, uint32_t next); +static int cpsw_init_slot_lists(struct cpsw_softc *sc); +static void cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot); +static void cpsw_fill_rx_queue_locked(struct cpsw_softc *sc); static void cpsw_watchdog(struct cpsw_softc *sc); static void cpsw_intr_rx_thresh(void *arg); @@ -156,10 +156,10 @@ static struct { driver_intr_t *handler; char * description; } cpsw_intrs[CPSW_INTR_COUNT + 1] = { - { cpsw_intr_rx_thresh,CPSW RX threshold interrupt }, + { cpsw_intr_rx_thresh, CPSW RX threshold interrupt }, { cpsw_intr_rx, CPSW RX interrupt }, { cpsw_intr_tx, CPSW TX interrupt }, - { cpsw_intr_misc,CPSW misc interrupt }, + { cpsw_intr_misc, CPSW misc interrupt }, }; /* Locking macros */ @@ -199,6 +199,34 @@ static struct { } while (0) +#include machine/stdarg.h +static void +cpsw_debugf_head(const char *funcname) +{ + int t = (int)(time_second % (24 * 60 * 60)); + + printf(%02d:%02d:%02d %s , t / (60 * 60), (t / 60) % 60, t % 60, funcname); +} + +static void +cpsw_debugf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf(\n); + +} + +#define CPSW_DEBUGF(a) do {\ + if (sc-cpsw_if_flags IFF_DEBUG) {\ + cpsw_debugf_head(__func__); \ + cpsw_debugf a; \ + } \ +} while (0) + static int cpsw_probe(device_t dev) { @@ -213,18 +241,20 @@ cpsw_probe(device_t dev) static int cpsw_attach(device_t dev) { - struct cpsw_softc *sc; + struct cpsw_softc *sc = device_get_softc(dev); struct mii_softc *miisc; struct ifnet *ifp; + void *phy_sc; int i, error, phy; uint32_t reg; - sc = device_get_softc(dev); + CPSW_DEBUGF(()); + sc-dev = dev; sc-node = ofw_bus_get_node(dev); /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc-node, sc-dev, phy, (void **)sc-phy_sc) != 0) { + if (fdt_get_phyaddr(sc-node, sc-dev, phy, phy_sc) != 0) { device_printf(dev, failed to get PHY address from FDT\n); return (ENXIO); } @@ -246,14 +276,32 @@ cpsw_attach(device_t dev) device_printf(dev, Version %d.%d (%d)\n, (reg 8 0x7), reg 0xFF, (reg 11) 0x1F); - /* Allocate DMA, buffers, buffer descriptors */ - error = cpsw_allocate_dma(sc); + //cpsw_add_sysctls(sc); TODO + + /* Allocate a busdma tag and DMA safe memory for mbufs. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc-dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MCLBYTES, 1,/* maxsize, nsegments */ + MCLBYTES, 0,/* maxsegsz, flags */ +
svn commit: r243523 - in head/sys/arm: arm broadcom/bcm2835 ti/am335x
Author: kientzle Date: Sun Nov 25 16:19:12 2012 New Revision: 243523 URL: http://svnweb.freebsd.org/changeset/base/243523 Log: Fix spelling. Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/arm/mpcore_timer.c == --- head/sys/arm/arm/mpcore_timer.c Sun Nov 25 15:58:35 2012 (r243522) +++ head/sys/arm/arm/mpcore_timer.c Sun Nov 25 16:19:12 2012 (r243523) @@ -128,7 +128,7 @@ static struct arm_tmr_softc *arm_tmr_sc static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { - .tc_name = ARM MPCore Timecouter, + .tc_name = ARM MPCore Timecounter, .tc_get_timecount = arm_tmr_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.cSun Nov 25 15:58:35 2012(r243522) +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.cSun Nov 25 16:19:12 2012(r243523) @@ -102,7 +102,7 @@ static struct bcm_systimer_softc *bcm_sy static unsigned bcm_systimer_tc_get_timecount(struct timecounter *); static struct timecounter bcm_systimer_tc = { - .tc_name = BCM2835 Timecouter, + .tc_name = BCM2835 Timecounter, .tc_get_timecount = bcm_systimer_tc_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c == --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Nov 25 15:58:35 2012 (r243522) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Nov 25 16:19:12 2012 (r243523) @@ -128,7 +128,7 @@ static struct am335x_dmtimer *am335x_dmt static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *); static struct timecounter am335x_dmtimer_tc = { - .tc_name = AM335x Timecouter, + .tc_name = AM335x Timecounter, .tc_get_timecount = am335x_dmtimer_tc_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r243526 - head/sys/boot/uboot/lib
Author: kientzle Date: Sun Nov 25 18:22:53 2012 New Revision: 243526 URL: http://svnweb.freebsd.org/changeset/base/243526 Log: Print kernel args when booting the kernel. Modified: head/sys/boot/uboot/lib/elf_freebsd.c Modified: head/sys/boot/uboot/lib/elf_freebsd.c == --- head/sys/boot/uboot/lib/elf_freebsd.c Sun Nov 25 16:54:43 2012 (r243525) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sun Nov 25 18:22:53 2012 (r243526) @@ -82,6 +82,7 @@ __elfN(uboot_exec)(struct preloaded_file entry = uboot_vm_translate(e-e_entry); printf(Kernel entry at 0x%x...\n, (unsigned)entry); + printf(Kernel args: %s\n, fp-f_args); dev_cleanup(); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r242402 - in head/sys: kern vm
On Nov 1, 2012, at 7:37 AM, Ian Lepore wrote: Back from some quick googling... yep, arm cortex-a8 processors have a 64-byte cache line size. Maybe we don't support those yet, which is why the value appears to be constant in arm param.h right now. Beaglebone runs a Cortex-A8. There's a lot of folks playing with those. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242277 - head/usr.sbin/kldxref
Author: kientzle Date: Mon Oct 29 03:31:22 2012 New Revision: 242277 URL: http://svn.freebsd.org/changeset/base/242277 Log: Clarify a warning message. Modified: head/usr.sbin/kldxref/ef.c Modified: head/usr.sbin/kldxref/ef.c == --- head/usr.sbin/kldxref/ef.c Mon Oct 29 02:10:20 2012(r242276) +++ head/usr.sbin/kldxref/ef.c Mon Oct 29 03:31:22 2012(r242277) @@ -600,7 +600,8 @@ ef_open(const char *filename, struct elf printf(\n); ef-ef_nsegs = nsegs; if (phdyn == NULL) { - warnx(file isn't dynamically-linked); + warnx(Skipping %s: not dynamically-linked, + filename); break; } if (ef_read_entry(ef, phdyn-p_offset, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242191 - head/sys/arm/ti
Author: kientzle Date: Sat Oct 27 22:13:42 2012 New Revision: 242191 URL: http://svn.freebsd.org/changeset/base/242191 Log: Missing paren. Pointy hat:me Modified: head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/ti/ti_machdep.c == --- head/sys/arm/ti/ti_machdep.cSat Oct 27 21:03:29 2012 (r242190) +++ head/sys/arm/ti/ti_machdep.cSat Oct 27 22:13:42 2012 (r242191) @@ -494,7 +494,7 @@ initarm(struct arm_boot_params *abp) env = getenv(kernelname); if (env != NULL) - strlcpy(kernelname, env, sizeof(kernelname); + strlcpy(kernelname, env, sizeof(kernelname)); if (err_devmap != 0) printf(WARNING: could not fully configure devmap, error=%d\n, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242171 - head/sys/arm/conf
Author: kientzle Date: Sat Oct 27 04:02:12 2012 New Revision: 242171 URL: http://svn.freebsd.org/changeset/base/242171 Log: Comment out the other BOOTP option This should make PANDABOARD suitable for building bootable SD images. Submitted by: Giovanni Trematerra Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD == --- head/sys/arm/conf/PANDABOARDSat Oct 27 02:39:08 2012 (r242170) +++ head/sys/arm/conf/PANDABOARDSat Oct 27 04:02:12 2012 (r242171) @@ -54,7 +54,7 @@ options NFS_ROOT#NFS usable as /, req #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP -optionsBOOTP_NFSV3 +#options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ue0 optionsMSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242124 - head/sys/arm/conf
Author: kientzle Date: Fri Oct 26 05:41:58 2012 New Revision: 242124 URL: http://svn.freebsd.org/changeset/base/242124 Log: Comment out the BOOTP/NFSROOT support. Transition this config file to support a production kernel mounted on an SD card. Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD == --- head/sys/arm/conf/PANDABOARDFri Oct 26 03:20:04 2012 (r242123) +++ head/sys/arm/conf/PANDABOARDFri Oct 26 05:41:58 2012 (r242124) @@ -44,17 +44,18 @@ options FFS #Berkeley Fast Filesystem optionsSOFTUPDATES #Enable FFS soft updates support optionsUFS_ACL #Support for access control lists optionsUFS_DIRHASH #Improve performance on big directories -optionsNFSCLIENT #Network Filesystem Client device snp +optionsBREAK_TO_DEBUGGER + #options NFSCL +optionsNFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT -optionsBREAK_TO_DEBUGGER -optionsBOOTP_NFSROOT -optionsBOOTP_COMPAT -optionsBOOTP +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP optionsBOOTP_NFSV3 -optionsBOOTP_WIRED_TO=ue0 +#options BOOTP_WIRED_TO=ue0 optionsMSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242125 - head/sys/arm/ti
Author: kientzle Date: Fri Oct 26 05:48:53 2012 New Revision: 242125 URL: http://svn.freebsd.org/changeset/base/242125 Log: set the kernelname from the boot loader environment. This fixes kern.bootfile sysctl. Submitted by: Giovanni Trematerra Modified: head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/ti/ti_machdep.c == --- head/sys/arm/ti/ti_machdep.cFri Oct 26 05:41:58 2012 (r242124) +++ head/sys/arm/ti/ti_machdep.cFri Oct 26 05:48:53 2012 (r242125) @@ -306,6 +306,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -491,6 +492,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv(kernelname); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname); + if (err_devmap != 0) printf(WARNING: could not fully configure devmap, error=%d\n, err_devmap); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242061 - head/sys/arm/conf
Author: kientzle Date: Thu Oct 25 04:10:32 2012 New Revision: 242061 URL: http://svn.freebsd.org/changeset/base/242061 Log: Support boot loaders in the standard kernel. Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B == --- head/sys/arm/conf/RPI-B Thu Oct 25 04:08:26 2012(r242060) +++ head/sys/arm/conf/RPI-B Thu Oct 25 04:10:32 2012(r242061) @@ -30,6 +30,8 @@ options KERNPHYSADDR=0x0010 makeoptionsKERNPHYSADDR=0x0010 optionsPHYSADDR=0x optionsSTARTUP_PAGETABLE_ADDR=0x0100 +optionsFREEBSD_BOOT_LOADER +optionsLINUX_BOOT_ABI makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols optionsHZ=100 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242062 - head/sys/arm/conf
Author: kientzle Date: Thu Oct 25 04:12:33 2012 New Revision: 242062 URL: http://svn.freebsd.org/changeset/base/242062 Log: Everybody needs bpf. Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD == --- head/sys/arm/conf/PANDABOARDThu Oct 25 04:10:32 2012 (r242061) +++ head/sys/arm/conf/PANDABOARDThu Oct 25 04:12:33 2012 (r242062) @@ -127,7 +127,7 @@ device da # Direct Access (disks) device miibus #deviceaxe # ASIX Electronics USB Ethernet device smsc# SMSC LAN95xx USB Ethernet - +device bpf # OMAP-specific devices device ti_sdma ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242063 - head/sys/arm/conf
Author: kientzle Date: Thu Oct 25 04:14:42 2012 New Revision: 242063 URL: http://svn.freebsd.org/changeset/base/242063 Log: Support FreeBSD Boot loaders. Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD == --- head/sys/arm/conf/PANDABOARDThu Oct 25 04:12:33 2012 (r242062) +++ head/sys/arm/conf/PANDABOARDThu Oct 25 04:14:42 2012 (r242063) @@ -67,6 +67,7 @@ options SYSVMSG #SYSV-style message q optionsSYSVSEM #SYSV-style semaphores options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev +optionsFREEBSD_BOOT_LOADER optionsPREEMPTION ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242067 - head/sys/arm/ti/cpsw
Author: kientzle Date: Thu Oct 25 04:33:47 2012 New Revision: 242067 URL: http://svn.freebsd.org/changeset/base/242067 Log: Refer to headers locally. This makes it a lot easier to build this driver out-of-tree. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Oct 25 04:30:48 2012 (r242066) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Oct 25 04:33:47 2012 (r242067) @@ -69,8 +69,8 @@ __FBSDID($FreeBSD$); #include dev/ofw/ofw_bus.h #include dev/ofw/ofw_bus_subr.h -#include arm/ti/cpsw/if_cpswreg.h -#include arm/ti/cpsw/if_cpswvar.h +#include if_cpswreg.h +#include if_cpswvar.h #include arm/ti/ti_scm.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r242068 - head/sys/arm/ti/cpsw
Author: kientzle Date: Thu Oct 25 04:37:47 2012 New Revision: 242068 URL: http://svn.freebsd.org/changeset/base/242068 Log: Do proper padding of runt packets using code copied from bge(4). Reviewed by: gnn Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Oct 25 04:33:47 2012 (r242067) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Oct 25 04:37:47 2012 (r242068) @@ -581,8 +581,8 @@ cpsw_encap(struct cpsw_softc *sc, struct bd.next = 0; bd.bufptr = seg-ds_addr; bd.bufoff = 0; - bd.buflen = (seg-ds_len 64 ? 64 : seg-ds_len); - bd.pktlen = (seg-ds_len 64 ? 64 : seg-ds_len); + bd.buflen = seg-ds_len; + bd.pktlen = seg-ds_len; /* Set OWNERSHIP, SOP, EOP */ bd.flags = (713); @@ -599,6 +599,49 @@ cpsw_encap(struct cpsw_softc *sc, struct return (0); } +/* + * Pad the packet to the minimum length for Ethernet. + * (CPSW hardware doesn't do this for us.) + */ +static int +cpsw_pad(struct mbuf *m) +{ + int padlen = ETHER_MIN_LEN - m-m_pkthdr.len; + struct mbuf *last, *n; + + if (padlen = 0) + return (0); + + /* If there's only the packet-header and we can pad there, use it. */ + if (m-m_pkthdr.len == m-m_len M_WRITABLE(m) + M_TRAILINGSPACE(m) = padlen) { + last = m; + } else { + /* +* Walk packet chain to find last mbuf. We will either +* pad there, or append a new mbuf and pad it. +*/ + for (last = m; last-m_next != NULL; last = last-m_next) + ; + if (!(M_WRITABLE(last) M_TRAILINGSPACE(last) = padlen)) { + /* Allocate new empty mbuf, pad it. Compact later. */ + MGET(n, M_DONTWAIT, MT_DATA); + if (n == NULL) + return (ENOBUFS); + n-m_len = 0; + last-m_next = n; + last = n; + } + } + + /* Now zero the pad area. */ + memset(mtod(last, caddr_t) + last-m_len, 0, padlen); + last-m_len += padlen; + m-m_pkthdr.len += padlen; + + return (0); +} + static void cpsw_start(struct ifnet *ifp) { @@ -615,6 +658,7 @@ cpsw_start_locked(struct ifnet *ifp) struct cpsw_softc *sc = ifp-if_softc; struct mbuf *m0, *mtmp; uint32_t queued = 0; + int error; CPSW_TX_LOCK_ASSERT(sc); @@ -628,6 +672,11 @@ cpsw_start_locked(struct ifnet *ifp) if (m0 == NULL) break; + if ((error = cpsw_pad(m0))) { + m_freem(m0); + continue; + } + mtmp = m_defrag(m0, M_NOWAIT); if (mtmp) m0 = mtmp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241831 - head/sys/arm/ti/cpsw
Author: kientzle Date: Mon Oct 22 02:28:48 2012 New Revision: 241831 URL: http://svn.freebsd.org/changeset/base/241831 Log: Don't repeat the POSTREAD dma sync. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 22 02:12:20 2012 (r241830) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 22 02:28:48 2012 (r241831) @@ -800,6 +800,7 @@ cpsw_intr_rx_locked(void *arg) cpsw_write_4(CPSW_CPDMA_RX_CP(0), cpsw_cpdma_rxbd_paddr(i)); bus_dmamap_sync(sc-mbuf_dtag, sc-rx_dmamap[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc-mbuf_dtag, sc-rx_dmamap[i]); /* Fill mbuf */ sc-rx_mbuf[i]-m_hdr.mh_data += bd.bufoff; @@ -817,11 +818,6 @@ cpsw_intr_rx_locked(void *arg) } } - bus_dmamap_sync(sc-mbuf_dtag, - sc-rx_dmamap[i], - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc-mbuf_dtag, sc-rx_dmamap[i]); - /* Handover packet */ CPSW_RX_UNLOCK(sc); (*ifp-if_input)(ifp, sc-rx_mbuf[i]); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241721 - head/sys/arm/ti/cpsw
Author: kientzle Date: Fri Oct 19 05:50:56 2012 New Revision: 241721 URL: http://svn.freebsd.org/changeset/base/241721 Log: Replace deprecated M_DONTWAIT with M_NOWAIT. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Oct 19 05:43:38 2012 (r241720) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Oct 19 05:50:56 2012 (r241721) @@ -522,7 +522,7 @@ cpsw_new_rxbuf(struct cpsw_softc *sc, ui int error; int nsegs; - sc-rx_mbuf[i] = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sc-rx_mbuf[i] = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (sc-rx_mbuf[i] == NULL) return (ENOBUFS); @@ -628,7 +628,7 @@ cpsw_start_locked(struct ifnet *ifp) if (m0 == NULL) break; - mtmp = m_defrag(m0, M_DONTWAIT); + mtmp = m_defrag(m0, M_NOWAIT); if (mtmp) m0 = mtmp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241562 - head/sys/arm/ti/cpsw
Author: kientzle Date: Sun Oct 14 22:58:12 2012 New Revision: 241562 URL: http://svn.freebsd.org/changeset/base/241562 Log: Return correct packet size. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 22:33:17 2012 (r241561) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 22:58:12 2012 (r241562) @@ -804,9 +804,9 @@ cpsw_intr_rx_locked(void *arg) bus_dmamap_sync(sc-mbuf_dtag, sc-rx_dmamap[i], BUS_DMASYNC_POSTREAD); /* Fill mbuf */ - sc-rx_mbuf[i]-m_hdr.mh_data +=2; - sc-rx_mbuf[i]-m_len = bd.pktlen-2; - sc-rx_mbuf[i]-m_pkthdr.len = bd.pktlen-2; + sc-rx_mbuf[i]-m_hdr.mh_data += bd.bufoff; + sc-rx_mbuf[i]-m_hdr.mh_len = bd.pktlen - 4; + sc-rx_mbuf[i]-m_pkthdr.len = bd.pktlen - 4; sc-rx_mbuf[i]-m_flags |= M_PKTHDR; sc-rx_mbuf[i]-m_pkthdr.rcvif = ifp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241563 - head/sys/arm/ti/cpsw
Author: kientzle Date: Sun Oct 14 23:00:24 2012 New Revision: 241563 URL: http://svn.freebsd.org/changeset/base/241563 Log: Name cpsw_stop to cpsw_stop_locked consistently with other functions in this file that assume locks are already held. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 22:58:12 2012 (r241562) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 23:00:24 2012 (r241563) @@ -93,7 +93,7 @@ static void cpsw_init(void *arg); static void cpsw_init_locked(void *arg); static void cpsw_start(struct ifnet *ifp); static void cpsw_start_locked(struct ifnet *ifp); -static void cpsw_stop(struct cpsw_softc *sc); +static void cpsw_stop_locked(struct cpsw_softc *sc); static int cpsw_ioctl(struct ifnet *ifp, u_long command, caddr_t data); static int cpsw_allocate_dma(struct cpsw_softc *sc); static int cpsw_free_dma(struct cpsw_softc *sc); @@ -397,7 +397,7 @@ cpsw_shutdown(device_t dev) CPSW_GLOBAL_LOCK(sc); - cpsw_stop(sc); + cpsw_stop_locked(sc); CPSW_GLOBAL_UNLOCK(sc); @@ -656,10 +656,12 @@ cpsw_start_locked(struct ifnet *ifp) } static void -cpsw_stop(struct cpsw_softc *sc) +cpsw_stop_locked(struct cpsw_softc *sc) { struct ifnet *ifp; + CPSW_GLOBAL_LOCK_ASSERT(sc) + ifp = sc-ifp; if ((ifp-if_drv_flags IFF_DRV_RUNNING) == 0) @@ -708,7 +710,7 @@ cpsw_ioctl(struct ifnet *ifp, u_long com } } else if (ifp-if_drv_flags IFF_DRV_RUNNING) - cpsw_stop(sc); + cpsw_stop_locked(sc); sc-cpsw_if_flags = ifp-if_flags; CPSW_GLOBAL_UNLOCK(sc); @@ -948,7 +950,7 @@ cpsw_watchdog(struct cpsw_softc *sc) ifp-if_oerrors++; if_printf(ifp, watchdog timeout\n); - cpsw_stop(sc); + cpsw_stop_locked(sc); cpsw_init_locked(sc); CPSW_GLOBAL_UNLOCK(sc); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241564 - head/sys/arm/ti/cpsw
Author: kientzle Date: Sun Oct 14 23:07:54 2012 New Revision: 241564 URL: http://svn.freebsd.org/changeset/base/241564 Log: Cut-and-paste dropped semicolon. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 23:00:24 2012 (r241563) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Oct 14 23:07:54 2012 (r241564) @@ -660,7 +660,7 @@ cpsw_stop_locked(struct cpsw_softc *sc) { struct ifnet *ifp; - CPSW_GLOBAL_LOCK_ASSERT(sc) + CPSW_GLOBAL_LOCK_ASSERT(sc); ifp = sc-ifp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241572 - head/sys/arm/ti/cpsw
Author: kientzle Date: Mon Oct 15 04:10:49 2012 New Revision: 241572 URL: http://svn.freebsd.org/changeset/base/241572 Log: Fix an mbuf leak in cpsw driver, clean up mbuf management: * Record TX mbufs when we get them so we can release them. * Set TX/RX mbuf slots to NULL when we are no longer responsible for them * Move dma sync on RX into RX intr routine Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 15 01:13:36 2012 (r241571) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 15 04:10:49 2012 (r241572) @@ -522,11 +522,6 @@ cpsw_new_rxbuf(struct cpsw_softc *sc, ui int error; int nsegs; - if (sc-rx_mbuf[i]) { - bus_dmamap_sync(sc-mbuf_dtag, sc-rx_dmamap[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc-mbuf_dtag, sc-rx_dmamap[i]); - } - sc-rx_mbuf[i] = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (sc-rx_mbuf[i] == NULL) return (ENOBUFS); @@ -593,6 +588,7 @@ cpsw_encap(struct cpsw_softc *sc, struct /* Write descriptor */ cpsw_cpdma_write_txbd(idx, bd); + sc-tx_mbuf[idx] = m0; /* Previous descriptor should point to us */ cpsw_cpdma_write_txbd_next(((idx-10)?(CPSW_MAX_TX_BUFFERS-1):(idx-1)), @@ -821,9 +817,15 @@ cpsw_intr_rx_locked(void *arg) } } + bus_dmamap_sync(sc-mbuf_dtag, + sc-rx_dmamap[i], + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc-mbuf_dtag, sc-rx_dmamap[i]); + /* Handover packet */ CPSW_RX_UNLOCK(sc); (*ifp-if_input)(ifp, sc-rx_mbuf[i]); + sc-rx_mbuf[i] = NULL; CPSW_RX_LOCK(sc); /* Allocate new buffer for current descriptor */ @@ -890,6 +892,7 @@ cpsw_intr_tx_locked(void *arg) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc-mbuf_dtag, sc-tx_dmamap[sc-txbd_head]); m_freem(sc-tx_mbuf[sc-txbd_head]); + sc-tx_mbuf[sc-txbd_head] = NULL; cpsw_write_4(CPSW_CPDMA_TX_CP(0), cpsw_cpdma_txbd_paddr(sc-txbd_head)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241255 - head/lib/libpmc
Author: kientzle Date: Sat Oct 6 17:54:42 2012 New Revision: 241255 URL: http://svn.freebsd.org/changeset/base/241255 Log: Fix make install Also make arm the same as other platforms: Install man pages for all CPUs in the family. Modified: head/lib/libpmc/Makefile Modified: head/lib/libpmc/Makefile == --- head/lib/libpmc/MakefileSat Oct 6 14:04:36 2012(r241254) +++ head/lib/libpmc/MakefileSat Oct 6 17:54:42 2012(r241255) @@ -42,7 +42,7 @@ MAN+= pmc.sandybridgeuc.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 MAN+= pmc.tsc.3 -.elif ${MACHINE_CPUARCH} == arm ${CPUTYPE} == xscale +.elif ${MACHINE_CPUARCH} == arm MAN+= pmc.xscale.3 .elif ${MACHINE_CPUARCH} == mips MAN+= pmc.mips24k.3 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r241100 - head/sys/arm/conf
Author: kientzle Date: Mon Oct 1 14:56:48 2012 New Revision: 241100 URL: http://svn.freebsd.org/changeset/base/241100 Log: Support kernel options from ubldr. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE == --- head/sys/arm/conf/BEAGLEBONEMon Oct 1 14:55:22 2012 (r241099) +++ head/sys/arm/conf/BEAGLEBONEMon Oct 1 14:56:48 2012 (r241100) @@ -46,6 +46,7 @@ options SYSVSEM #SYSV-style semaphore options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev optionsPREEMPTION +optionsFREEBSD_BOOT_LOADER # Debugging makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r240481 - head/sys/boot/common
Author: kientzle Date: Fri Sep 14 05:24:06 2012 New Revision: 240481 URL: http://svn.freebsd.org/changeset/base/240481 Log: The MBR data is not necessarily aligned. This is a problem on ARM. Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c == --- head/sys/boot/common/part.c Fri Sep 14 01:23:28 2012(r240480) +++ head/sys/boot/common/part.c Fri Sep 14 05:24:06 2012(r240481) @@ -661,8 +661,8 @@ ptable_open(void *dev, off_t sectors, ui for (i = has_ext = 0; i NDOSPART; i++) { if (dp[i].dp_typ == 0) continue; - start = le32toh(dp[i].dp_start); - end = le32toh(dp[i].dp_size); + start = le32dec((dp[i].dp_start)); + end = le32dec((dp[i].dp_size)); if (start == 0 || end == 0) continue; #if 0 /* Some BIOSes return an incorrect number of sectors */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r239722 - head/sys/arm/ti/cpsw
Author: kientzle Date: Mon Aug 27 04:43:30 2012 New Revision: 239722 URL: http://svn.freebsd.org/changeset/base/239722 Log: Correctly fetch the MAC address. Break down the bytes directly into the softc; the intermediate buffer isn't needed here. Break down the bytes in the correct order. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c == --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Aug 27 04:30:53 2012 (r239721) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Aug 27 04:43:30 2012 (r239722) @@ -216,13 +216,11 @@ cpsw_attach(device_t dev) struct cpsw_softc *sc; struct mii_softc *miisc; struct ifnet *ifp; - uint8_t mac_addr[ETHER_ADDR_LEN]; int i, error, phy; uint32_t reg; sc = device_get_softc(dev); sc-dev = dev; - memcpy(sc-mac_addr, mac_addr, ETHER_ADDR_LEN); sc-node = ofw_bus_get_node(dev); /* Get phy address from fdt */ @@ -279,17 +277,17 @@ cpsw_attach(device_t dev) IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen); IFQ_SET_READY(ifp-if_snd); - /* Get low part of MAC address from control module (mac_id0_lo) */ - ti_scm_reg_read_4(0x630, reg); - mac_addr[0] = (reg 8) 0xFF; - mac_addr[1] = reg 0xFF; - /* Get high part of MAC address from control module (mac_id0_hi) */ ti_scm_reg_read_4(0x634, reg); - mac_addr[2] = (reg 24) 0xFF; - mac_addr[3] = (reg 16) 0xFF; - mac_addr[4] = (reg 8) 0xFF; - mac_addr[5] = reg 0xFF; + sc-mac_addr[0] = reg 0xFF; + sc-mac_addr[1] = (reg 8) 0xFF; + sc-mac_addr[2] = (reg 16) 0xFF; + sc-mac_addr[3] = (reg 24) 0xFF; + + /* Get low part of MAC address from control module (mac_id0_lo) */ + ti_scm_reg_read_4(0x630, reg); + sc-mac_addr[4] = reg 0xFF; + sc-mac_addr[5] = (reg 8) 0xFF; ether_ifattach(ifp, sc-mac_addr); callout_init(sc-wd_callout, 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r239553 - head/sys/arm/ti
Author: kientzle Date: Wed Aug 22 05:14:59 2012 New Revision: 239553 URL: http://svn.freebsd.org/changeset/base/239553 Log: After r239366, fix the ti_edma3.c driver to use the exact name as used in the FDT. Modified: head/sys/arm/ti/ti_edma3.c Modified: head/sys/arm/ti/ti_edma3.c == --- head/sys/arm/ti/ti_edma3.c Wed Aug 22 03:00:57 2012(r239552) +++ head/sys/arm/ti/ti_edma3.c Wed Aug 22 05:14:59 2012(r239553) @@ -142,7 +142,7 @@ static struct { static int ti_edma3_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, ti,edma)) + if (!ofw_bus_is_compatible(dev, ti,edma3)) return (ENXIO); device_set_desc(dev, TI EDMA Controller); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r238185 - head/usr.bin/mkesdb
Author: kientzle Date: Sat Jul 7 04:14:28 2012 New Revision: 238185 URL: http://svn.freebsd.org/changeset/base/238185 Log: Unbreak building WITH_ICONV=yes and new yacc. Modified: head/usr.bin/mkesdb/ldef.h Modified: head/usr.bin/mkesdb/ldef.h == --- head/usr.bin/mkesdb/ldef.h Sat Jul 7 00:25:17 2012(r238184) +++ head/usr.bin/mkesdb/ldef.h Sat Jul 7 04:14:28 2012(r238185) @@ -30,7 +30,6 @@ extern int line_number; extern int yyerror(const char *); extern int yylex(void); -extern int yyparse(void); struct named_csid { STAILQ_ENTRY(named_csid) ci_entry; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r237708 - stable/9/share/man/man7
On Jun 28, 2012, at 6:10 AM, Warren Block wrote: Author: wblock (doc committer) Date: Thu Jun 28 13:10:36 2012 New Revision: 237708 URL: http://svn.freebsd.org/changeset/base/237708 Log: MFC r237655: Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not exist until populated with csup(1) or svn(1). PR: 169487 Probably should also cross-reference portsnap(8) here. Tim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r237110 - head/lib/libc/arm
Author: kientzle Date: Fri Jun 15 03:57:16 2012 New Revision: 237110 URL: http://svn.freebsd.org/changeset/base/237110 Log: Per kib, since __flt_rounds is being added to FreeBSD 10, it belongs in FBSD_1.3. MFC after:1 week Modified: head/lib/libc/arm/Symbol.map Modified: head/lib/libc/arm/Symbol.map == --- head/lib/libc/arm/Symbol.mapFri Jun 15 02:16:29 2012 (r237109) +++ head/lib/libc/arm/Symbol.mapFri Jun 15 03:57:16 2012 (r237110) @@ -31,6 +31,9 @@ FBSD_1.0 { brk; cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */ sbrk; +}; + +FBSD_1.3 { __flt_rounds; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r237039 - head/lib/libc/arm
Author: kientzle Date: Thu Jun 14 03:27:01 2012 New Revision: 237039 URL: http://svn.freebsd.org/changeset/base/237039 Log: __flt_rounds is a public symbol (expands from the FLT_ROUNDS macro), so include it in the public namespace on arm just as with other architectures. This corrects r236816. Submitted by: Jan Sieka MFC after:1 week Modified: head/lib/libc/arm/Symbol.map Modified: head/lib/libc/arm/Symbol.map == --- head/lib/libc/arm/Symbol.mapThu Jun 14 00:51:53 2012 (r237038) +++ head/lib/libc/arm/Symbol.mapThu Jun 14 03:27:01 2012 (r237039) @@ -31,6 +31,7 @@ FBSD_1.0 { brk; cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */ sbrk; + __flt_rounds; }; FBSDprivate_1.0 { @@ -70,7 +71,6 @@ FBSDprivate_1.0 { __divdf3; __floatsisf; __floatsidf; - __flt_rounds; __fixsfsi; __fixdfsi; __fixunssfsi; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r236816 - head/lib/libc/arm
Author: kientzle Date: Sat Jun 9 16:09:53 2012 New Revision: 236816 URL: http://svn.freebsd.org/changeset/base/236816 Log: __flt_rounds was omitted from the exported symbols here. Submitted by: Jan Sieka Reviewed by: arm@ MFC after:1 week Modified: head/lib/libc/arm/Symbol.map Modified: head/lib/libc/arm/Symbol.map == --- head/lib/libc/arm/Symbol.mapSat Jun 9 14:13:42 2012 (r236815) +++ head/lib/libc/arm/Symbol.mapSat Jun 9 16:09:53 2012 (r236816) @@ -70,6 +70,7 @@ FBSDprivate_1.0 { __divdf3; __floatsisf; __floatsidf; + __flt_rounds; __fixsfsi; __fixdfsi; __fixunssfsi; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r236159 - head/sys/boot/arm/uboot
Author: kientzle Date: Sun May 27 16:27:04 2012 New Revision: 236159 URL: http://svn.freebsd.org/changeset/base/236159 Log: Allow the load address used by ARM ubldr to be set via Make argument. In particular, this simplifies scripts that build system images. Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/arm/uboot/ldscript.arm Modified: head/sys/boot/arm/uboot/Makefile == --- head/sys/boot/arm/uboot/MakefileSun May 27 16:24:00 2012 (r236158) +++ head/sys/boot/arm/uboot/MakefileSun May 27 16:27:04 2012 (r236159) @@ -7,6 +7,9 @@ NEWVERSWHAT=U-Boot loader ${MACHINE_A BINDIR?= /boot INSTALLFLAGS= -b WARNS?=1 +# Address at which ubldr will be loaded. +# This varies for different boards and SOCs. +UBLDR_LOADADDR?= 0x100 # Architecture-specific loader code SRCS= start.S conf.c vers.c @@ -85,7 +88,9 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -nostdlib -static +LDFLAGS+= -T ldscript.generated +LDFLAGS+= -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common @@ -110,6 +115,18 @@ loader.help: help.common help.uboot cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk ${.TARGET} +${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH} + +ldscript.generated:: + rm -f ldscript.generated.tmp + echo UBLDR_LOADADDR = ${UBLDR_LOADADDR}; ldscript.generated.tmp + if diff ldscript.generated ldscript.generated.tmp /dev/null; then \ + true; \ + else \ + rm -f ldscript.generated; \ + mv ldscript.generated.tmp ldscript.generated; \ + fi + .PATH: ${.CURDIR}/../../forth FILES= loader.help Modified: head/sys/boot/arm/uboot/ldscript.arm == --- head/sys/boot/arm/uboot/ldscript.armSun May 27 16:24:00 2012 (r236158) +++ head/sys/boot/arm/uboot/ldscript.armSun May 27 16:27:04 2012 (r236159) @@ -5,7 +5,7 @@ ENTRY(_start) SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x100 + SIZEOF_HEADERS; + . = UBLDR_LOADADDR + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym: { *(.dynsym)} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r235694 - head/sys/boot/uboot/lib
Author: kientzle Date: Sun May 20 18:07:35 2012 New Revision: 235694 URL: http://svn.freebsd.org/changeset/base/235694 Log: Determine kernel load address dynamically from u-boot memory map. The generic ELF loading code maps the kernel into low memory by subtracting KERN_BASE. So the copyin/copyout/readin functions are always called with low addresses. This code finds the largest DRAM block from the U-Boot memory map and adds that base to the addresses. In particular, this fixes ubldr on AM3358, which has DRAM mapped to 0x8000 at power-on. Modified: head/sys/boot/uboot/lib/copy.c head/sys/boot/uboot/lib/elf_freebsd.c head/sys/boot/uboot/lib/libuboot.h Modified: head/sys/boot/uboot/lib/copy.c == --- head/sys/boot/uboot/lib/copy.c Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/copy.c Sun May 20 18:07:35 2012 (r235694) @@ -29,32 +29,64 @@ __FBSDID($FreeBSD$); #include stand.h +#include stdint.h + +#include api_public.h +#include glue.h /* * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. */ +void * +uboot_vm_translate(vm_offset_t o) { + struct sys_info *si; + static uintptr_t start = 0; + static size_t size = 0; + int i; + + if (size == 0) { + if ((si = ub_get_sys_info()) == NULL) + panic(could not retrieve system info); + + /* Find start/size of largest DRAM block. */ + for (i = 0; i si-mr_no; i++) { + if (si-mr[i].flags == MR_ATTR_DRAM +si-mr[i].size size) { + start = si-mr[i].start; + size = si-mr[i].size; + } + } + + if (size = 0) + panic(No suitable DRAM?\n); + /* + printf(Loading into memory region 0x%08X-0x%08X (%d MiB)\n, + start, start + size, size / 1024 / 1024); + */ + } + if (o size) + panic(Address 0x%08jX bigger than size 0x%08X\n, + (intmax_t)o, size); + return (void *)(start + o); +} + ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len) { - - bcopy(src, (void *)dest, len); + bcopy(src, uboot_vm_translate(dest), len); return (len); } ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len) { - - bcopy((void *)src, dest, len); + bcopy(uboot_vm_translate(src), dest, len); return (len); } ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len) { - - return (read(fd, (void *) dest, len)); + return (read(fd, uboot_vm_translate(dest), len)); } Modified: head/sys/boot/uboot/lib/elf_freebsd.c == --- head/sys/boot/uboot/lib/elf_freebsd.c Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sun May 20 18:07:35 2012 (r235694) @@ -38,6 +38,7 @@ __FBSDID($FreeBSD$); #include stand.h #include bootstrap.h +#include libuboot.h extern vm_offset_t md_load(char *, vm_offset_t *); @@ -69,6 +70,7 @@ __elfN(uboot_exec)(struct preloaded_file vm_offset_t mdp; Elf_Ehdr *e; int error; + void (*entry)(void *); if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return (EFTYPE); @@ -78,11 +80,12 @@ __elfN(uboot_exec)(struct preloaded_file if ((error = md_load(fp-f_args, mdp)) != 0) return (error); - printf(Kernel entry at 0x%x ...\n, e-e_entry); + entry = uboot_vm_translate(e-e_entry); + printf(Kernel entry at 0x%x...\n, (unsigned)entry); dev_cleanup(); - (*(void (*)())e-e_entry)((void *)mdp); + (*entry)((void *)mdp); panic(exec returned); } Modified: head/sys/boot/uboot/lib/libuboot.h == --- head/sys/boot/uboot/lib/libuboot.h Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/libuboot.h Sun May 20 18:07:35 2012 (r235694) @@ -60,6 +60,7 @@ extern int devs_no; extern struct netif_driver uboot_net; extern struct devsw uboot_storage; +void *uboot_vm_translate(vm_offset_t); ssize_tuboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_tuboot_copyout(const vm_offset_t src, void *dest, const size_t len); ssize_tuboot_readin(const int fd, vm_offset_t dest, const size_t len); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to
svn commit: r235529 - in head/sys/boot: fdt uboot/common
Author: kientzle Date: Thu May 17 04:04:48 2012 New Revision: 235529 URL: http://svn.freebsd.org/changeset/base/235529 Log: Access the device tree blob via copyin/copyout. The code previously assumed that copyin/copyout did no address translation and that the device tree blob could be manipulated in-place (with only a few adjustments for the ELF loader offset). This isn't possible on all platforms, so the revised code uses copyout() to copy the device tree blob into a heap-allocated buffer and then updates the device tree with copyout(). This isn't ideal, since it bloats the loader memory usage, but seems the only feasible approach (short of rewriting all of the fdt manipulation routines). Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Thu May 17 00:06:54 2012 (r235528) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu May 17 04:04:48 2012 (r235529) @@ -57,11 +57,17 @@ __FBSDID($FreeBSD$); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) +#define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) +#define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) #define FDT_STATIC_DTB_SYMBOL fdt_static_dtb +/* Local copy of FDT */ static struct fdt_header *fdtp = NULL; +/* Size of FDT blob */ +static size_t fdtp_size = 0; +/* Location of FDT in kernel or module */ +static vm_offset_t fdtp_va = 0; static int fdt_cmd_nyi(int argc, char *argv[]); @@ -98,21 +104,19 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = /; static vm_offset_t -fdt_find_static_dtb(void) +fdt_find_static_dtb() { + Elf_Dyn dyn; Elf_Sym sym; - vm_offset_t dyntab, esym; + vm_offset_t dyntab, esym, strtab, symtab, fdt_start; uint64_t offs; struct preloaded_file *kfp; struct file_metadata *md; - Elf_Sym *symtab; - Elf_Dyn *dyn; - char *strtab, *strp; - int i, sym_count; - - symtab = NULL; - dyntab = esym = 0; - strtab = strp = NULL; + char *strp; + int sym_count; + + symtab = strtab = dyntab = esym = 0; + strp = NULL; offs = __elfN(relocation_offset); @@ -123,28 +127,29 @@ fdt_find_static_dtb(void) md = file_findmetadata(kfp, MODINFOMD_ESYM); if (md == NULL) return (0); - COPYOUT(md-md_data, esym, sizeof(esym)); + bcopy(md-md_data, esym, sizeof(esym)); + // esym is already offset md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); if (md == NULL) return (0); - COPYOUT(md-md_data, dyntab, sizeof(dyntab)); - + bcopy(md-md_data, dyntab, sizeof(dyntab)); dyntab += offs; /* Locate STRTAB and DYNTAB */ - for (dyn = (Elf_Dyn *)dyntab; dyn-d_tag != DT_NULL; dyn++) { - if (dyn-d_tag == DT_STRTAB) { - strtab = (char *)(uintptr_t)(dyn-d_un.d_ptr + offs); - continue; - } else if (dyn-d_tag == DT_SYMTAB) { - symtab = (Elf_Sym *)(uintptr_t) - (dyn-d_un.d_ptr + offs); - continue; + for (;;) { + COPYOUT(dyntab, dyn, sizeof(dyn)); + if (dyn.d_tag == DT_STRTAB) { + strtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs; + } else if (dyn.d_tag == DT_SYMTAB) { + symtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs; + } else if (dyn.d_tag == DT_NULL) { + break; } + dyntab += sizeof(dyn); } - if (symtab == NULL || strtab == NULL) { + if (symtab == 0 || strtab == 0) { /* * No symtab? No strtab? That should not happen here, * and should have been verified during __elfN(loadimage). @@ -153,7 +158,7 @@ fdt_find_static_dtb(void) return (0); } - sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + sym_count = (int)(esym - symtab) / sizeof(Elf_Sym); /* * The most efficent way to find a symbol would be to calculate a @@ -165,26 +170,27 @@ fdt_find_static_dtb(void) * we are eliminating symbols type of which is not STT_NOTYPE, or(and) * those which binding attribute is not STB_GLOBAL. */ - for (i = 0; i sym_count; i++) { - COPYOUT(symtab + i, sym, sizeof(sym)); + fdt_start = 0; + while (sym_count 0 fdt_start == 0) { + COPYOUT(symtab, sym, sizeof(sym)); + symtab += sizeof(sym); + --sym_count; if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL ||
svn commit: r235261 - head/sys/boot/fdt
Author: kientzle Date: Fri May 11 04:18:39 2012 New Revision: 235261 URL: http://svn.freebsd.org/changeset/base/235261 Log: Don't hang if there is no /cpus node in the device tree. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Fri May 11 04:10:23 2012 (r235260) +++ head/sys/boot/fdt/fdt_loader_cmd.c Fri May 11 04:18:39 2012 (r235261) @@ -317,6 +317,8 @@ fixup_cpubusfreqs(unsigned long cpufreq, /* We want to modify every subnode of /cpus */ o = fdt_path_offset(fdtp, /cpus); + if (o 0) + return; /* maxo should contain offset of node next to /cpus */ depth = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r235094 - head/sys/boot/uboot/common
Author: kientzle Date: Sun May 6 16:01:58 2012 New Revision: 235094 URL: http://svn.freebsd.org/changeset/base/235094 Log: Don't call strcmp with a NULL pointer. In particular, on the AM335x, which comes up with no memory mapped to low addresses, dereferencing the NULL causes a crash. Modified: head/sys/boot/uboot/common/main.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/main.c == --- head/sys/boot/uboot/common/main.c Sun May 6 15:56:07 2012 (r235093) +++ head/sys/boot/uboot/common/main.c Sun May 6 16:01:58 2012 (r235094) @@ -116,6 +116,16 @@ meminfo(void) } } +static uint64_t +uboot_loadaddr(u_int type, void *data, uint64_t addr) +{ + printf(uboot_loadaddr: type=%d data=0x%x addr=0x%x\n, + type, data, addr); + if (type == 1) + return 0x4000; + return (addr); +} + int main(void) { @@ -211,6 +221,7 @@ main(void) archsw.arch_copyout = uboot_copyout; archsw.arch_readin = uboot_readin; archsw.arch_autoload = uboot_autoload; + archsw.arch_loadaddr = uboot_loadaddr; interact(); /* doesn't return */ Modified: head/sys/boot/uboot/common/metadata.c == --- head/sys/boot/uboot/common/metadata.c Sun May 6 15:56:07 2012 (r235093) +++ head/sys/boot/uboot/common/metadata.c Sun May 6 16:01:58 2012 (r235094) @@ -72,6 +72,7 @@ static int md_getboothowto(char *kargs) { char*cp; + char*p; int howto; int active; int i; @@ -132,10 +133,12 @@ md_getboothowto(char *kargs) if (getenv(howto_names[i].ev) != NULL) howto |= howto_names[i].mask; } - if (!strcmp(getenv(console), comconsole)) - howto |= RB_SERIAL; - if (!strcmp(getenv(console), nullconsole)) - howto |= RB_MUTE; + if ((p = getenv(console))) { + if (!strcmp(p, comconsole)) + howto |= RB_SERIAL; + if (!strcmp(p, nullconsole)) + howto |= RB_MUTE; + } return(howto); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r235095 - head/sys/boot/uboot/common
Author: kientzle Date: Sun May 6 16:32:28 2012 New Revision: 235095 URL: http://svn.freebsd.org/changeset/base/235095 Log: Ooops. Back out changes to main.c from r235094. This change is specific to BeagleBone; I need to figure out how to generalize this before committing. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c == --- head/sys/boot/uboot/common/main.c Sun May 6 16:01:58 2012 (r235094) +++ head/sys/boot/uboot/common/main.c Sun May 6 16:32:28 2012 (r235095) @@ -116,16 +116,6 @@ meminfo(void) } } -static uint64_t -uboot_loadaddr(u_int type, void *data, uint64_t addr) -{ - printf(uboot_loadaddr: type=%d data=0x%x addr=0x%x\n, - type, data, addr); - if (type == 1) - return 0x4000; - return (addr); -} - int main(void) { @@ -221,7 +211,6 @@ main(void) archsw.arch_copyout = uboot_copyout; archsw.arch_readin = uboot_readin; archsw.arch_autoload = uboot_autoload; - archsw.arch_loadaddr = uboot_loadaddr; interact(); /* doesn't return */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234860 - head/sys/boot/uboot/lib
Author: kientzle Date: Tue May 1 05:04:49 2012 New Revision: 234860 URL: http://svn.freebsd.org/changeset/base/234860 Log: Teach ubldr(8) about simple MBR partitioning. Modified: head/sys/boot/uboot/lib/devicename.c head/sys/boot/uboot/lib/disk.c head/sys/boot/uboot/lib/libuboot.h Modified: head/sys/boot/uboot/lib/devicename.c == --- head/sys/boot/uboot/lib/devicename.cTue May 1 04:35:53 2012 (r234859) +++ head/sys/boot/uboot/lib/devicename.cTue May 1 05:04:49 2012 (r234860) @@ -131,6 +131,10 @@ uboot_parsedev(struct uboot_devdesc **de *(cp + 1) != ':') { pnum = strtol(cp + 1, cp, 10); ptype = PTYPE_GPT; + } else if (*cp == 's' *(cp + 1) + *(cp + 1) != ':') { + pnum = strtol(cp + 1, cp, 10); + ptype = PTYPE_MBR; } else { pnum = *cp - 'a'; ptype = PTYPE_BSDLABEL; @@ -218,6 +222,9 @@ uboot_fmtdev(void *vdev) else if (dev-d_kind.disk.ptype == PTYPE_GPT) cp += sprintf(cp, p%i, dev-d_kind.disk.pnum); + else if (dev-d_kind.disk.ptype == PTYPE_MBR) + cp += sprintf(cp, s%i, + dev-d_kind.disk.pnum); } strcat(cp, :); Modified: head/sys/boot/uboot/lib/disk.c == --- head/sys/boot/uboot/lib/disk.c Tue May 1 04:35:53 2012 (r234859) +++ head/sys/boot/uboot/lib/disk.c Tue May 1 05:04:49 2012 (r234860) @@ -398,6 +398,94 @@ out: } static int +stor_open_mbr(struct open_dev *od, struct uboot_devdesc *dev) +{ + char *buf = NULL; + struct dos_partition *dp; + int err, i, part; + + od-od_nparts = 0; + od-od_partitions = NULL; + + /* Block size must be at least 512 bytes. */ + if (od-od_bsize 512) + return (ENXIO); + + /* Read MBR */ + buf = malloc(od-od_bsize); + if (!buf) { + stor_printf(could not allocate memory for MBR\n); + return (ENOMEM); + } + err = stor_readdev(dev, 0, 1, buf); + if (err) { + stor_printf(MBR read error=%d\n, err); + err = EIO; + goto out; + } + + /* Check the slice table magic. */ + if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) { + err = ENXIO; + goto out; + } + + /* Save information about partitions. */ + dp = (struct dos_partition *)(buf + DOSPARTOFF); + od-od_partitions = calloc(NDOSPART, sizeof(struct gpt_part)); + if (!od-od_partitions) { + stor_printf(could not allocate memory for MBR partitions\n); + err = ENOMEM; + goto out; + } + + part = 0; + for (i = 0; i NDOSPART; i++) { + u_int32_t start = le32dec(dp[i].dp_start); + u_int32_t size = le32dec(dp[i].dp_size); + uuid_t *u = NULL; + + /* Map MBR partition types to GPT partition types. */ + switch (dp[i].dp_typ) { + case DOSPTYP_386BSD: + u = freebsd_ufs; + break; + /* XXX Other types XXX */ + } + + if (u) { + od-od_partitions[part].gp_type = *u; + od-od_partitions[part].gp_index = i + 1; + od-od_partitions[part].gp_start = start; + od-od_partitions[part].gp_end = start + size; + part += 1; + } + } + od-od_nparts = part; + + if (od-od_nparts == 0) { + err = EINVAL; + goto out; + } + + dev-d_disk.ptype = PTYPE_MBR; + + /* XXX Be smarter here? XXX */ + if (dev-d_disk.pnum == 0) + dev-d_disk.pnum = od-od_partitions[0].gp_index; + + for (i = 0; i od-od_nparts; i++) + if (od-od_partitions[i].gp_index == dev-d_disk.pnum) + od-od_bstart = od-od_partitions[i].gp_start; + +out: + if (err od-od_partitions) + free(od-od_partitions); + free(buf); + return (err); +} + +static int stor_open_bsdlabel(struct open_dev *od, struct uboot_devdesc *dev) { char *buf; @@ -443,7 +531,7 @@ stor_readdev(struct uboot_devdesc *dev, lbasize_t real_size; int err, handle; - debugf(reading
svn commit: r234908 - head/sys/boot/arm/uboot
Author: kientzle Date: Wed May 2 05:49:58 2012 New Revision: 234908 URL: http://svn.freebsd.org/changeset/base/234908 Log: Remove some redundant register loads. Discussed on: arm@ Modified: head/sys/boot/arm/uboot/start.S Modified: head/sys/boot/arm/uboot/start.S == --- head/sys/boot/arm/uboot/start.S Wed May 2 04:51:43 2012 (r234907) +++ head/sys/boot/arm/uboot/start.S Wed May 2 05:49:58 2012 (r234908) @@ -49,27 +49,20 @@ _start: * syscall() */ ENTRY(syscall) - /* Save caller's lr */ + /* Save caller's lr and r8 */ ldr ip, =saved_regs str lr, [ip, #4] - /* Save loader's r8 */ - ldr ip, =saved_regs str r8, [ip, #8] - /* Restore U-Boot's r8 */ - ldr ip, =saved_regs ldr r8, [ip, #0] /* Call into U-Boot */ ldr lr, =return_from_syscall ldr ip, =syscall_ptr ldr pc, [ip] - return_from_syscall: - /* Restore loader's r8 */ + /* Restore loader's r8 and lr */ ldr ip, =saved_regs ldr r8, [ip, #8] - /* Restore caller's lr */ - ldr ip, =saved_regs ldr lr, [ip, #4] /* Return to caller */ mov pc, lr ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org