From owner-svn-src-user@FreeBSD.ORG Mon Jul 16 08:06:14 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80BEB106566B; Mon, 16 Jul 2012 08:06:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BFB88FC12; Mon, 16 Jul 2012 08:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G86E4X017909; Mon, 16 Jul 2012 08:06:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G86EDN017907; Mon, 16 Jul 2012 08:06:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201207160806.q6G86EDN017907@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Jul 2012 08:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238518 - user/ae/bootcode/sys/boot/userboot/userboot X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 08:06:14 -0000 Author: ae Date: Mon Jul 16 08:06:13 2012 New Revision: 238518 URL: http://svn.freebsd.org/changeset/base/238518 Log: Add userdisk_info structure to keep information about disks. Modified: user/ae/bootcode/sys/boot/userboot/userboot/userboot_disk.c Modified: user/ae/bootcode/sys/boot/userboot/userboot/userboot_disk.c ============================================================================== --- user/ae/bootcode/sys/boot/userboot/userboot/userboot_disk.c Mon Jul 16 07:22:22 2012 (r238517) +++ user/ae/bootcode/sys/boot/userboot/userboot/userboot_disk.c Mon Jul 16 08:06:13 2012 (r238518) @@ -39,9 +39,18 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libuserboot.h" +struct userdisk_info { + uint64_t mediasize; + uint16_t sectorsize; +}; + int userboot_disk_maxunit = 0; +static int userdisk_maxunit = 0; +static struct userdisk_info *ud_info; + static int userdisk_init(void); +static void userdisk_cleanup(void); static int userdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize); static int userdisk_open(struct open_file *f, ...); @@ -58,19 +67,45 @@ struct devsw userboot_disk = { userdisk_close, userdisk_ioctl, userdisk_print, - NULL + userdisk_cleanup }; /* - * Nothing to do here. + * Initialize userdisk_info structure for each disk. */ static int userdisk_init(void) { + off_t mediasize; + u_int sectorsize; + int i; + + userdisk_maxunit = userboot_disk_maxunit; + if (userdisk_maxunit > 0) { + ud_info = malloc(sizeof(*ud_info) * userdisk_maxunit); + if (ud_info == NULL) + return (ENOMEM); + for (i = 0; i < userdisk_maxunit; i++) { + if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE, + §orsize) != 0 || CALLBACK(diskioctl, i, + DIOCGMEDIASIZE, &mediasize) != 0) + return (ENXIO); + ud_info[i].mediasize = mediasize; + ud_info[i].sectorsize = sectorsize; + } + } return(0); } +static void +userdisk_cleanup(void) +{ + + if (userdisk_maxunit > 0) + free(ud_info); +} + /* * Print information about disks */ @@ -79,21 +114,17 @@ userdisk_print(int verbose) { struct disk_devdesc dev; char line[80]; - off_t mediasize; - u_int sectorsize; int i; - for (i = 0; i < userboot_disk_maxunit; i++) { + for (i = 0; i < userdisk_maxunit; i++) { sprintf(line, " disk%d: Guest drive image\n", i); pager_output(line); - if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE, §orsize) != 0 || - CALLBACK(diskioctl, i, DIOCGMEDIASIZE, &mediasize) != 0) - continue; dev.d_dev = &userboot_disk; dev.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; - if (disk_open(&dev, mediasize, sectorsize) == 0) { + if (disk_open(&dev, ud_info[i].mediasize, + ud_info[i].sectorsize) == 0) { sprintf(line, " disk%d", i); disk_print(&dev, line, verbose); disk_close(&dev); @@ -109,24 +140,16 @@ userdisk_open(struct open_file *f, ...) { va_list ap; struct disk_devdesc *dev; - u_int sectorsize; - off_t mediasize; - int rc; va_start(ap, f); dev = va_arg(ap, struct disk_devdesc *); va_end(ap); - if (dev->d_unit < 0 || dev->d_unit >= userboot_disk_maxunit) + if (dev->d_unit < 0 || dev->d_unit >= userdisk_maxunit) return (EIO); - rc = CALLBACK(diskioctl, dev->d_unit, DIOCGSECTORSIZE, §orsize); - if (rc != 0) - return (rc); - rc = CALLBACK(diskioctl, dev->d_unit, DIOCGMEDIASIZE, &mediasize); - if (rc != 0) - return (rc); - return (disk_open(dev, mediasize, sectorsize)); + return (disk_open(dev, ud_info[dev->d_unit].mediasize, + ud_info[dev->d_unit].sectorsize)); } static int @@ -153,7 +176,7 @@ userdisk_strategy(void *devdata, int rw, return (EINVAL); if (rsize) *rsize = 0; - off = (dblk + dev->d_offset) * DISK_SECSIZE; + off = (dblk + dev->d_offset) * ud_info[dev->d_unit].sectorsize; rc = CALLBACK(diskread, dev->d_unit, off, buf, size, &resid); if (rc) return (rc); From owner-svn-src-user@FreeBSD.ORG Mon Jul 16 08:13:31 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BEE31065672; Mon, 16 Jul 2012 08:13:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17BCB8FC0C; Mon, 16 Jul 2012 08:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G8DUhB018473; Mon, 16 Jul 2012 08:13:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G8DUMh018470; Mon, 16 Jul 2012 08:13:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201207160813.q6G8DUMh018470@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Jul 2012 08:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238519 - user/ae/bootcode/sys/boot/common X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 08:13:31 -0000 Author: ae Date: Mon Jul 16 08:13:30 2012 New Revision: 238519 URL: http://svn.freebsd.org/changeset/base/238519 Log: Remove DISK_SECSIZE macro, since it is no longer needed. Also remove assumptions about 512-bytes sectorsize from the comments, we use sectorsize obtained from the disk driver. Modified: user/ae/bootcode/sys/boot/common/disk.h Modified: user/ae/bootcode/sys/boot/common/disk.h ============================================================================== --- user/ae/bootcode/sys/boot/common/disk.h Mon Jul 16 08:06:13 2012 (r238518) +++ user/ae/bootcode/sys/boot/common/disk.h Mon Jul 16 08:13:30 2012 (r238519) @@ -27,8 +27,7 @@ */ /* - * Device descriptor for partitioned disks. We assume that all disk addresses - * are 512 byte block offsets from the start of the disk. To use, set the + * Device descriptor for partitioned disks. To use, set the * d_slice and d_partition variables as follows: * * Whole disk access: @@ -74,8 +73,6 @@ * the device's strategy method. */ -#define DISK_SECSIZE 512 - struct disk_devdesc { struct devsw *d_dev; @@ -95,8 +92,7 @@ extern int disk_open(struct disk_devdesc extern int disk_close(struct disk_devdesc *dev); /* - * Print information about slices on a disk. For the size calculations we - * assume a 512 byte sector. + * Print information about slices on a disk. */ extern void disk_print(struct disk_devdesc *dev, char *prefix, int verbose); extern char* disk_fmtdev(struct disk_devdesc *dev); From owner-svn-src-user@FreeBSD.ORG Mon Jul 16 09:50:30 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41609106566B; Mon, 16 Jul 2012 09:50:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9C58FC08; Mon, 16 Jul 2012 09:50:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G9oUMW026838; Mon, 16 Jul 2012 09:50:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G9oTFT026836; Mon, 16 Jul 2012 09:50:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207160950.q6G9oTFT026836@svn.freebsd.org> From: Doug Barton Date: Mon, 16 Jul 2012 09:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238528 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 09:50:30 -0000 Author: dougb Date: Mon Jul 16 09:50:29 2012 New Revision: 238528 URL: http://svn.freebsd.org/changeset/base/238528 Log: Minor tweaks/fixes ================== * Do not use variables where they are not needed * Do not duplicate the same test * Unset multiple variables with the same command instead of 2 * When deleting empty DISTDIR subdirs use -mindepth 1 so that it will not error out if the directory is totally empty. * Unset more stuff after it is no longer needed * Update some comments to match the current state of the code * Remove some stuff that cannot be reached any longer Performance enhancement ======================= * In read_distinfos*() use while read instead of grep. Avoids the fork and cuts the total time for that feature 25% Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Jul 16 09:38:19 2012 (r238527) +++ user/dougb/portmaster/portmaster Mon Jul 16 09:50:29 2012 (r238528) @@ -41,9 +41,7 @@ if [ -z "$PM_PARENT_PID" ]; then my_environment=`set` # If we are already root, unset this to avoid potential conflict - euid=`ps -o uid= $$` - [ $euid -eq 0 ] && unset PM_SU_CMD PM_SU_VERBOSE - unset euid + [ `ps -o uid= $$` -eq 0 ] && unset PM_SU_CMD PM_SU_VERBOSE fi #=============== Begin functions we always want to have =============== @@ -91,8 +89,8 @@ trap_exit () { echo '' echo "===>>> Build/Install logs available:" for file in $logs; do echo " $file"; done + echo '' fi - [ -n "$logs" ] && echo '' fi else # Signal the parent if a child trap'ed, or read the file if we are @@ -314,8 +312,7 @@ pm_cd_pd () { [ -n "$PM_INDEX_ONLY" ] & builtin cd $pd/$1 2>/dev/null || fail "Cannot cd to port directory: $pd/$1"; } pm_kill () { /bin/kill $* >/dev/null 2>/dev/null; } -pm_make () { ( unset -v CUR_DEPS INSTALLED_LIST PM_DEPTH build_l; - unset -v PM_URB_LIST; +pm_make () { ( unset -v CUR_DEPS INSTALLED_LIST PM_DEPTH build_l PM_URB_LIST; /usr/bin/nice /usr/bin/make $PM_MAKE_ARGS $*; ); } pm_make_b () { /usr/bin/make $PM_MAKE_ARGS BEFOREPORTMK=bpm $*; } pm_mktemp () { @@ -328,8 +325,7 @@ pm_unlink () { [ -e "$1" ] && /bin/unlin pm_find_s () { $PM_SU_CMD /usr/bin/find $*; } pm_install_s () { $PM_SU_CMD /usr/bin/install -p -o root -g wheel -m 644 $1 $2; } -pm_make_s () { ( unset -v CUR_DEPS INSTALLED_LIST PM_DEPTH build_l; - unset -v PM_URB_LIST; +pm_make_s () { ( unset -v CUR_DEPS INSTALLED_LIST PM_DEPTH build_l PM_URB_LIST; $PM_SU_CMD /usr/bin/nice /usr/bin/make $PM_MAKE_ARGS $*; ); } pm_mkdir_s () { $PM_SU_CMD /bin/mkdir -p $1; } pm_pkg_delete_s () { $PM_SU_CMD /usr/sbin/pkg_delete $*; } @@ -1167,11 +1163,12 @@ find_moved_port () { } read_distinfos () { - local pkg iport origin distinfo disc1 f disc2 + local pkg iport origin distinfo s f discard echo '############' > $DI_FILES # Make the file > 0 bytes echo "===>>> Gathering distinfo list for installed ports" echo '' + for pkg in ${pdb}/*; do [ -d $pkg ] || continue iport=${pkg#$pdb/} @@ -1195,10 +1192,11 @@ read_distinfos () { fi if [ -s "$distinfo" ]; then - grep '^SHA256 ' $distinfo | while read disc1 f disc2; do - f=${f#(} ; f=${f%)} - echo $f >> $DI_FILES - done + while read s f discard; do + case "$s" in + SHA256) f=${f#(} ; echo ${f%)} >> $DI_FILES ;; + esac + done < $distinfo fi done @@ -1209,7 +1207,7 @@ read_distinfos () { } read_distinfos_all () { - local origin distinfo disc1 f disc2 + local origin distinfo s f discard echo '############' > $DI_FILES # Make the file > 0 bytes echo "===>>> Gathering distinfo list for all ports" @@ -1232,10 +1230,11 @@ read_distinfos_all () { fi if [ -s "$distinfo" ]; then - grep '^SHA256 ' $distinfo | while read disc1 f disc2; do - f=${f#(} ; f=${f%)} - echo $f >> $DI_FILES - done + while read s f discard; do + case "$s" in + SHA256) f=${f#(} ; echo ${f%)} >> $DI_FILES ;; + esac + done < $distinfo fi done @@ -1280,7 +1279,7 @@ delete_empty_dist_subdirs () { # Get back to somewhere safe so we do not # delete our CWD out from under ourselves pm_cd $DISTDIR || fail "Cannot cd into $DISTDIR" - find $DISTDIR -depth -type d \( -empty -and ! -path \*\.zfs/\* \) -delete + find $DISTDIR -depth -mindepth 1 -type d \( -empty -and ! -path \*\.zfs/\* \) -delete } init_packages_var () { @@ -2834,6 +2833,7 @@ multiport () { echo "===>>> Working on:" echo -e $portlist fi + unset portlist # First Pass if [ -n "$PM_BUILD_ONLY_LIST" ]; then @@ -3207,7 +3207,7 @@ fi [ -z "$upg_port" -a -z "$REPLACE_ORIGIN" ] && upg_port=`iport_from_origin ${portdir}` if [ -e "$pdb/$upg_port/+IGNOREME" ]; then - # Adding to CUR_DEPS means we will not get here in the build unless -G + # Adding to CUR_DEPS means we will not get here in the build if [ -z "$PM_BUILDING" ]; then # Only need to prompt for this once if -ai case "$INTERACTIVE_YES" in @@ -3250,6 +3250,7 @@ else new_port=`parse_index $portdir name` || fail "No entry for $portdir in $PM_INDEX" fi +unset -f no_valid_port if [ -z "$PM_DEPTH" ]; then PM_DEPTH="${upg_port:-$portdir} " @@ -3330,7 +3331,7 @@ if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUIL pm_make -DBATCH checksum >> $fetchlog 2>&1 rm -f ${TMPDIR}/f-${PM_PARENT_PID}-*-${portdir#*/}.* )& fi - unset master_sites distfiles file DONT_FETCH fetchlog allfiles + unset master_sites distfiles file DONT_FETCH fetchlog elif [ -n "$FETCH_ONLY" ]; then echo "===>>> No distfiles to fetch" fi @@ -3443,6 +3444,7 @@ if [ -n "$pm_package_time" ]; then unset pm_package_time fetch_package () { + # Global: ppd FETCH_ARGS local do_fetch if [ -z "$ppd" ]; then @@ -3644,6 +3646,7 @@ notnewer () { fi ;; esac fi + unset ponly_err ; unset -f notnewer if [ -n "$use_package" ]; then new_port=$latest_pv @@ -3671,7 +3674,7 @@ if [ -z "$use_package" ]; then pm_cd_pd $portdir [ -z "$DONT_PRE_CLEAN" ] && { pm_make clean NOCLEANDEPENDS=ncd || - fail 'make clean failed'; echo ''; } + fail 'make clean failed'; } fl_read=`echo ${TMPDIR}/f-${PM_PARENT_PID}-fetchlog-${portdir#*/}.*` count=0 From owner-svn-src-user@FreeBSD.ORG Mon Jul 16 10:53:50 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B0CB106566B; Mon, 16 Jul 2012 10:53:50 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B5A08FC14; Mon, 16 Jul 2012 10:53:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GAroaY033308; Mon, 16 Jul 2012 10:53:50 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GArnaa033306; Mon, 16 Jul 2012 10:53:49 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207161053.q6GArnaa033306@svn.freebsd.org> From: Doug Barton Date: Mon, 16 Jul 2012 10:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238530 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 10:53:50 -0000 Author: dougb Date: Mon Jul 16 10:53:49 2012 New Revision: 238530 URL: http://svn.freebsd.org/changeset/base/238530 Log: Remove some more unnecessary temporary variables related to pm_mktemp() Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Jul 16 10:12:07 2012 (r238529) +++ user/dougb/portmaster/portmaster Mon Jul 16 10:53:49 2012 (r238530) @@ -1023,7 +1023,7 @@ get_answer_yn () { } update_contents () { - local IFS delete contents origin n_port old_origin iport new_cont + local IFS delete contents origin n_port old_origin iport local o_seen line d_missing d_origin d_iport prev_line answer # To prevent words in a line being treated individually @@ -1033,7 +1033,7 @@ IFS=' contents=$1 ; origin=$2 ; n_port=$3 ; old_origin=$4 iport=${contents#$pdb/} ; iport=${iport%/+CONTENTS} - pm_mktemp contents-${iport} ; new_cont=$pm_mktemp_file + pm_mktemp contents-${iport} if [ -z "$delete" ]; then o_seen=':'; else o_seen=":${origin}:"; fi @@ -1071,8 +1071,8 @@ IFS=' # Could be fixed or not, but if we get here write it # so we can warn the user again later if we need to. - echo "@pkgdep $d_iport" >> $new_cont - echo "@comment DEPORIGIN:$d_origin" >> $new_cont + echo "@pkgdep $d_iport" >> $pm_mktemp_file + echo "@comment DEPORIGIN:$d_origin" >> $pm_mktemp_file unset prev_line continue fi @@ -1084,8 +1084,8 @@ IFS=' case "$o_seen" in *:${d_origin}:*) continue ;; esac o_seen="${o_seen}${d_origin}:" - echo "@pkgdep $n_port" >> $new_cont - echo "@comment DEPORIGIN:$origin" >> $new_cont ;; + echo "@pkgdep $n_port" >> $pm_mktemp_file + echo "@comment DEPORIGIN:$origin" >> $pm_mktemp_file ;; '@comment DEPORIGIN:'*) d_origin=${line#*DEPORIGIN:} case "$o_seen" in *:${d_origin}:*) @@ -1095,18 +1095,18 @@ IFS=' @pkgdep*) d_iport="${line#@pkgdep }" [ -d "$pdb/$d_iport" ] || d_missing=dm2 ;; esac - [ -n "$prev_line" ] && echo $prev_line >> $new_cont + [ -n "$prev_line" ] && echo $prev_line >> $pm_mktemp_file prev_line=$line done - [ -n "$prev_line" ] && echo $prev_line >> $new_cont + [ -n "$prev_line" ] && echo $prev_line >> $pm_mktemp_file - if ! cmp -s $contents $new_cont; then + if ! cmp -s $contents $pm_mktemp_file; then check_regular_file $contents pm_v " ===>>> Installing the new +CONTENTS file" - pm_install_s $new_cont $contents + pm_install_s $pm_mktemp_file $contents fi - /bin/unlink $new_cont + /bin/unlink $pm_mktemp_file ; unset pm_mktemp_file } find_moved_port () { @@ -3715,13 +3715,13 @@ if [ -n "$upg_port" -o -n "$ro_upg_port" [ -z "$NO_BACKUP" ] && pm_pkg_create $pbu $UPGRADE_PORT if [ -n "$SAVE_SHARED" ]; then - pm_mktemp ldconfig ; ldconfig_out=$pm_mktemp_file + pm_mktemp ldconfig ldconfig -r | sed 's#.* ##' | - grep -v ^$LOCALBASE_COMPAT > $ldconfig_out + grep -v ^$LOCALBASE_COMPAT > $pm_mktemp_file unset temp for file in `pkg_info -q -L $UPGRADE_PORT | - sort - $ldconfig_out | uniq -d`; do + sort - $pm_mktemp_file | uniq -d`; do temp="${temp}$file " done if [ -n "$temp" ]; then @@ -3736,7 +3736,7 @@ if [ -n "$upg_port" -o -n "$ro_upg_port" $PM_SU_CMD /etc/rc.d/ldconfig start > /dev/null fi - /bin/unlink $ldconfig_out ; unset ldconfig_out temp file + /bin/unlink $pm_mktemp_file ; unset pm_mktemp_file temp file fi find_dl_distfiles $portdir @@ -3830,7 +3830,7 @@ for file in $preserve_port_files; do mv ${preserve_dir}/${file##*/} $file oldmd5="MD5:`md5 -q $file`" - pm_mktemp contents ; new_cont=$pm_mktemp_file + pm_mktemp contents while read left right; do case "$left" in @cwd) short_file="${file#${right}/}" ;; @@ -3843,10 +3843,10 @@ for file in $preserve_port_files; do fi ;; esac echo "$left $right" - done < $pdb/$new_port/+CONTENTS > $new_cont - pm_install_s $new_cont $contents - pm_unlink $new_cont - unset file oldmd5 new_cont left right short_file + done < $pdb/$new_port/+CONTENTS > $pm_mktemp_file + pm_install_s $pm_mktemp_file $contents + pm_unlink $pm_mktemp_file + unset file oldmd5 pm_mktemp_file left right short_file done if [ -n "$preserve_dir" ]; then rmdir $preserve_dir 2>/dev/null @@ -3900,8 +3900,8 @@ if [ -n "$distfiles" ]; then [ -n "$distinfo" ] || fail "No DISTINFO_FILE in $portdir" fi - pm_mktemp dist_list ; dist_list_temp=$pm_mktemp_file - echo '# Added by portmaster' > $dist_list_temp + pm_mktemp dist_list + echo '# Added by portmaster' > $pm_mktemp_file for file in $distfiles; do while read line ; do case "$line" in @@ -3909,7 +3909,7 @@ if [ -n "$distfiles" ]; then SIZE\ \(${port_subdir}${file}\)*) [ -n "$sha256" ] || fail "$distinfo is out of order" echo "DISTFILE:${port_subdir}${file}:SIZE=${line##* }:SHA256=${sha256}" \ - >> $dist_list_temp ; break ;; + >> $pm_mktemp_file ; break ;; esac done < $distinfo unset sha256 @@ -3920,8 +3920,8 @@ if [ -n "$distfiles" ]; then done pm_sv "Installing $dist_list\n" - pm_install_s $dist_list_temp $dist_list - /bin/unlink $dist_list_temp ; unset distinfo dist_list_temp file line + pm_install_s $pm_mktemp_file $dist_list + /bin/unlink $pm_mktemp_file ; unset distinfo pm_mktemp_file file line fi if [ -n "$use_package" ]; then From owner-svn-src-user@FreeBSD.ORG Mon Jul 16 11:22:34 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10BFF106570A; Mon, 16 Jul 2012 11:22:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0BA18FC27; Mon, 16 Jul 2012 11:22:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GBMX7q035724; Mon, 16 Jul 2012 11:22:33 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GBMXL1035722; Mon, 16 Jul 2012 11:22:33 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201207161122.q6GBMXL1035722@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Jul 2012 11:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238531 - user/ae/bootcode/sys/boot/i386/loader X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 11:22:34 -0000 Author: ae Date: Mon Jul 16 11:22:33 2012 New Revision: 238531 URL: http://svn.freebsd.org/changeset/base/238531 Log: Preserve indents in the style of entire file. Requested by: avg Modified: user/ae/bootcode/sys/boot/i386/loader/main.c Modified: user/ae/bootcode/sys/boot/i386/loader/main.c ============================================================================== --- user/ae/bootcode/sys/boot/i386/loader/main.c Mon Jul 16 10:53:49 2012 (r238530) +++ user/ae/bootcode/sys/boot/i386/loader/main.c Mon Jul 16 11:22:33 2012 (r238531) @@ -355,18 +355,18 @@ isa_outb(int port, int value) static void i386_zfs_probe(void) { - char devname[32]; - int unit; + char devname[32]; + int unit; - /* - * Open all the disks we can find and see if we can reconstruct - * ZFS pools from them. - */ - for (unit = 0; unit < MAXBDDEV; unit++) { - if (bd_unit2bios(unit) == -1) - break; - sprintf(devname, "disk%d:", unit); - zfs_probe_dev(devname, NULL); - } + /* + * Open all the disks we can find and see if we can reconstruct + * ZFS pools from them. + */ + for (unit = 0; unit < MAXBDDEV; unit++) { + if (bd_unit2bios(unit) == -1) + break; + sprintf(devname, "disk%d:", unit); + zfs_probe_dev(devname, NULL); + } } #endif From owner-svn-src-user@FreeBSD.ORG Mon Jul 16 11:58:45 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B727106564A; Mon, 16 Jul 2012 11:58:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06E278FC1B; Mon, 16 Jul 2012 11:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GBwilN038931; Mon, 16 Jul 2012 11:58:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GBwit8038929; Mon, 16 Jul 2012 11:58:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207161158.q6GBwit8038929@svn.freebsd.org> From: Doug Barton Date: Mon, 16 Jul 2012 11:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238532 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 11:58:45 -0000 Author: dougb Date: Mon Jul 16 11:58:44 2012 New Revision: 238532 URL: http://svn.freebsd.org/changeset/base/238532 Log: Turns out there are a non-zero number of distinfo files that have SIZE listed first, so in the code that parses them for the data to put into /var/db/pkg/$port/distfiles, handle this situation gracefully. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Jul 16 11:22:33 2012 (r238531) +++ user/dougb/portmaster/portmaster Mon Jul 16 11:58:44 2012 (r238532) @@ -3905,14 +3905,16 @@ if [ -n "$distfiles" ]; then for file in $distfiles; do while read line ; do case "$line" in - SHA256\ \(${port_subdir}${file}\)*) sha256=${line##* } ;; + SHA256\ \(${port_subdir}${file}\)*) sha256=${line##* } + [ -z "$size" ] && continue + echo "DISTFILE:${port_subdir}${file}:SIZE=${size}:SHA256=${sha256}" \ + >> $pm_mktemp_file ; unset sha256 size ; break ;; SIZE\ \(${port_subdir}${file}\)*) - [ -n "$sha256" ] || fail "$distinfo is out of order" + [ -z "$sha256" ] && { size=${line##* } ; continue; } echo "DISTFILE:${port_subdir}${file}:SIZE=${line##* }:SHA256=${sha256}" \ - >> $pm_mktemp_file ; break ;; + >> $pm_mktemp_file ; unset sha256 ; break ;; esac done < $distinfo - unset sha256 # Make sure any new distfiles get added to the list [ -n "$DI_FILES" -a ! "$$" -eq "$PM_PARENT_PID" ] && From owner-svn-src-user@FreeBSD.ORG Thu Jul 19 08:42:32 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EFBC1065674; Thu, 19 Jul 2012 08:42:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFD528FC1C; Thu, 19 Jul 2012 08:42:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J8gV70060638; Thu, 19 Jul 2012 08:42:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J8gVsx060636; Thu, 19 Jul 2012 08:42:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207190842.q6J8gVsx060636@svn.freebsd.org> From: Doug Barton Date: Thu, 19 Jul 2012 08:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238611 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 08:42:32 -0000 Author: dougb Date: Thu Jul 19 08:42:31 2012 New Revision: 238611 URL: http://svn.freebsd.org/changeset/base/238611 Log: Removing $ALL_FETCH was a mistake because the reason it existed previously is that $UPDATE_ALL cannot be exported to the children. So bring it back as $PM_ALL_FETCH. This is basically a cosmetic bug which will only show up when using -Faf Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Thu Jul 19 05:34:19 2012 (r238610) +++ user/dougb/portmaster/portmaster Thu Jul 19 08:42:31 2012 (r238611) @@ -2347,9 +2347,8 @@ update_port () { dep_of_deps=$(( $dep_of_deps + 1 )) - [ -n "$PM_FIRST_PASS" ] && - [ ! \( -n "$PM_FORCE" -a -n "$FETCH_ONLY" -a -n "$UPDATE_ALL" \) ] && - num_of_deps=$(( $num_of_deps + 1 )) + [ -n "$PM_FIRST_PASS" ] && [ ! \( -n "$PM_FORCE" -a -n "$PM_ALL_FETCH" \) ] && + num_of_deps=$(( $num_of_deps + 1 )) deps="(${dep_of_deps}/${num_of_deps})" @@ -3059,7 +3058,11 @@ all_first_pass () { [ -n "$DI_FILES" ] && (read_distinfos)& ports_by_category - [ -n "$FETCH_ONLY" -a -n "$PM_FORCE" ] && $num_of_deps=$num_ports + if [ -n "$FETCH_ONLY" ]; then + # UPDATE_ALL is not exported + export PM_ALL_FETCH=pm_all_fetch + [ -n "$PM_FORCE" ] && num_of_deps=$num_ports + fi unset num_ports init_term_printf All @@ -3340,7 +3343,7 @@ if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUIL TESTINT=`grep -l ^IS_INTERACTIVE Makefile` && TESTINT=`pm_make_b -V IS_INTERACTIVE` else - [ -n "$UPDATE_ALL" -a -n "$FETCH_ONLY" ] && safe_exit + [ -n "$PM_ALL_FETCH" ] && safe_exit fi if [ -n "$TESTINT" ]; then echo '' From owner-svn-src-user@FreeBSD.ORG Thu Jul 19 19:57:23 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEB6F106566C; Thu, 19 Jul 2012 19:57:23 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8CB48FC17; Thu, 19 Jul 2012 19:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JJvNQS015127; Thu, 19 Jul 2012 19:57:23 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JJvNau015124; Thu, 19 Jul 2012 19:57:23 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201207191957.q6JJvNau015124@svn.freebsd.org> From: Jakub Wojciech Klama Date: Thu, 19 Jul 2012 19:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238625 - user/jceel/soc2012_armv6/sys/arm/arm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 19:57:23 -0000 Author: jceel Date: Thu Jul 19 19:57:23 2012 New Revision: 238625 URL: http://svn.freebsd.org/changeset/base/238625 Log: Convert ARM GIC driver to INTRNG API. Modified: user/jceel/soc2012_armv6/sys/arm/arm/gic.c Modified: user/jceel/soc2012_armv6/sys/arm/arm/gic.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/gic.c Thu Jul 19 19:15:47 2012 (r238624) +++ user/jceel/soc2012_armv6/sys/arm/arm/gic.c Thu Jul 19 19:57:23 2012 (r238625) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" + /* We are using GICv2 register naming */ /* Distributor Registers */ @@ -84,32 +86,41 @@ __FBSDID("$FreeBSD$"); #define GICC_IIDR 0x00FC /* v1 ICCIIDR*/ struct arm_gic_softc { + device_t gic_dev; struct resource * gic_res[3]; bus_space_tag_t gic_c_bst; bus_space_tag_t gic_d_bst; bus_space_handle_t gic_c_bsh; bus_space_handle_t gic_d_bsh; + void * gic_intrhand; uint8_t ver; }; static struct resource_spec arm_gic_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Distributor registers */ { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* CPU Interrupt Intf. registers */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Parent interrupt */ { -1, 0 } }; static struct arm_gic_softc *arm_gic_sc = NULL; -#define gic_c_read_4(reg) \ - bus_space_read_4(arm_gic_sc->gic_c_bst, arm_gic_sc->gic_c_bsh, reg) -#define gic_c_write_4(reg, val) \ - bus_space_write_4(arm_gic_sc->gic_c_bst, arm_gic_sc->gic_c_bsh, reg, val) -#define gic_d_read_4(reg) \ - bus_space_read_4(arm_gic_sc->gic_d_bst, arm_gic_sc->gic_d_bsh, reg) -#define gic_d_write_4(reg, val) \ - bus_space_write_4(arm_gic_sc->gic_d_bst, arm_gic_sc->gic_d_bsh, reg, val) - -static void gic_post_filter(void *); +static int arm_gic_probe(device_t); +static int arm_gic_attach(device_t); +static int arm_gic_intr(void *); +static void arm_gic_config(device_t, int, enum intr_trigger, enum intr_polarity); +static void arm_gic_eoi(device_t, int); +static void arm_gic_mask(device_t, int); +static void arm_gic_unmask(device_t, int); + +#define gic_c_read_4(_sc, _reg) \ + bus_space_read_4((_sc)->gic_c_bst, (_sc)->gic_c_bsh, (_reg)) +#define gic_c_write_4(_sc, _reg, _val) \ + bus_space_write_4((_sc)->gic_c_bst, (_sc)->gic_c_bsh, (_reg), (_val)) +#define gic_d_read_4(_sc, _reg) \ + bus_space_read_4((_sc)->gic_d_bst, (_sc)->gic_d_bsh, (_reg)) +#define gic_d_write_4(_sc, _reg, _val) \ + bus_space_write_4((_sc)->gic_d_bst, (_sc)->gic_d_bsh, (_reg), (_val)) static int arm_gic_probe(device_t dev) @@ -126,19 +137,19 @@ gic_init_secondary(void) int nirqs; /* Get the number of interrupts */ - nirqs = gic_d_read_4(GICD_TYPER); + nirqs = gic_d_read_4(arm_gic_sc, GICD_TYPER); nirqs = 32 * ((nirqs & 0x1f) + 1); for (int i = 0; i < nirqs; i += 4) - gic_d_write_4(GICD_IPRIORITYR(i >> 2), 0); + gic_d_write_4(arm_gic_sc, GICD_IPRIORITYR(i >> 2), 0); /* Enable CPU interface */ - gic_c_write_4(GICC_CTLR, 1); + gic_c_write_4(arm_gic_sc, GICC_CTLR, 1); /* Enable interrupt distribution */ - gic_d_write_4(GICD_CTLR, 0x01); + gic_d_write_4(arm_gic_sc, GICD_CTLR, 0x01); /* Activate IRQ 29, ie private timer IRQ*/ - gic_d_write_4(GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F))); + gic_d_write_4(arm_gic_sc, GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F))); } static int @@ -155,9 +166,7 @@ arm_gic_attach(device_t dev) if (bus_alloc_resources(dev, arm_gic_spec, sc->gic_res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); - } - - arm_post_filter = gic_post_filter; + } /* Distributor Interface */ sc->gic_d_bst = rman_get_bustag(sc->gic_res[0]); @@ -167,74 +176,61 @@ arm_gic_attach(device_t dev) sc->gic_c_bst = rman_get_bustag(sc->gic_res[1]); sc->gic_c_bsh = rman_get_bushandle(sc->gic_res[1]); + arm_register_pic(dev); + + if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_MISC | INTR_CONTROLLER, + arm_gic_intr, NULL, sc, &sc->gic_intrhand)) { + device_printf(dev, "could not setup interrupt handler\n"); + bus_release_resources(dev, arm_gic_spec, sc->gic_res); + return (ENXIO); + } + arm_gic_sc = sc; /* Disable interrupt forwarding to the CPU interface */ - gic_d_write_4(GICD_CTLR, 0x00); + gic_d_write_4(sc, GICD_CTLR, 0x00); /* Get the number of interrupts */ - nirqs = gic_d_read_4(GICD_TYPER); + nirqs = gic_d_read_4(sc, GICD_TYPER); nirqs = 32 * ((nirqs & 0x1f) + 1); - icciidr = gic_c_read_4(GICC_IIDR); + icciidr = gic_c_read_4(sc, GICC_IIDR); device_printf(dev,"pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x nirqs %u\n", icciidr>>20, (icciidr>>16) & 0xF, (icciidr>>12) & 0xf, (icciidr & 0xfff), nirqs); /* Set all global interrupts to be level triggered, active low. */ for (i = 32; i < nirqs; i += 32) { - gic_d_write_4(GICD_ICFGR(i >> 5), 0x00000000); + gic_d_write_4(sc, GICD_ICFGR(i >> 5), 0x00000000); } /* Disable all interrupts. */ for (i = 32; i < nirqs; i += 32) { - gic_d_write_4(GICD_ICENABLER(i >> 5), 0xFFFFFFFF); + gic_d_write_4(sc, GICD_ICENABLER(i >> 5), 0xFFFFFFFF); } for (i = 0; i < nirqs; i += 4) { - gic_d_write_4(GICD_IPRIORITYR(i >> 2), 0); - gic_d_write_4(GICD_ITARGETSR(i >> 2), 0xffffffff); + gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); + gic_d_write_4(sc, GICD_ITARGETSR(i >> 2), 0xffffffff); } /* Enable CPU interface */ - gic_c_write_4(GICC_CTLR, 1); + gic_c_write_4(sc, GICC_CTLR, 1); /* Enable interrupt distribution */ - gic_d_write_4(GICD_CTLR, 0x01); + gic_d_write_4(sc, GICD_CTLR, 0x01); return (0); } -static device_method_t arm_gic_methods[] = { - DEVMETHOD(device_probe, arm_gic_probe), - DEVMETHOD(device_attach, arm_gic_attach), - { 0, 0 } -}; - -static driver_t arm_gic_driver = { - "gic", - arm_gic_methods, - sizeof(struct arm_gic_softc), -}; - -static devclass_t arm_gic_devclass; - -DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0); - -static void -gic_post_filter(void *arg) -{ - uintptr_t irq = (uintptr_t) arg; - - gic_c_write_4(GICC_EOIR, irq); -} - -int -arm_get_next_irq(int last_irq) +static int +arm_gic_intr(void *arg) { - uint32_t active_irq; + struct arm_intr_data *id = (struct arm_intr_data *)arg; + struct arm_gic_softc *sc = (struct arm_gic_softc *)id->arg; + uint32_t active_irq, last_irq = 0; - active_irq = gic_c_read_4(GICC_IAR); + active_irq = gic_c_read_4(sc, GICC_IAR); /* * Immediatly EOIR the SGIs, because doing so requires the other @@ -243,33 +239,77 @@ arm_get_next_irq(int last_irq) */ if ((active_irq & 0x3ff) < 16) - gic_c_write_4(GICC_EOIR, active_irq); + gic_c_write_4(sc, GICC_EOIR, active_irq); active_irq &= 0x3FF; if (active_irq == 0x3FF) { if (last_irq == -1) printf("Spurious interrupt detected [0x%08x]\n", active_irq); - return -1; + return (FILTER_HANDLED); } - gic_c_write_4(GICC_EOIR, active_irq); + + gic_c_write_4(sc, GICC_EOIR, active_irq); + arm_dispatch_irq(sc->gic_dev, id->tf, active_irq); - return active_irq; + return (FILTER_HANDLED); } -void -arm_mask_irq(uintptr_t nb) +static void +arm_gic_config(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) { - gic_d_write_4(GICD_ICENABLER(nb >> 5), (1UL << (nb & 0x1F))); + /* no-op */ } -void -arm_unmask_irq(uintptr_t nb) +static void +arm_gic_eoi(device_t dev, int irq) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + + gic_c_write_4(sc, GICC_EOIR, irq); +} + + +static void +arm_gic_mask(device_t dev, int irq) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + + gic_d_write_4(sc, GICD_ICENABLER(irq >> 5), (1UL << (irq & 0x1F))); +} + +static void +arm_gic_unmask(device_t dev, int irq) { + struct arm_gic_softc *sc = device_get_softc(dev); - gic_c_write_4(GICC_EOIR, nb); - gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F))); + gic_c_write_4(sc, GICC_EOIR, irq); + gic_d_write_4(sc, GICD_ISENABLER(irq >> 5), (1UL << (irq & 0x1F))); } +static device_method_t arm_gic_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, arm_gic_probe), + DEVMETHOD(device_attach, arm_gic_attach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_config, arm_gic_config), + DEVMETHOD(pic_mask, arm_gic_mask), + DEVMETHOD(pic_unmask, arm_gic_unmask), + DEVMETHOD(pic_eoi, arm_gic_eoi), + { 0, 0 } +}; + +static driver_t arm_gic_driver = { + "gic", + arm_gic_methods, + sizeof(struct arm_gic_softc), +}; + +static devclass_t arm_gic_devclass; + +DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0); + #ifdef SMP void pic_ipi_send(cpuset_t cpus, u_int ipi) @@ -279,7 +319,7 @@ pic_ipi_send(cpuset_t cpus, u_int ipi) for (i = 0; i < MAXCPU; i++) if (CPU_ISSET(i, &cpus)) val |= 1 << (16 + i); - gic_d_write_4(GICD_SGIR(0), val | ipi); + gic_d_write_4(arm_gic_sc, GICD_SGIR(0), val | ipi); } From owner-svn-src-user@FreeBSD.ORG Thu Jul 19 20:05:32 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6EB1065673; Thu, 19 Jul 2012 20:05:32 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67D2C8FC19; Thu, 19 Jul 2012 20:05:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JK5WDA015727; Thu, 19 Jul 2012 20:05:32 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JK5WEW015721; Thu, 19 Jul 2012 20:05:32 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201207192005.q6JK5WEW015721@svn.freebsd.org> From: Jakub Wojciech Klama Date: Thu, 19 Jul 2012 20:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238626 - in user/jceel/soc2012_armv6/sys: arm/conf arm/ti boot/fdt/dts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 20:05:32 -0000 Author: jceel Date: Thu Jul 19 20:05:31 2012 New Revision: 238626 URL: http://svn.freebsd.org/changeset/base/238626 Log: TI port refactoring: switched to INTRNG and mmu_init() in ti_machdep.c. There's some problem with PL310 L2 cache controller which hangs up the system - this will be investigated. Modified: user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD user/jceel/soc2012_armv6/sys/arm/ti/common.c user/jceel/soc2012_armv6/sys/arm/ti/files.ti user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c user/jceel/soc2012_armv6/sys/boot/fdt/dts/pandaboard.dts Modified: user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD Thu Jul 19 19:57:23 2012 (r238625) +++ user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD Thu Jul 19 20:05:31 2012 (r238626) @@ -67,6 +67,7 @@ options SYSVMSG #SYSV-style message q options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options ARM_INTRNG options PREEMPTION @@ -91,7 +92,7 @@ device gpio device pty -device pl310 # PL310 L2 cache controller +#device pl310 # PL310 L2 cache controller # Debugging for use in -current #options VERBOSE_SYSINIT #Enable verbose sysinit messages options KDB Modified: user/jceel/soc2012_armv6/sys/arm/ti/common.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/ti/common.c Thu Jul 19 19:57:23 2012 (r238625) +++ user/jceel/soc2012_armv6/sys/arm/ti/common.c Thu Jul 19 20:05:31 2012 (r238626) @@ -58,10 +58,10 @@ static int fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) { - +#if 0 if (!fdt_is_compatible(node, "arm,gic")) return (ENXIO); - +#endif *interrupt = fdt32_to_cpu(intr[0]); *trig = INTR_TRIGGER_CONFORM; *pol = INTR_POLARITY_CONFORM; Modified: user/jceel/soc2012_armv6/sys/arm/ti/files.ti ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/ti/files.ti Thu Jul 19 19:57:23 2012 (r238625) +++ user/jceel/soc2012_armv6/sys/arm/ti/files.ti Thu Jul 19 20:05:31 2012 (r238626) @@ -9,7 +9,7 @@ arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard -arm/arm/intr.c standard +arm/arm/intrng.c standard arm/ti/bus_space.c standard arm/ti/common.c standard Modified: user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c Thu Jul 19 19:57:23 2012 (r238625) +++ user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c Thu Jul 19 20:05:31 2012 (r238626) @@ -122,33 +122,11 @@ extern unsigned char _end[]; extern vm_offset_t ksym_start, ksym_end; #endif -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - -extern vm_offset_t pmap_bootstrap_lastaddr; extern int *end; struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; -/* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; -vm_offset_t pmap_bootstrap_lastaddr; -vm_paddr_t pmap_pa; - const struct pmap_devmap *pmap_devmap_bootstrap_table; -struct pv_addr systempage; -struct pv_addr msgbufpv; -struct pv_addr irqstack; -struct pv_addr undstack; -struct pv_addr abtstack; -struct pv_addr kernelstack; - -void set_stackptrs(int cpu); - -static struct trapframe proc0_tf; static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -156,10 +134,13 @@ static int availmem_regions_sz; static void print_kenv(void); static void print_kernel_section_addr(void); -static void physmap_init(void); -static int platform_devmap_init(void); void (*ti_cpu_reset)(void); +struct pmap_devmap arm_pmap_devmap[] = { + DEVMAP_FDT("console-uart", VM_PROT_READ | VM_PROT_WRITE, PTE_DEVICE), + DEVMAP_END, +}; + static char * kenv_next(char *cp) { @@ -204,111 +185,13 @@ print_kernel_section_addr(void) debugf(" _end = 0x%08x\n", (uint32_t)_end); } -static void -physmap_init(void) -{ - int i, j, cnt; - vm_offset_t phys_kernelend, kernload; - uint32_t s, e, sz; - struct mem_region *mp, *mp1; - - phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); - kernload = KERNPHYSADDR; - ti_cpu_reset = NULL; - - /* - * Remove kernel physical address range from avail - * regions list. Page align all regions. - * Non-page aligned memory isn't very interesting to us. - * Also, sort the entries for ascending addresses. - */ - sz = 0; - cnt = availmem_regions_sz; - debugf("processing avail regions:\n"); - for (mp = availmem_regions; mp->mr_size; mp++) { - s = mp->mr_start; - e = mp->mr_start + mp->mr_size; - debugf(" %08x-%08x -> ", s, e); - /* Check whether this region holds all of the kernel. */ - if (s < kernload && e > phys_kernelend) { - availmem_regions[cnt].mr_start = phys_kernelend; - availmem_regions[cnt++].mr_size = e - phys_kernelend; - e = kernload; - } - /* Look whether this regions starts within the kernel. */ - if (s >= kernload && s < phys_kernelend) { - if (e <= phys_kernelend) - goto empty; - s = phys_kernelend; - } - /* Now look whether this region ends within the kernel. */ - if (e > kernload && e <= phys_kernelend) { - if (s >= kernload) { - goto empty; - } - e = kernload; - } - /* Now page align the start and size of the region. */ - s = round_page(s); - e = trunc_page(e); - if (e < s) - e = s; - sz = e - s; - debugf("%08x-%08x = %x\n", s, e, sz); - - /* Check whether some memory is left here. */ - if (sz == 0) { - empty: - printf("skipping\n"); - bcopy(mp + 1, mp, - (cnt - (mp - availmem_regions)) * sizeof(*mp)); - cnt--; - mp--; - continue; - } - - /* Do an insertion sort. */ - for (mp1 = availmem_regions; mp1 < mp; mp1++) - if (s < mp1->mr_start) - break; - if (mp1 < mp) { - bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); - mp1->mr_start = s; - mp1->mr_size = sz; - } else { - mp->mr_start = s; - mp->mr_size = sz; - } - } - availmem_regions_sz = cnt; - - /* Fill in phys_avail table, based on availmem_regions */ - debugf("fill in phys_avail:\n"); - for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { - - debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", - availmem_regions[i].mr_start, - availmem_regions[i].mr_start + availmem_regions[i].mr_size, - availmem_regions[i].mr_size); - - phys_avail[j] = availmem_regions[i].mr_start; - phys_avail[j + 1] = availmem_regions[i].mr_start + - availmem_regions[i].mr_size; - } - phys_avail[j] = 0; - phys_avail[j + 1] = 0; -} - void * initarm(void *mdp, void *unused __unused) { - struct pv_addr kernel_l1pt; - struct pv_addr dpcpu; - vm_offset_t dtbp, freemempos, l2_start, lastaddr; - uint32_t memsize, l2size; + vm_offset_t dtbp, lastaddr; + uint32_t memsize; void *kmdp; - u_int l1pagetable; - int i = 0, j = 0; + void *sp; kmdp = NULL; lastaddr = 0; @@ -371,134 +254,9 @@ initarm(void *mdp, void *unused __unused // while (1); /* Platform-specific initialisation */ - pmap_bootstrap_lastaddr = DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE; - pcpu0_init(); - /* Calculate number of L2 tables needed for mapping vm_page_array */ - l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page); - l2size = (l2size >> L1_S_SHIFT) + 1; - - /* - * Add one table for end of kernel map, one for stacks, msgbuf and - * L1 and L2 tables map and one for vectors map. - */ - l2size += 3; - - /* Make it divisible by 4 */ - l2size = (l2size + 3) & ~3; - -#define KERNEL_TEXT_BASE (KERNBASE) - freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; - - /* Define a macro to simplify memory allocation */ -#define valloc_pages(var, np) \ - alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); - -#define alloc_pages(var, np) \ - (var) = freemempos; \ - freemempos += (np * PAGE_SIZE); \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); - - while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) - freemempos += PAGE_SIZE; - valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - - for (i = 0; i < l2size; ++i) { - if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { - valloc_pages(kernel_pt_table[i], - L2_TABLE_SIZE / PAGE_SIZE); - j = i; - } else { - kernel_pt_table[i].pv_va = kernel_pt_table[j].pv_va + - L2_TABLE_SIZE_REAL * (i - j); - kernel_pt_table[i].pv_pa = - kernel_pt_table[i].pv_va - KERNVIRTADDR + - KERNPHYSADDR; - - } - } - /* - * Allocate a page for the system page mapped to 0x00000000 - * or 0xffff0000. This page will just contain the system vectors - * and can be shared by all processes. - */ - valloc_pages(systempage, 1); - - /* Allocate dynamic per-cpu area. */ - valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE); - dpcpu_init((void *)dpcpu.pv_va, 0); - - /* Allocate stacks for all modes */ - valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU)); - valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); - valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); - valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); - - init_param1(); - - valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); - - /* - * Now we start construction of the L1 page table - * We start by mapping the L2 page tables into the L1. - * This means that we can replace L1 mappings later on if necessary - */ - l1pagetable = kernel_l1pt.pv_va; - - /* - * Try to map as much as possible of kernel text and data using - * 1MB section mapping and for the rest of initial kernel address - * space use L2 coarse tables. - * - * Link L2 tables for mapping remainder of kernel (modulo 1MB) - * and kernel structures - */ - l2_start = lastaddr & ~(L1_S_OFFSET); - for (i = 0 ; i < l2size - 1; i++) - pmap_link_l2pt(l1pagetable, l2_start + i * L1_S_SIZE, - &kernel_pt_table[i]); - - pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - - /* Map kernel code and data */ - pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, - (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - - - /* Map L1 directory and allocated L2 page tables */ - pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, - L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); - - pmap_map_chunk(l1pagetable, kernel_pt_table[0].pv_va, - kernel_pt_table[0].pv_pa, - L2_TABLE_SIZE_REAL * l2size, - VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); - - /* Map allocated DPCPU, stacks and msgbuf */ - pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, - freemempos - dpcpu.pv_va, - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - - /* Link and map the vector page */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH, - &kernel_pt_table[l2size - 1]); - pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); - - /* Map pmap_devmap[] entries */ - if (platform_devmap_init() != 0) - while (1); - pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); - - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | - DOMAIN_CLIENT); - pmap_pa = kernel_l1pt.pv_pa; - setttb(kernel_l1pt.pv_pa); - cpu_tlb_flushID(); - cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); + sp = arm_mmu_init(memsize, lastaddr, true); /* * Only after the SOC registers block is mapped we can perform device @@ -517,115 +275,18 @@ initarm(void *mdp, void *unused __unused print_kernel_section_addr(); print_kenv(); - /* - * Pages were allocated during the secondary bootstrap for the - * stacks for different CPU modes. - * We must now set the r13 registers in the different CPU modes to - * point to these stacks. - * Since the ARM stacks use STMFD etc. we must set r13 to the top end - * of the stack memory. - */ - cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - - set_stackptrs(0); - - /* - * We must now clean the cache again.... - * Cleaning may be done by reading new data to displace any - * dirty data in the cache. This will have happened in setttb() - * but since we are boot strapping the addresses used for the read - * may have just been remapped and thus the cache could be out - * of sync. A re-clean after the switch will cure this. - * After booting there are no gross relocations of the kernel thus - * this problem will not occur after initarm(). - */ - cpu_idcache_wbinv_all(); - - /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; - undefined_init(); - - proc_linkup0(&proc0, &thread0); - thread0.td_kstack = kernelstack.pv_va; - thread0.td_kstack_pages = KSTACK_PAGES; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; - thread0.td_pcb->pcb_flags = 0; - thread0.td_frame = &proc0_tf; - pcpup->pc_curpcb = thread0.td_pcb; - - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - - dump_avail[0] = 0; - dump_avail[1] = memsize; - dump_avail[2] = 0; - dump_avail[3] = 0; - - pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); - msgbufp = (void *)msgbufpv.pv_va; - msgbufinit(msgbufp, msgbufsize); mutex_init(); /* * Prepare map of physical memory regions available to vm subsystem. */ - physmap_init(); + physmap_init(availmem_regions, availmem_regions_sz); /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); - return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - - sizeof(struct pcb))); -} - -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - -#define FDT_DEVMAP_MAX (2) // FIXME -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - - -/* - * Construct pmap_devmap[] with DT-derived config data. - */ -static int -platform_devmap_init(void) -{ - int i = 0; -#if defined(SOC_OMAP4) - fdt_devmap[i].pd_va = 0xE8000000; - fdt_devmap[i].pd_pa = 0x48000000; - fdt_devmap[i].pd_size = 0x1000000; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; -#elif defined(SOC_TI_AM335X) - fdt_devmap[i].pd_va = 0xE4C00000; - fdt_devmap[i].pd_pa = 0x44C00000; /* L4_WKUP */ - fdt_devmap[i].pd_size = 0x400000; /* 4 MB */ - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; -#else -#error "Unknown SoC" -#endif - - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - return (0); + return (sp); } struct arm32_dma_range * Modified: user/jceel/soc2012_armv6/sys/boot/fdt/dts/pandaboard.dts ============================================================================== --- user/jceel/soc2012_armv6/sys/boot/fdt/dts/pandaboard.dts Thu Jul 19 19:57:23 2012 (r238625) +++ user/jceel/soc2012_armv6/sys/boot/fdt/dts/pandaboard.dts Thu Jul 19 20:05:31 2012 (r238626) @@ -58,6 +58,7 @@ interrupt-controller; #address-cells = <0>; #interrupt-cells = <1>; + interrupts = < 0 >; reg = < 0x48241000 0x1000 >, /* Distributor Registers */ < 0x48240100 0x0100 >; /* CPU Interface Registers */ }; @@ -66,6 +67,7 @@ compatible = "arm,pl310"; reg = < 0x48242000 0x1000 >; }; + mp_tmr@48240200 { compatible = "arm,mpcore-timers"; clock-frequency = < 504000000 >; From owner-svn-src-user@FreeBSD.ORG Fri Jul 20 07:22:38 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F21C1065673; Fri, 20 Jul 2012 07:22:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BA328FC1D; Fri, 20 Jul 2012 07:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K7Mcf6068502; Fri, 20 Jul 2012 07:22:38 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K7Mcba068500; Fri, 20 Jul 2012 07:22:38 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207200722.q6K7Mcba068500@svn.freebsd.org> From: Doug Barton Date: Fri, 20 Jul 2012 07:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238649 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 07:22:38 -0000 Author: dougb Date: Fri Jul 20 07:22:37 2012 New Revision: 238649 URL: http://svn.freebsd.org/changeset/base/238649 Log: Use a more robust method of determining portdir from $PWD. This also works for bare 'portmaster' with no arguments now, if you're in a port directory. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Fri Jul 20 07:17:24 2012 (r238648) +++ user/dougb/portmaster/portmaster Fri Jul 20 07:22:37 2012 (r238649) @@ -3118,12 +3118,18 @@ if [ -z "$REPLACE_ORIGIN" ]; then [ -n "$portdir" ] && { argv=$portdir ; unset portdir; } argv=${argv:-$1} ; argv=${argv%/} ; argv=`globstrip $argv` case "$argv" in - '') echo '' ; no_valid_port ;; $pd/*) portdir=${argv#$pd/} ;; $pdb/*) upg_port=${argv#$pdb/} ;; /*) echo '' ; no_valid_port ;; */*) portdir=$argv ;; - \.) portdir=${PWD##*/ports/} ;; # Not always $pd, could be symlink + \.|'') portdir="$PWD" + while : ; do + case "$portdir" in + */*/*) portdir="${portdir#*/}" ;; + */*) break ;; + *) echo '' ; no_valid_port ;; + esac + done ;; *) [ -d "$pdb/$argv" ] && upg_port=$argv ;; esac From owner-svn-src-user@FreeBSD.ORG Fri Jul 20 08:36:54 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0749A106566B; Fri, 20 Jul 2012 08:36:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E69028FC18; Fri, 20 Jul 2012 08:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K8arGZ074108; Fri, 20 Jul 2012 08:36:53 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K8araT074106; Fri, 20 Jul 2012 08:36:53 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207200836.q6K8araT074106@svn.freebsd.org> From: Doug Barton Date: Fri, 20 Jul 2012 08:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238654 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 08:36:54 -0000 Author: dougb Date: Fri Jul 20 08:36:53 2012 New Revision: 238654 URL: http://svn.freebsd.org/changeset/base/238654 Log: Bug fix: Do read_distinfos() in the background for multiport() too, oops Update the comment re read_distinfos() in the single port code to reflect current reality Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Fri Jul 20 08:33:23 2012 (r238653) +++ user/dougb/portmaster/portmaster Fri Jul 20 08:36:53 2012 (r238654) @@ -2834,6 +2834,8 @@ multiport () { fi unset portlist + [ -n "$DI_FILES" ] && (read_distinfos)& + # First Pass if [ -n "$PM_BUILD_ONLY_LIST" ]; then PM_BUILD_ONLY_LIST=pmp_doing_build_deps @@ -3302,7 +3304,7 @@ fi # Do these things first time through if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUILDING" -a -z "$SHOW_WORK" -a -z "$NO_ACTION" ]; then - # Do not start this in the background until we are sure we are going to build + # Do not start this in the background until we are sure we are going to proceed [ "$$" -eq "$PM_PARENT_PID" -a -n "$DI_FILES" ] && (read_distinfos)& # Handle the problem of manual fetching