CVS commit: src/usr.sbin/ldpd
Module Name:src Committed By: kefren Date: Thu Jul 18 06:07:45 UTC 2013 Modified Files: src/usr.sbin/ldpd: label.c label.h ldp_command.c ldp_command.h ldp_peer.c mpls_interface.c mpls_interface.h mpls_routes.c socketops.c tlv_stack.c Log Message: Make sure labels are always updated when a route is added and when a peer is added Rework mpls_add_label according to that so no route refresh is done anymore Use poll when reading the PF_ROUTE socket setsockopt SO_USELOOPBACK on the PF_ROUTE socket Output some information on SIGINFO Allow map changing for a ldp peer Finally fix the connected routes admission into labels Correct the route trigger when a label map is received To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/ldpd/label.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/ldpd/label.h cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/ldpd/ldp_command.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/ldpd/ldp_command.h cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/ldpd/ldp_peer.c cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/ldpd/mpls_interface.c \ src/usr.sbin/ldpd/tlv_stack.c cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/ldpd/mpls_interface.h cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/ldpd/mpls_routes.c cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/ldpd/socketops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/ldpd/label.c diff -u src/usr.sbin/ldpd/label.c:1.7 src/usr.sbin/ldpd/label.c:1.8 --- src/usr.sbin/ldpd/label.c:1.7 Tue Jul 16 02:54:32 2013 +++ src/usr.sbin/ldpd/label.c Thu Jul 18 06:07:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: label.c,v 1.7 2013/07/16 02:54:32 kefren Exp $ */ +/* $NetBSD: label.c,v 1.8 2013/07/18 06:07:45 kefren Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -70,12 +70,13 @@ label_add(const union sockunion * so_des assert(so_dest); assert(so_pref); assert(so_dest-sa.sa_family == so_pref-sa.sa_family); + assert(label_get(so_dest, so_pref) == NULL); - memcpy(l-so_dest, so_dest, sizeof(union sockunion)); - memcpy(l-so_pref, so_pref, sizeof(union sockunion)); + memcpy(l-so_dest, so_dest, so_dest-sa.sa_len); + memcpy(l-so_pref, so_pref, so_pref-sa.sa_len); if (so_gate) - memcpy(l-so_gate, so_gate, sizeof(union sockunion)); + memcpy(l-so_gate, so_gate, so_gate-sa.sa_len); if (binding) l-binding = binding; else @@ -130,8 +131,8 @@ label_reattach_route(struct label *l, in /* Delete and re-add IPv4 route */ if (get_route(rg, l-so_dest, l-so_pref, 1) == LDP_E_OK) { delete_route(l-so_dest, l-so_pref, NO_FREESO); - add_route(l-so_dest, l-so_pref, l-so_gate, NULL, NULL, - NO_FREESO, RTM_READD); + add_route(l-so_dest, l-so_pref, l-so_gate, NULL, + NULL, NO_FREESO, RTM_READD); } else if (from_union_to_cidr(l-so_pref) == 32 l-so_dest.sa.sa_family == AF_INET get_route(rg, l-so_dest, NULL, 1) == LDP_E_OK) { @@ -225,15 +226,15 @@ label_del_by_binding(uint32_t binding, i struct label* label_get_by_prefix(const struct sockaddr *a, int prefixlen) { - union sockunion *so_dest, *so_pref; + const union sockunion *so_dest; + union sockunion *so_pref; struct label *l; - so_dest = make_inet_union(satos(a)); // XXX: grobian + so_dest = (const union sockunion *)a; so_pref = from_cidr_to_union(prefixlen); l = label_get(so_dest, so_pref); - free(so_dest); free(so_pref); return l; @@ -271,3 +272,20 @@ change_local_label(struct label *l, uint from_union_to_cidr((l-so_pref)), l-binding); } + +void +label_check_assoc(struct ldp_peer *p) +{ + struct label *l; + struct ldp_peer_address *wp; + + SLIST_FOREACH (l, label_head, labels) + if (l-p == NULL l-so_gate.sa.sa_family != 0) + SLIST_FOREACH(wp, p-ldp_peer_address_head, addresses) +if (sockaddr_cmp(l-so_gate.sa, +wp-address.sa) == 0){ + l-p = p; + l-label = MPLS_LABEL_IMPLNULL; + break; +} +} Index: src/usr.sbin/ldpd/label.h diff -u src/usr.sbin/ldpd/label.h:1.4 src/usr.sbin/ldpd/label.h:1.5 --- src/usr.sbin/ldpd/label.h:1.4 Thu Jul 11 10:46:19 2013 +++ src/usr.sbin/ldpd/label.h Thu Jul 18 06:07:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: label.h,v 1.4 2013/07/11 10:46:19 kefren Exp $ */ +/* $NetBSD: label.h,v 1.5 2013/07/18 06:07:45 kefren Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -69,5 +69,6 @@ struct label * label_get_by_prefix(const uint32_t get_free_local_label(void); void change_local_label(struct label*, uint32_t); void label_reattach_route(struct label*, int); +void label_check_assoc(struct ldp_peer *p); #endif /* !_LABEL_H_ */ Index: src/usr.sbin/ldpd/ldp_command.c diff -u src/usr.sbin/ldpd/ldp_command.c:1.11 src/usr.sbin/ldpd/ldp_command.c:1.12 --- src/usr.sbin/ldpd/ldp_command.c:1.11 Tue Jul 16 02:54:32 2013 +++ src/usr.sbin/ldpd/ldp_command.c Thu Jul 18 06:07:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ldp_command.c,v 1.11 2013/07/16 02:54:32 kefren Exp $ */ +/*
CVS commit: src/sys/netmpls
Module Name:src Committed By: kefren Date: Thu Jul 18 06:23:07 UTC 2013 Modified Files: src/sys/netmpls: mpls_proto.c Log Message: explicitly call sysctl setup in init. Needed for future dynamic loading To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/netmpls/mpls_proto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netmpls/mpls_proto.c diff -u src/sys/netmpls/mpls_proto.c:1.3 src/sys/netmpls/mpls_proto.c:1.4 --- src/sys/netmpls/mpls_proto.c:1.3 Wed Feb 1 16:49:36 2012 +++ src/sys/netmpls/mpls_proto.c Thu Jul 18 06:23:07 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mpls_proto.c,v 1.3 2012/02/01 16:49:36 christos Exp $ */ +/* $NetBSD: mpls_proto.c,v 1.4 2013/07/18 06:23:07 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: mpls_proto.c,v 1.3 2012/02/01 16:49:36 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: mpls_proto.c,v 1.4 2013/07/18 06:23:07 kefren Exp $); #include opt_inet.h #include opt_mbuftrace.h @@ -51,6 +51,7 @@ struct ifqueue mplsintrq; static int mpls_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *); +static void sysctl_net_mpls_setup(struct sysctllog **); #ifdef MBUFTRACE struct mowner mpls_owner = MOWNER_INIT(MPLS, ); @@ -72,6 +73,8 @@ void mpls_init(void) #endif memset(mplsintrq, 0, sizeof(mplsintrq)); mplsintrq.ifq_maxlen = 256; + + sysctl_net_mpls_setup(NULL); } DOMAIN_DEFINE(mplsdomain); @@ -134,7 +137,8 @@ mpls_usrreq(struct socket *so, int req, /* * Sysctl for MPLS variables. */ -SYSCTL_SETUP(sysctl_net_mpls_setup, sysctl net.mpls subtree setup) +static void +sysctl_net_mpls_setup(struct sysctllog **clog) { sysctl_createv(clog, 0, NULL, NULL,
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu Jul 18 06:39:18 UTC 2013 Modified Files: src/share/man/man9: kcpuset.9 Log Message: New sentence, new line. Some whitespace. Bump date for previous. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/kcpuset.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/kcpuset.9 diff -u src/share/man/man9/kcpuset.9:1.6 src/share/man/man9/kcpuset.9:1.7 --- src/share/man/man9/kcpuset.9:1.6 Wed Jul 17 22:36:26 2013 +++ src/share/man/man9/kcpuset.9 Thu Jul 18 06:39:18 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: kcpuset.9,v 1.6 2013/07/17 22:36:26 matt Exp $ */ +.\ $NetBSD: kcpuset.9,v 1.7 2013/07/18 06:39:18 wiz Exp $ */ .\ .\ Copyright (c) 2011 Jukka Ruohonen jruohonen.iki.fi .\ All rights reserved. @@ -25,7 +25,7 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd September 16, 2012 +.Dd July 17, 2013 .Dt KCPUSET 9 .Os .Sh NAME @@ -272,9 +272,10 @@ Returns the lowest numbered .Ft cpu present in .Fa kcp -plus 1. If +plus 1. +If .Fa kcp -is empty, a value of 0 is returned . +is empty, a value of 0 is returned. .Fa kcp .It Fn kcpuset_ffs_intersecting kcp1 kcp2 Returns the lowest numbered @@ -283,7 +284,8 @@ present in the intersection of .Fa kcp1 and .Fa kcp2 -plus 1. If the intersection is empty, a value of 0 is returned . +plus 1. +If the intersection is empty, a value of 0 is returned. .It Fn kcpuset_countset kcp Counts how many CPUs are in the set .Fa kcp .
CVS commit: src/sys/miscfs/procfs
Module Name:src Committed By: ryo Date: Thu Jul 18 07:59:44 UTC 2013 Modified Files: src/sys/miscfs/procfs: procfs_map.c Log Message: PR/48048: Add a missing vm_map_unlock_read() and uvmspace_free() to the ENOMEM error case in procfs_domap()d To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/miscfs/procfs/procfs_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/miscfs/procfs/procfs_map.c diff -u src/sys/miscfs/procfs/procfs_map.c:1.42 src/sys/miscfs/procfs/procfs_map.c:1.43 --- src/sys/miscfs/procfs/procfs_map.c:1.42 Sun May 6 03:13:11 2012 +++ src/sys/miscfs/procfs/procfs_map.c Thu Jul 18 07:59:44 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_map.c,v 1.42 2012/05/06 03:13:11 christos Exp $ */ +/* $NetBSD: procfs_map.c,v 1.43 2013/07/18 07:59:44 ryo Exp $ */ /* * Copyright (c) 1993 @@ -76,7 +76,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: procfs_map.c,v 1.42 2012/05/06 03:13:11 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: procfs_map.c,v 1.43 2013/07/18 07:59:44 ryo Exp $); #include sys/param.h #include sys/systm.h @@ -208,6 +208,8 @@ again: bufsize = 1; if (bufsize MAXBUFFERSIZE) { error = ENOMEM; +vm_map_unlock_read(map); +uvmspace_free(vm); goto out; } free(buffer, M_TEMP);
CVS commit: src/lib/libperfuse
Module Name:src Committed By: manu Date: Thu Jul 18 09:01:20 UTC 2013 Modified Files: src/lib/libperfuse: ops.c Log Message: One more explicit error log, and two bug fixes 1) with recent FUSE, when lookup returns a null ino, it means ENOENT 2) odd corner case that caused a bug on dd if=test of=test conv=notrunc This caused the file to be open first ro, then rw. A logic bug in perfuse_node_open caused it to skip the second operation, whereas it should open for writing, and store the write FH without touching the read FH. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/lib/libperfuse/ops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libperfuse/ops.c diff -u src/lib/libperfuse/ops.c:1.60 src/lib/libperfuse/ops.c:1.61 --- src/lib/libperfuse/ops.c:1.60 Sat Nov 3 15:43:20 2012 +++ src/lib/libperfuse/ops.c Thu Jul 18 09:01:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ops.c,v 1.60 2012/11/03 15:43:20 manu Exp $ */ +/* $NetBSD: ops.c,v 1.61 2013/07/18 09:01:20 manu Exp $ */ /*- * Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved. @@ -1369,10 +1369,29 @@ perfuse_node_open(struct puffs_usermount * Do not open twice, and do not reopen for reading * if we already have write handle. */ - if (((mode FREAD) (pnd-pnd_flags PND_RFH)) || - ((mode FREAD) (pnd-pnd_flags PND_WFH)) || - ((mode FWRITE) (pnd-pnd_flags PND_WFH))) - goto out; + switch (mode (FREAD|FWRITE)) { + case FREAD: + if (pnd-pnd_flags (PND_RFH|PND_WFH)) + goto out; + break; + case FWRITE: + if (pnd-pnd_flags PND_WFH) + goto out; + break; + case FREAD|FWRITE: + if (pnd-pnd_flags PND_WFH) + goto out; + + /* + * Corner case: if already open for reading (PND_RFH) + * and re-opening FREAD|FWRITE, we need to reopen, + * but only for writing. Note the change on mode + * will only affect perfuse_new_fh() + */ + if (pnd-pnd_flags PND_RFH) + mode = ~FREAD; + break; + } /* * Queue open on a node so that we do not open @@ -2723,8 +2742,8 @@ perfuse_node_reclaim(struct puffs_usermo #ifdef PERFUSE_DEBUG if ((pnd-pnd_flags PND_OPEN) || !TAILQ_EMPTY(pnd-pnd_pcq)) - DERRX(EX_SOFTWARE, %s: opc = %p: still open, - __func__, opc); + DERRX(EX_SOFTWARE, %s: opc = %p \%s\: still open, + __func__, opc, pnd-pnd_name); if ((pnd-pnd_flags PND_BUSY) || !TAILQ_EMPTY(pnd-pnd_pcq))
CVS commit: src/usr.sbin/ldpd
Module Name:src Committed By: kefren Date: Thu Jul 18 11:45:36 UTC 2013 Modified Files: src/usr.sbin/ldpd: label.c label.h mpls_interface.c mpls_routes.c mpls_routes.h tlv_stack.c Log Message: * rework the reattachment code * build an implnull label when a route is added and let mpls_add_label to take care of relabelling * take out last piece of the code where we do route lookups - we should have every information we need in labels * tested these changes using a number of rump kernels and some couple of thousands of flapping routes To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/ldpd/label.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/ldpd/label.h \ src/usr.sbin/ldpd/mpls_routes.h cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/ldpd/mpls_interface.c \ src/usr.sbin/ldpd/tlv_stack.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/ldpd/mpls_routes.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/ldpd/label.c diff -u src/usr.sbin/ldpd/label.c:1.8 src/usr.sbin/ldpd/label.c:1.9 --- src/usr.sbin/ldpd/label.c:1.8 Thu Jul 18 06:07:45 2013 +++ src/usr.sbin/ldpd/label.c Thu Jul 18 11:45:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: label.c,v 1.8 2013/07/18 06:07:45 kefren Exp $ */ +/* $NetBSD: label.c,v 1.9 2013/07/18 11:45:36 kefren Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -106,53 +106,39 @@ label_del(struct label * l) } /* - * Delete or Reuse the old IPv4 route, delete MPLS route (if any) + * Delete or Reuse the old IPv4 route, delete MPLS route + * readd = REATT_INET_CHANGE - delete and recreate the INET route + * readd = REATT_INET_DEL - deletes INET route + * readd = REATT_INET_NODEL - doesn't touch the INET route */ void label_reattach_route(struct label *l, int readd) { - union sockunion *u; - union sockunion emptysu; - struct rt_msg rg; - int oldbinding = l-binding; warnp([label_reattach_route] binding %d deleted\n, l-binding); - l-p = NULL; - l-binding = MPLS_LABEL_IMPLNULL; - /* No gateway ? */ - memset(emptysu, 0, sizeof (union sockunion)); - if (memcmp(l-so_gate, emptysu, sizeof(union sockunion)) == 0) + if (l-so_gate.sa.sa_len == 0) return; - if (l-label != MPLS_LABEL_IMPLNULL readd == LDP_READD_CHANGE) { - /* Delete and re-add IPv4 route */ - if (get_route(rg, l-so_dest, l-so_pref, 1) == LDP_E_OK) { - delete_route(l-so_dest, l-so_pref, NO_FREESO); - add_route(l-so_dest, l-so_pref, l-so_gate, NULL, - NULL, NO_FREESO, RTM_READD); - } else if (from_union_to_cidr(l-so_pref) == 32 - l-so_dest.sa.sa_family == AF_INET - get_route(rg, l-so_dest, NULL, 1) == LDP_E_OK) { - delete_route(l-so_dest, NULL, NO_FREESO); - add_route(l-so_dest, NULL, l-so_gate, NULL, NULL, - NO_FREESO, RTM_READD); - } else - add_route(l-so_dest, l-so_pref, - l-so_gate, NULL, NULL, NO_FREESO, RTM_READD); - } else - if (readd != LDP_READD_NODEL) - delete_route(l-so_dest, l-so_pref, NO_FREESO); + if (readd == REATT_INET_CHANGE) { + /* Delete the tagged route and re-add IPv4 route */ + delete_route(l-so_dest, + l-so_pref.sa.sa_len != 0 ? l-so_pref : NULL, NO_FREESO); + add_route(l-so_dest, + l-so_pref.sa.sa_len != 0 ? l-so_pref : NULL, l-so_gate, + NULL, NULL, NO_FREESO, RTM_READD); + } else if (readd == REATT_INET_DEL) + delete_route(l-so_dest, l-so_pref, NO_FREESO); + + /* Deletes the MPLS route */ + if (l-binding = min_label) + delete_route(make_mpls_union(l-binding), NULL, FREESO); + l-binding = MPLS_LABEL_IMPLNULL; + l-p = NULL; l-label = 0; - - /* Deletes pure MPLS route */ - if (oldbinding = min_label) { - u = make_mpls_union(oldbinding); - delete_route(u, NULL, FREESO); - } } /* * Get a label by dst and pref @@ -260,14 +246,14 @@ get_free_local_label() } /* - * Change local binding + * Announce peers that a label has changed its binding + * by withdrawing it and reannouncing it */ void -change_local_label(struct label *l, uint32_t newbind) +announce_label_change(struct label *l) { send_withdraw_tlv_to_all((l-so_dest.sa), from_union_to_cidr((l-so_pref))); - l-binding = newbind; send_label_tlv_to_all((l-so_dest.sa), from_union_to_cidr((l-so_pref)), l-binding); Index: src/usr.sbin/ldpd/label.h diff -u src/usr.sbin/ldpd/label.h:1.5 src/usr.sbin/ldpd/label.h:1.6 --- src/usr.sbin/ldpd/label.h:1.5 Thu Jul 18 06:07:45 2013 +++ src/usr.sbin/ldpd/label.h Thu Jul 18 11:45:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: label.h,v 1.5 2013/07/18 06:07:45 kefren Exp $ */ +/* $NetBSD: label.h,v 1.6 2013/07/18 11:45:36 kefren Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -37,9 +37,9 @@ #include mpls_routes.h #include ldp_peer.h -#define LDP_READD_NODEL 0 -#define LDP_READD_CHANGE 1 -#define LDP_READD_NOCHANGE 2 +#define REATT_INET_CHANGE 0 +#define REATT_INET_DEL 1 +#define REATT_INET_NODEL 2 /* * MPLS label descriptor @@
CVS commit: src/lib/libc/arch/m68k/hardfloat
Module Name:src Committed By: matt Date: Thu Jul 18 12:05:30 UTC 2013 Added Files: src/lib/libc/arch/m68k/hardfloat: ledf2.S lesf2.S ltdf2.S ltsf2.S nedf2.S nesf2.S unorddf2.S unordsf2.S Log Message: Add more softfloat compatible functions To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/m68k/hardfloat/ledf2.S \ src/lib/libc/arch/m68k/hardfloat/lesf2.S \ src/lib/libc/arch/m68k/hardfloat/ltdf2.S \ src/lib/libc/arch/m68k/hardfloat/ltsf2.S \ src/lib/libc/arch/m68k/hardfloat/nedf2.S \ src/lib/libc/arch/m68k/hardfloat/nesf2.S \ src/lib/libc/arch/m68k/hardfloat/unorddf2.S \ src/lib/libc/arch/m68k/hardfloat/unordsf2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libc/arch/m68k/hardfloat/ledf2.S diff -u /dev/null src/lib/libc/arch/m68k/hardfloat/ledf2.S:1.1 --- /dev/null Thu Jul 18 12:05:30 2013 +++ src/lib/libc/arch/m68k/hardfloat/ledf2.S Thu Jul 18 12:05:30 2013 @@ -0,0 +1,55 @@ +/* $NetBSD: ledf2.S,v 1.1 2013/07/18 12:05:30 matt Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#include machine/asm.h + +#if defined(LIBC_SCCS) !defined(lint) +RCSID($NetBSD: ledf2.S,v 1.1 2013/07/18 12:05:30 matt Exp $) +#endif /* LIBC_SCCS and not lint */ + +STRONG_ALIAS(__gtdf2,__ledf2) + +/* libgcc1.c says a b */ +/* libgcc1.c says 1 - (a = b) */ +ENTRY(__ledf2) + fmoved 4(%sp),%fp0 + fcmpd 12(%sp),%fp0 + fbgt Lbgt + movql #1,%d0 + rts +Lbgt: + clrl %d0 + rts +END(__ledf2) Index: src/lib/libc/arch/m68k/hardfloat/lesf2.S diff -u /dev/null src/lib/libc/arch/m68k/hardfloat/lesf2.S:1.1 --- /dev/null Thu Jul 18 12:05:30 2013 +++ src/lib/libc/arch/m68k/hardfloat/lesf2.S Thu Jul 18 12:05:30 2013 @@ -0,0 +1,55 @@ +/* $NetBSD: lesf2.S,v 1.1 2013/07/18 12:05:30 matt Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES
CVS commit: src/sys/arch
Module Name:src Committed By: joerg Date: Thu Jul 18 12:15:16 UTC 2013 Modified Files: src/sys/arch/amiga/stand/bootblock/boot: Makefile src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile src/sys/arch/amiga/stand/bootblock/ppcboot: Makefile src/sys/arch/vax/boot: Makefile.inc Log Message: Explicitly disable unwind tables for the boot loader. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/amiga/stand/bootblock/boot/Makefile cvs rdiff -u -r1.18 -r1.19 \ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile cvs rdiff -u -r1.14 -r1.15 src/sys/arch/vax/boot/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amiga/stand/bootblock/boot/Makefile diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.47 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.48 --- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.47 Tue Oct 4 04:04:15 2011 +++ src/sys/arch/amiga/stand/bootblock/boot/Makefile Thu Jul 18 12:15:15 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.47 2011/10/04 04:04:15 chs Exp $ +# $NetBSD: Makefile,v 1.48 2013/07/18 12:15:15 joerg Exp $ .include bsd.own.mk .include bsd.sys.mk # for HOST_SH @@ -83,7 +83,8 @@ INCPATH += -I${.CURDIR}/../elf2bb AFLAGS += -m68030 -l CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 +COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks +COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} CFLAGS+= -Werror CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.18 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.19 --- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.18 Sun Oct 2 18:30:50 2011 +++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile Thu Jul 18 12:15:15 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.18 2011/10/02 18:30:50 christos Exp $ +# $NetBSD: Makefile,v 1.19 2013/07/18 12:15:15 joerg Exp $ ### what we need: @@ -54,7 +54,8 @@ INCPATH += -I${.CURDIR}/../elf2bb -I${.O AFLAGS += -m68030 -l CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT -COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 +COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks +COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh Index: src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile diff -u src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.9 src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.10 --- src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.9 Tue Jul 6 06:09:57 2010 +++ src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile Thu Jul 18 12:15:16 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2010/07/06 06:09:57 mrg Exp $ +# $NetBSD: Makefile,v 1.10 2013/07/18 12:15:16 joerg Exp $ ### what we need: @@ -43,7 +43,8 @@ INCPATH = -I${DIR_TOP} -I${DIR_TOP}/lib/ AFLAGS += -m68030 -l CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -COPTIM= -O -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 +COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks +COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes .c.o: Index: src/sys/arch/vax/boot/Makefile.inc diff -u src/sys/arch/vax/boot/Makefile.inc:1.14 src/sys/arch/vax/boot/Makefile.inc:1.15 --- src/sys/arch/vax/boot/Makefile.inc:1.14 Sat Mar 31 06:03:13 2007 +++ src/sys/arch/vax/boot/Makefile.inc Thu Jul 18 12:15:16 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.14 2007/03/31 06:03:13 matt Exp $ +# $NetBSD: Makefile.inc,v 1.15 2013/07/18 12:15:16 joerg Exp $ RELOC=0x3f .PATH: ${.CURDIR}/../../vax ${.CURDIR}/../common @@ -11,7 +11,7 @@ CPPFLAGS+=-I${.CURDIR}/../../include CPPFLAGS+=-DRELOC=${RELOC} WARNS?= 1 -CFLAGS+=-ffreestanding -fno-pic +CFLAGS+=-ffreestanding -fno-pic -fno-unwind-tables AFLAGS+=-fno-pic MKMAN=no
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 12:16:40 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: random.S Log Message: Don't use %d2 (violates the ABI since it wasn't saved), use %a0 instead. Use a pcrelative access for the local data avoiding the GOT. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/lib/libkern/arch/m68k/random.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/random.S diff -u src/sys/lib/libkern/arch/m68k/random.S:1.4 src/sys/lib/libkern/arch/m68k/random.S:1.5 --- src/sys/lib/libkern/arch/m68k/random.S:1.4 Tue Jan 6 01:24:56 2009 +++ src/sys/lib/libkern/arch/m68k/random.S Thu Jul 18 12:16:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: random.S,v 1.4 2009/01/06 01:24:56 pooka Exp $ */ +/* $NetBSD: random.S,v 1.5 2013/07/18 12:16:40 matt Exp $ */ /* * Copyright (c) 1990,1993 The Regents of the University of California. @@ -48,22 +48,14 @@ ASLOCAL(randseed) ENTRY(random) movl #16807, %d0 -#ifdef PIC - lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC), %a0 - movl _ASM_LABEL(randseed)@GOT(%a0), %d2 - mulsl (%d2), %d1:%d0 -#else - mulsl _ASM_LABEL(randseed), %d1:%d0 -#endif + LEA_LCL(_ASM_LABEL(randseed),%a0) + mulsl (%a0), %d1:%d0 lsll #1, %d0 roxll #2, %d1 addl %d1, %d0 moveql #1, %d1 addxl %d1, %d0 lsrl #1, %d0 -#ifdef PIC - movl %d0, (%d2) -#else - movl %d0, _ASM_LABEL(randseed) -#endif + movl %d0, (%a0) rts +END(random)
CVS commit: src/lib/libc/arch/powerpc/string
Module Name:src Committed By: matt Date: Thu Jul 18 12:20:41 UTC 2013 Modified Files: src/lib/libc/arch/powerpc/string: bzero.S Log Message: Use pcrel access and avoid GOT entries. Restructure a little to be more efficient. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/powerpc/string/bzero.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/powerpc/string/bzero.S diff -u src/lib/libc/arch/powerpc/string/bzero.S:1.11 src/lib/libc/arch/powerpc/string/bzero.S:1.12 --- src/lib/libc/arch/powerpc/string/bzero.S:1.11 Sat Jan 29 02:21:20 2011 +++ src/lib/libc/arch/powerpc/string/bzero.S Thu Jul 18 12:20:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bzero.S,v 1.11 2011/01/29 02:21:20 matt Exp $ */ +/* $NetBSD: bzero.S,v 1.12 2013/07/18 12:20:41 matt Exp $ */ /*- * Copyright (C) 2001 Martin J. Laubach m...@netbsd.org @@ -32,7 +32,7 @@ #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: bzero.S,v 1.11 2011/01/29 02:21:20 matt Exp $) +__RCSID($NetBSD: bzero.S,v 1.12 2013/07/18 12:20:41 matt Exp $) #endif /* LIBC_SCCS !lint */ #ifdef _KERNEL @@ -76,17 +76,21 @@ cb_memset: /* First find out cache line size */ mflr %r9 #ifdef PIC - PIC_GOTSETUP(%r10) + bcl 20,31,1f +1: mflr %r5 mtlr %r9 - lwz %r5,cache_info@got(%r10) + addis %r5,%r5,cache_info+4-1b@ha + lwzu %r9,cache_info+4-1b@l(%r5) #else - lis %r5,cache_info@h - ori %r5,%r5,cache_info@l + lis %r5,cache_info+4@ha + lwzu %r9,cache_info+4@l(%r5) #endif - lwz %r6, 4(%r5) - cmpwi %r6, -1 + lwz %r10,cache_sh-(cache_info+4)(%r5) + cmpwi %r9, -1 bne+ cb_cacheline_known + addi %r5, %r5, -4 /* point r5 @ beginning of cache_info */ + /*--*/ #define CTL_MACHDEP 7 #define CPU_CACHELINE 1 @@ -172,33 +176,25 @@ cb_memset: cntlzw %r6, %r9 /* compute shift value */ li %r5, 31 - subf %r5, %r6, %r5 + subf %r10, %r6, %r5 #ifdef PIC mflr %r9 - PIC_GOTSETUP(%r10) + bcl 20,31,1f +1: mflr %r5 mtlr %r9 - lwz %r6, cache_sh@got(%r10) - stw %r5, 0(%r6) + + addis %r5, %r5, cache_info+4-1b@ha + lwzu %r9, cache_info+4-1b@l(%r5) #else - lis %r6, cache_sh@ha - stw %r5, cache_sh@l(%r6) + lis %r5, cache_info+4@ha + lwzu %r9, cache_info+4@l(%r5) #endif + stw %r10, cache_sh-(cache_info+4)(%r5) + /*--*/ /* Okay, we know the cache line size (%r9) and shift value (%r10) */ cb_cacheline_known: -#ifdef PIC - lwz %r5, cache_info@got(%r10) - lwz %r9, 4(%r5) - lwz %r5, cache_sh@got(%r10) - lwz %r10, 0(%r5) -#else - lis %r9, cache_info+4@ha - lwz %r9, cache_info+4@l(%r9) - lis %r10, cache_sh@ha - lwz %r10, cache_sh@l(%r10) -#endif - #else /* _KERNEL */ #ifdef MULTIPROCESSOR mfsprg %r10, 0 /* Get cpu_info pointer */ @@ -371,6 +367,7 @@ END(memset) /*--*/ #ifndef _KERNEL .data + .p2align 2 cache_info: .long -1, -1, -1, -1 cache_sh: .long 0
CVS commit: src/lib/libc/arch/arm
Module Name:src Committed By: matt Date: Thu Jul 18 12:21:52 UTC 2013 Modified Files: src/lib/libc/arch/arm: SYS.h Log Message: Remove non-__ELF__ defines To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/arm/SYS.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/arm/SYS.h diff -u src/lib/libc/arch/arm/SYS.h:1.10 src/lib/libc/arch/arm/SYS.h:1.11 --- src/lib/libc/arch/arm/SYS.h:1.10 Fri Jan 14 06:12:16 2011 +++ src/lib/libc/arch/arm/SYS.h Thu Jul 18 12:21:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: SYS.h,v 1.10 2011/01/14 06:12:16 matt Exp $ */ +/* $NetBSD: SYS.h,v 1.11 2013/07/18 12:21:52 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -44,13 +44,8 @@ #define SYSTRAP(x) swi SWI_OS_NETBSD | SYS_/**/x #endif -#ifdef __ELF__ #define CERROR _C_LABEL(__cerror) #define CURBRK _C_LABEL(__curbrk) -#else -#define CERROR _ASM_LABEL(cerror) -#define CURBRK _ASM_LABEL(curbrk) -#endif #define _SYSCALL_NOERROR(x,y) \ ENTRY(x); \
CVS commit: src/lib/libc/arch/vax/sys
Module Name:src Committed By: matt Date: Thu Jul 18 12:27:01 UTC 2013 Modified Files: src/lib/libc/arch/vax/sys: brk.S sbrk.S Log Message: Make __curbrk __minbrk hidden. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/vax/sys/brk.S cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/vax/sys/sbrk.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/vax/sys/brk.S diff -u src/lib/libc/arch/vax/sys/brk.S:1.13 src/lib/libc/arch/vax/sys/brk.S:1.14 --- src/lib/libc/arch/vax/sys/brk.S:1.13 Tue Jan 25 02:38:15 2011 +++ src/lib/libc/arch/vax/sys/brk.S Thu Jul 18 12:27:01 2013 @@ -31,23 +31,26 @@ #if defined(SYSLIBC_SCCS) !defined(lint) /* .asciz @(#)brk.s 8.1 (Berkeley) 6/4/93 */ -RCSID($NetBSD: brk.S,v 1.13 2011/01/25 02:38:15 matt Exp $) +RCSID($NetBSD: brk.S,v 1.14 2013/07/18 12:27:01 matt Exp $) #endif /* SYSLIBC_SCCS and not lint */ - .globl CURBRK + .globl _C_LABEL(__curbrk) .globl _C_LABEL(__minbrk) + .hidden _C_LABEL(__curbrk) + .hidden _C_LABEL(__minbrk) #ifdef WEAK_ALIAS WEAK_ALIAS(brk, _brk) #endif ENTRY(_brk, 0) - cmpl _C_LABEL(__minbrk),4(%ap) # gtr _end + moval _C_LABEL(__minbrk),%r5 # gtr _end + cmpl (%r5),4(%ap) # gtr _end blequ 1f# is fine - movl _C_LABEL(__minbrk),4(%ap) # shrink back to _end + movl (%r5),4(%ap) # shrink back to _end 1: chmk $ SYS_break # do it jcs err - movl 4(%ap),CURBRK + movl 4(%ap),_C_LABEL(__curbrk) clrl %r0 ret err: Index: src/lib/libc/arch/vax/sys/sbrk.S diff -u src/lib/libc/arch/vax/sys/sbrk.S:1.11 src/lib/libc/arch/vax/sys/sbrk.S:1.12 --- src/lib/libc/arch/vax/sys/sbrk.S:1.11 Tue Jan 25 02:38:15 2011 +++ src/lib/libc/arch/vax/sys/sbrk.S Thu Jul 18 12:27:01 2013 @@ -31,12 +31,14 @@ #if defined(SYSLIBC_SCCS) !defined(lint) /* .asciz @(#)sbrk.s 8.1 (Berkeley) 6/4/93 */ -RCSID($NetBSD: sbrk.S,v 1.11 2011/01/25 02:38:15 matt Exp $) +RCSID($NetBSD: sbrk.S,v 1.12 2013/07/18 12:27:01 matt Exp $) #endif /* SYSLIBC_SCCS and not lint */ .globl _end .globl _C_LABEL(__minbrk) - .globl CURBRK + .globl _C_LABEL(__curbrk) + .hidden _C_LABEL(__minbrk) + .hidden _C_LABEL(__curbrk) #ifdef WEAK_ALIAS WEAK_ALIAS(sbrk, _sbrk) @@ -45,19 +47,20 @@ WEAK_ALIAS(sbrk, _sbrk) .data _C_LABEL(__minbrk): .long _end -CURBRK: +_C_LABEL(__curbrk): .long _end .text ENTRY(_sbrk, 0) - addl3 CURBRK,4(%ap),-(%sp) + moval _C_LABEL(__curbrk),%r5 + addl3 (%r5),4(%ap),-(%sp) pushl $1 movl %ap,%r3 movl %sp,%ap chmk $ SYS_break jcs err - movl CURBRK,%r0 - addl2 4(%r3),CURBRK + movl (%r5),%r0 + addl2 4(%r3),(%r5) ret err: jmp CERROR+2
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Thu Jul 18 12:28:26 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_sp.c Log Message: Fix build where compiler can throw an array-bounds error and code is built with NDEBUG or platform's assert is not __dead To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/lib/librumpuser/rumpuser_sp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_sp.c diff -u src/lib/librumpuser/rumpuser_sp.c:1.58 src/lib/librumpuser/rumpuser_sp.c:1.59 --- src/lib/librumpuser/rumpuser_sp.c:1.58 Tue Apr 30 12:39:20 2013 +++ src/lib/librumpuser/rumpuser_sp.c Thu Jul 18 12:28:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_sp.c,v 1.58 2013/04/30 12:39:20 pooka Exp $ */ +/* $NetBSD: rumpuser_sp.c,v 1.59 2013/07/18 12:28:26 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -37,7 +37,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_sp.c,v 1.58 2013/04/30 12:39:20 pooka Exp $); +__RCSID($NetBSD: rumpuser_sp.c,v 1.59 2013/07/18 12:28:26 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -648,7 +648,16 @@ serv_handleconn(int fd, connecthook_fn c break; } - assert(i MAXCLI); + /* + * Although not finding a slot is impossible (cf. how this routine + * is called), the compiler can still think that i == MAXCLI + * if this code is either compiled with NDEBUG or the platform + * does not use __dead for assert(). Therefore, add an explicit + * check to avoid an array-bounds error. + */ + /* assert(i MAXCLI); */ + if (i == MAXCLI) + abort(); pfdlist[i].fd = newfd; spclist[i].spc_fd = newfd;
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 12:29:30 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: skpc.S Log Message: Convert to morotola syntax To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/lib/libkern/arch/m68k/skpc.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/skpc.S diff -u src/sys/lib/libkern/arch/m68k/skpc.S:1.6 src/sys/lib/libkern/arch/m68k/skpc.S:1.7 --- src/sys/lib/libkern/arch/m68k/skpc.S:1.6 Tue Feb 8 20:20:27 2011 +++ src/sys/lib/libkern/arch/m68k/skpc.S Thu Jul 18 12:29:30 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: skpc.S,v 1.6 2011/02/08 20:20:27 rmind Exp $ */ +/* $NetBSD: skpc.S,v 1.7 2013/07/18 12:29:30 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -44,13 +44,13 @@ * skpc(mask, count, startc) */ ENTRY(skpc) - movl %sp@(8),%d0 | get length + movl 8(%sp),%d0 | get length jeq Lskdone | nothing to do, return - movb %sp@(7),%d1 | mask to use - movl %sp@(12),%a0 | where to start + movb 7(%sp),%d1 | mask to use + movl 12(%sp),%a0 | where to start subqw #1,%d0 | adjust for dbcc Lskloop: - cmpb %a0@+,%d1 | compate with mask + cmpb (%a0)+,%d1 | compate with mask dbne %d0,Lskloop | keep going til no more or zero addqw #1,%d0 | overshot by one Lskdone:
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 12:40:42 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: scanc.S Log Message: Convert to motorola syntax To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/lib/libkern/arch/m68k/scanc.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/scanc.S diff -u src/sys/lib/libkern/arch/m68k/scanc.S:1.6 src/sys/lib/libkern/arch/m68k/scanc.S:1.7 --- src/sys/lib/libkern/arch/m68k/scanc.S:1.6 Tue Feb 8 20:20:27 2011 +++ src/sys/lib/libkern/arch/m68k/scanc.S Thu Jul 18 12:40:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: scanc.S,v 1.6 2011/02/08 20:20:27 rmind Exp $ */ +/* $NetBSD: scanc.S,v 1.7 2013/07/18 12:40:42 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -44,20 +44,20 @@ * scanc(count, startc, table, mask) */ ENTRY(scanc) - movl %sp@(4),%d0 | get length + movl 4(%sp),%d0 | get length jeq Lscdone | nothing to do, return - movl %sp@(8),%a0 | start of scan - movl %sp@(12),%a1 | table to compare with - movb %sp@(19),%d1 | and mask to use - movw %d2,%sp@- | need a scratch register + movl 8(%sp),%a0 | start of scan + movl 12(%sp),%a1 | table to compare with + movb 19(%sp),%d1 | and mask to use + movw %d2,-(%sp) | need a scratch register clrw %d2 | clear it out subqw #1,%d0 | adjust for dbra Lscloop: - movb %a0@+,%d2 | get character - movb %a1@(0,%d2:w),%d2 | get table entry + movb (%a0)+,%d2 | get character + movb (%a1,%d2:w),%d2 | get table entry andb %d1,%d2 | mask it dbne %d0,Lscloop | keep going til no more or non-zero addqw #1,%d0 | overshot by one - movw %sp@+,%d2 | restore scratch + movw (%sp)+,%d2 | restore scratch Lscdone: rts
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 12:42:24 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: scanc.S Log Message: Keep stack longword aligned. Use longword ops for %d2. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/lib/libkern/arch/m68k/scanc.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/scanc.S diff -u src/sys/lib/libkern/arch/m68k/scanc.S:1.7 src/sys/lib/libkern/arch/m68k/scanc.S:1.8 --- src/sys/lib/libkern/arch/m68k/scanc.S:1.7 Thu Jul 18 12:40:42 2013 +++ src/sys/lib/libkern/arch/m68k/scanc.S Thu Jul 18 12:42:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: scanc.S,v 1.7 2013/07/18 12:40:42 matt Exp $ */ +/* $NetBSD: scanc.S,v 1.8 2013/07/18 12:42:24 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -49,15 +49,15 @@ ENTRY(scanc) movl 8(%sp),%a0 | start of scan movl 12(%sp),%a1 | table to compare with movb 19(%sp),%d1 | and mask to use - movw %d2,-(%sp) | need a scratch register - clrw %d2 | clear it out + movl %d2,-(%sp) | need a scratch register + clrl %d2 | clear it out subqw #1,%d0 | adjust for dbra Lscloop: movb (%a0)+,%d2 | get character - movb (%a1,%d2:w),%d2 | get table entry - andb %d1,%d2 | mask it + movb (%a1,%d2),%d2 | get table entry + andl %d1,%d2 | mask it dbne %d0,Lscloop | keep going til no more or non-zero addqw #1,%d0 | overshot by one - movw (%sp)+,%d2 | restore scratch + movl (%sp)+,%d2 | restore scratch Lscdone: rts
CVS commit: src/sbin/newfs_udf
Module Name:src Committed By: reinoud Date: Thu Jul 18 12:44:21 UTC 2013 Modified Files: src/sbin/newfs_udf: Makefile newfs_udf.c Added Files: src/sbin/newfs_udf: newfs_udf.h udf_write.c udf_write.h Log Message: Initial split up for making newfs_udf(8) routines suitable for makefs_udf(8) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_udf/Makefile cvs rdiff -u -r1.13 -r1.14 src/sbin/newfs_udf/newfs_udf.c cvs rdiff -u -r0 -r1.1 src/sbin/newfs_udf/newfs_udf.h \ src/sbin/newfs_udf/udf_write.c src/sbin/newfs_udf/udf_write.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_udf/Makefile diff -u src/sbin/newfs_udf/Makefile:1.3 src/sbin/newfs_udf/Makefile:1.4 --- src/sbin/newfs_udf/Makefile:1.3 Sat Apr 11 07:58:13 2009 +++ src/sbin/newfs_udf/Makefile Thu Jul 18 12:44:21 2013 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.3 2009/04/11 07:58:13 lukem Exp $ +# $NetBSD: Makefile,v 1.4 2013/07/18 12:44:21 reinoud Exp $ .include bsd.own.mk PROG= newfs_udf MAN= newfs_udf.8 -SRCS= newfs_udf.c udf_create.c udf_osta.c fattr.c +SRCS= newfs_udf.c udf_create.c udf_write.c udf_osta.c fattr.c MOUNT= ${NETBSDSRCDIR}/sbin/mount KUDF= ${NETBSDSRCDIR}/sys/fs/udf Index: src/sbin/newfs_udf/newfs_udf.c diff -u src/sbin/newfs_udf/newfs_udf.c:1.13 src/sbin/newfs_udf/newfs_udf.c:1.14 --- src/sbin/newfs_udf/newfs_udf.c:1.13 Tue Jul 2 14:59:01 2013 +++ src/sbin/newfs_udf/newfs_udf.c Thu Jul 18 12:44:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_udf.c,v 1.13 2013/07/02 14:59:01 reinoud Exp $ */ +/* $NetBSD: newfs_udf.c,v 1.14 2013/07/18 12:44:21 reinoud Exp $ */ /* * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk @@ -65,25 +65,23 @@ #include mountprog.h #include udf_create.h - -/* general settings */ -#define UDF_512_TRACK 0 /* NOT recommended */ -#define UDF_META_PERC 20 /* picked */ - +#include udf_write.h +#include newfs_udf.h /* prototypes */ int newfs_udf(int argc, char **argv); static void usage(void) __attribute__((__noreturn__)); -int udf_derive_format(int req_en, int req_dis, int force); -int udf_proces_names(void); -int udf_do_newfs(void); - -/* Identifying myself */ -#define APP_NAME *NetBSD newfs -#define APP_VERSION_MAIN 0 -#define APP_VERSION_SUB 3 -#define IMPL_NAME *NetBSD userland UDF + +/* queue for temporary storage of sectors to be written out */ +struct wrsect { + uint32_t sectornr; + uint8_t *sector_data; + TAILQ_ENTRY(wrsect) next; +}; + +/* write queue and track blocking skew */ +TAILQ_HEAD(wrsect_list, wrsect) write_queue; /* global variables describing disc and format requests */ @@ -102,29 +100,13 @@ int meta_perc = UDF_META_PERC; float meta_fract = (float) UDF_META_PERC / 100.0; -/* shared structure between udf_create.c users */ -struct udf_create_context context; -struct udf_disclayout layout; - - -/* queue for temporary storage of sectors to be written out */ -struct wrsect { - uint32_t sectornr; - uint8_t *sector_data; - TAILQ_ENTRY(wrsect) next; -}; - -/* write queue and track blocking skew */ -TAILQ_HEAD(wrsect_list, wrsect) write_queue; - - /* - */ /* * write queue implementation */ -static int +int udf_write_sector(void *sector, uint32_t location) { struct wrsect *pos, *seekpos; @@ -167,7 +149,7 @@ udf_write_sector(void *sector, uint32_t * XXX support for growing vnd? */ -static int +int writeout_write_queue(void) { struct wrsect *pos; @@ -357,7 +339,7 @@ udf_update_discinfo(struct mmc_discinfo } -static int +int udf_update_trackinfo(struct mmc_discinfo *di, struct mmc_trackinfo *ti) { int error, class; @@ -447,276 +429,6 @@ udf_synchronise_caches(void) /* - */ static int -udf_write_dscr_phys(union dscrptr *dscr, uint32_t location, - uint32_t sects) -{ - uint32_t phys, cnt; - uint8_t *bpos; - int error; - - dscr-tag.tag_loc = udf_rw32(location); - (void) udf_validate_tag_and_crc_sums(dscr); - - for (cnt = 0; cnt sects; cnt++) { - bpos = (uint8_t *) dscr; - bpos += context.sector_size * cnt; - - phys = location + cnt; - error = udf_write_sector(bpos, phys); - if (error) - return error; - } - return 0; -} - - -static int -udf_write_dscr_virt(union dscrptr *dscr, uint32_t location, uint32_t vpart, - uint32_t sects) -{ - struct file_entry *fe; - struct extfile_entry *efe; - struct extattrhdr_desc *extattrhdr; - uint32_t phys, cnt; - uint8_t *bpos; - int error; - - extattrhdr = NULL; - if (udf_rw16(dscr-tag.id) == TAGID_FENTRY) { - fe = (struct file_entry *) dscr; - if (udf_rw32(fe-l_ea) 0) - extattrhdr = (struct extattrhdr_desc *) fe-data; - } - if (udf_rw16(dscr-tag.id) == TAGID_EXTFENTRY) { - efe = (struct extfile_entry *) dscr; - if (udf_rw32(efe-l_ea) 0) - extattrhdr = (struct extattrhdr_desc *)
CVS commit: src/sbin/newfs_udf
Module Name:src Committed By: reinoud Date: Thu Jul 18 12:50:51 UTC 2013 Modified Files: src/sbin/newfs_udf: udf_write.c Log Message: Add comment to udf_do_rootdir(). Might eventually be moved to newfs_udf(8) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sbin/newfs_udf/udf_write.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_udf/udf_write.c diff -u src/sbin/newfs_udf/udf_write.c:1.1 src/sbin/newfs_udf/udf_write.c:1.2 --- src/sbin/newfs_udf/udf_write.c:1.1 Thu Jul 18 12:44:21 2013 +++ src/sbin/newfs_udf/udf_write.c Thu Jul 18 12:50:51 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: udf_write.c,v 1.1 2013/07/18 12:44:21 reinoud Exp $ */ +/* $NetBSD: udf_write.c,v 1.2 2013/07/18 12:50:51 reinoud Exp $ */ /* * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk @@ -28,7 +28,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: udf_write.c,v 1.1 2013/07/18 12:44:21 reinoud Exp $); +__RCSID($NetBSD: udf_write.c,v 1.2 2013/07/18 12:50:51 reinoud Exp $); #endif /* not lint */ #define _EXPOSE_MMC @@ -709,6 +709,7 @@ udf_do_newfs_prefix(void) } +/* specific routine for newfs to create empty rootdirectory */ int udf_do_rootdir(void) { union dscrptr *root_dscr;
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 12:53:09 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: Makefile.inc Log Message: Reorder a little to make clearer. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/lib/libkern/arch/m68k/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/Makefile.inc diff -u src/sys/lib/libkern/arch/m68k/Makefile.inc:1.30 src/sys/lib/libkern/arch/m68k/Makefile.inc:1.31 --- src/sys/lib/libkern/arch/m68k/Makefile.inc:1.30 Fri Aug 14 19:23:54 2009 +++ src/sys/lib/libkern/arch/m68k/Makefile.inc Thu Jul 18 12:53:09 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.30 2009/08/14 19:23:54 dsl Exp $ +# $NetBSD: Makefile.inc,v 1.31 2013/07/18 12:53:09 matt Exp $ SRCS+= bswap16.S bswap32.S bswap64.S SRCS+= memcmp.S memcpy.S memmove.S memset.S @@ -10,7 +10,9 @@ SRCS+= ffs.S .if defined(MACHINE_ARCH) (${MACHINE_ARCH} == m68000) SRCS+= mulsi3.S divsi3.S udivsi3.S modsi3.S umodsi3.S -random.o random.d: random.c -.else +.endif +.if defined(MACHINE_ARCH) ${MACHINE_ARCH} == m68k SRCS+= random.S +.else +random.o random.po random.pico random.d: random.c .endif
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 12:54:08 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: skpc.S Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/lib/libkern/arch/m68k/skpc.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/skpc.S diff -u src/sys/lib/libkern/arch/m68k/skpc.S:1.7 src/sys/lib/libkern/arch/m68k/skpc.S:1.8 --- src/sys/lib/libkern/arch/m68k/skpc.S:1.7 Thu Jul 18 12:29:30 2013 +++ src/sys/lib/libkern/arch/m68k/skpc.S Thu Jul 18 12:54:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: skpc.S,v 1.7 2013/07/18 12:29:30 matt Exp $ */ +/* $NetBSD: skpc.S,v 1.8 2013/07/18 12:54:08 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,7 +50,7 @@ ENTRY(skpc) movl 12(%sp),%a0 | where to start subqw #1,%d0 | adjust for dbcc Lskloop: - cmpb (%a0)+,%d1 | compate with mask + cmpb (%a0)+,%d1 | compare with mask dbne %d0,Lskloop | keep going til no more or zero addqw #1,%d0 | overshot by one Lskdone:
CVS commit: src/etc
Module Name:src Committed By: christos Date: Thu Jul 18 13:10:50 UTC 2013 Modified Files: src/etc: man.conf Log Message: PR/48061: NAKAJIMA Yoshihiro: wrong description about bzip2's suffix To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/etc/man.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/man.conf diff -u src/etc/man.conf:1.31 src/etc/man.conf:1.32 --- src/etc/man.conf:1.31 Sat Oct 6 11:33:59 2012 +++ src/etc/man.conf Thu Jul 18 09:10:50 2013 @@ -1,4 +1,4 @@ -# $NetBSD: man.conf,v 1.31 2012/10/06 15:33:59 wiz Exp $ +# $NetBSD: man.conf,v 1.32 2013/07/18 13:10:50 christos Exp $ # Sheer, raging paranoia... _version BSD.2 @@ -30,7 +30,7 @@ _build .tbl.xz /usr/bin/xzcat %s | /us _build .me /usr/bin/nroff -msafer -me %s 2/dev/null | cat -s _crunch .Z /usr/bin/zcat %s -_crunch .bz /usr/bin/bzcat %s +_crunch .bz2 /usr/bin/bzcat %s _crunch .gz /usr/bin/zcat %s _crunch .xz /usr/bin/xzcat %s
CVS commit: src/sys
Module Name:src Committed By: matt Date: Thu Jul 18 13:41:08 UTC 2013 Modified Files: src/sys/kern: vfs_syscalls.c src/sys/sys: vfs_syscalls.h Log Message: export do_sys_statat for netbsd32 To generate a diff of this commit: cvs rdiff -u -r1.464 -r1.465 src/sys/kern/vfs_syscalls.c cvs rdiff -u -r1.18 -r1.19 src/sys/sys/vfs_syscalls.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/vfs_syscalls.c diff -u src/sys/kern/vfs_syscalls.c:1.464 src/sys/kern/vfs_syscalls.c:1.465 --- src/sys/kern/vfs_syscalls.c:1.464 Fri Jun 28 15:32:20 2013 +++ src/sys/kern/vfs_syscalls.c Thu Jul 18 13:41:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.464 2013/06/28 15:32:20 christos Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.465 2013/07/18 13:41:08 matt Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.464 2013/06/28 15:32:20 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.465 2013/07/18 13:41:08 matt Exp $); #ifdef _KERNEL_OPT #include opt_fileassoc.h @@ -131,8 +131,6 @@ static int do_sys_chownat(struct lwp *, static int do_sys_utimensat(struct lwp *, int, struct vnode *, const char *, int, const struct timespec *, enum uio_seg); static int do_sys_accessat(struct lwp *, int, const char *, int ,int); -static int do_sys_statat(struct lwp *, int, const char *, unsigned int, -struct stat *); static int do_sys_symlinkat(struct lwp *, const char *, int, const char *, enum uio_seg); static int do_sys_linkat(struct lwp *, int, const char *, int, const char *, @@ -3022,7 +3020,7 @@ do_sys_stat(const char *userpath, unsign return do_sys_statat(NULL, AT_FDCWD, userpath, nd_flag, sb); } -static int +int do_sys_statat(struct lwp *l, int fdat, const char *userpath, unsigned int nd_flag, struct stat *sb) { Index: src/sys/sys/vfs_syscalls.h diff -u src/sys/sys/vfs_syscalls.h:1.18 src/sys/sys/vfs_syscalls.h:1.19 --- src/sys/sys/vfs_syscalls.h:1.18 Tue Mar 13 18:41:02 2012 +++ src/sys/sys/vfs_syscalls.h Thu Jul 18 13:41:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.h,v 1.18 2012/03/13 18:41:02 elad Exp $*/ +/* $NetBSD: vfs_syscalls.h,v 1.19 2013/07/18 13:41:08 matt Exp $*/ /* * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -42,6 +42,7 @@ struct quotactl_args; /* Status functions to kernel 'struct stat' buffers */ int do_sys_stat(const char *, unsigned int, struct stat *); +int do_sys_statat(struct lwp *, int, const char *, unsigned int, struct stat *); int do_fhstat(struct lwp *, const void *, size_t, struct stat *); int do_fhstatvfs(struct lwp *, const void *, size_t, struct statvfs *, int);
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Thu Jul 18 13:43:32 UTC 2013 Modified Files: src/sys/compat/netbsd32: netbsd32_fs.c netbsd32_netbsd.c Log Message: Move *at syscall handlers to netbsd32_fs.c from netbsd32_netbsd.c Fix netbsd32_fstatat to emit a 32bit stat structure. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/compat/netbsd32/netbsd32_fs.c cvs rdiff -u -r1.180 -r1.181 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_fs.c diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.64 src/sys/compat/netbsd32/netbsd32_fs.c:1.65 --- src/sys/compat/netbsd32/netbsd32_fs.c:1.64 Thu Dec 13 15:16:57 2012 +++ src/sys/compat/netbsd32/netbsd32_fs.c Thu Jul 18 13:43:32 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.64 2012/12/13 15:16:57 matt Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.65 2013/07/18 13:43:32 matt Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.64 2012/12/13 15:16:57 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.65 2013/07/18 13:43:32 matt Exp $); #include sys/param.h #include sys/systm.h @@ -972,3 +972,303 @@ netbsd32___mount50(struct lwp *l, const } return error; } + +int +netbsd32_linkat(struct lwp *l, const struct netbsd32_linkat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd1; + syscallarg(const netbsd32_charp) name1; + syscallarg(int) fd2; + syscallarg(const netbsd32_charp) name2; + syscallarg(int) flags; + } */ + struct sys_linkat_args ua; + + NETBSD32TO64_UAP(fd1); + NETBSD32TOP_UAP(name1, const char); + NETBSD32TO64_UAP(fd2); + NETBSD32TOP_UAP(name2, const char); + NETBSD32TO64_UAP(flags); + + return sys_linkat(l, ua, retval); +} + +int +netbsd32_renameat(struct lwp *l, const struct netbsd32_renameat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fromfd; + syscallarg(const netbsd32_charp) from; + syscallarg(int) tofd; + syscallarg(const netbsd32_charp) to; + } */ + struct sys_renameat_args ua; + + NETBSD32TO64_UAP(fromfd); + NETBSD32TOP_UAP(from, const char); + NETBSD32TO64_UAP(tofd); + NETBSD32TOP_UAP(to, const char); + + return sys_renameat(l, ua, retval); +} + +int +netbsd32_mkfifoat(struct lwp *l, const struct netbsd32_mkfifoat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(const netbsd32_charp) path; + syscallarg(mode_t) mode; + } */ + struct sys_mkfifoat_args ua; + + NETBSD32TO64_UAP(fd); + NETBSD32TOP_UAP(path, const char); + NETBSD32TO64_UAP(mode); + + return sys_mkfifoat(l, ua, retval); +} + +int +netbsd32_mknodat(struct lwp *l, const struct netbsd32_mknodat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(netbsd32_charp) path; + syscallarg(mode_t) mode; + syscallarg(uint32_t) dev; + } */ + struct sys_mknodat_args ua; + + NETBSD32TO64_UAP(fd); + NETBSD32TOP_UAP(path, const char); + NETBSD32TO64_UAP(mode); + NETBSD32TO64_UAP(dev); + + return sys_mknodat(l, ua, retval); +} + +int +netbsd32_mkdirat(struct lwp *l, const struct netbsd32_mkdirat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(netbsd32_charp) path; + syscallarg(mode_t) mode; + } */ + struct sys_mkdirat_args ua; + + NETBSD32TO64_UAP(fd); + NETBSD32TOP_UAP(path, const char); + NETBSD32TO64_UAP(mode); + + return sys_mkdirat(l, ua, retval); +} + +int +netbsd32_faccessat(struct lwp *l, const struct netbsd32_faccessat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(netbsd32_charp) path; + syscallarg(int) amode; + syscallarg(int) flag; + } */ + struct sys_faccessat_args ua; + + NETBSD32TO64_UAP(fd); + NETBSD32TOP_UAP(path, const char); + NETBSD32TO64_UAP(amode); + NETBSD32TO64_UAP(flag); + + return sys_faccessat(l, ua, retval); +} + +int +netbsd32_fchmodat(struct lwp *l, const struct netbsd32_fchmodat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(netbsd32_charp) path; + syscallarg(mode_t) mode; + syscallarg(int) flag; + } */ + struct sys_fchmodat_args ua; + + NETBSD32TO64_UAP(fd); + NETBSD32TOP_UAP(path, const char); + NETBSD32TO64_UAP(mode); + NETBSD32TO64_UAP(flag); + + return sys_fchmodat(l, ua, retval); +} + +int +netbsd32_fchownat(struct lwp *l, const struct netbsd32_fchownat_args *uap, + register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(netbsd32_charp) path; + syscallarg(uid_t) owner; + syscallarg(gid_t) group; + syscallarg(int) flag; + } */ + struct sys_fchownat_args ua; + + NETBSD32TO64_UAP(fd); + NETBSD32TOP_UAP(path, const char); + NETBSD32TO64_UAP(owner); + NETBSD32TO64_UAP(group); + NETBSD32TO64_UAP(flag); + + return sys_fchownat(l, ua, retval); +} + +int +netbsd32_fstatat(struct lwp *l, const struct netbsd32_fstatat_args *uap, + register_t
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Thu Jul 18 14:07:43 UTC 2013 Modified Files: src/sys/compat/netbsd32: netbsd32_fs.c Log Message: Deal with timespecs properly in futimens and utimensat. PR/48060 To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/compat/netbsd32/netbsd32_fs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_fs.c diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.65 src/sys/compat/netbsd32/netbsd32_fs.c:1.66 --- src/sys/compat/netbsd32/netbsd32_fs.c:1.65 Thu Jul 18 13:43:32 2013 +++ src/sys/compat/netbsd32/netbsd32_fs.c Thu Jul 18 14:07:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.65 2013/07/18 13:43:32 matt Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.66 2013/07/18 14:07:43 matt Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.65 2013/07/18 13:43:32 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.66 2013/07/18 14:07:43 matt Exp $); #include sys/param.h #include sys/systm.h @@ -1145,16 +1145,13 @@ netbsd32_fstatat(struct lwp *l, const st } */ struct netbsd32_stat sb32; struct stat sb; - unsigned int nd_flag; + int follow; int error; - if (SCARG(uap, flag) AT_SYMLINK_NOFOLLOW) - nd_flag = NOFOLLOW; - else - nd_flag = FOLLOW; + follow = (SCARG(uap, flag) AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; error = do_sys_statat(l, SCARG(uap, fd), SCARG_P32(uap, path), - nd_flag, sb); + follow, sb); if (error) return error; netbsd32_from_stat(sb, sb32); @@ -1171,14 +1168,23 @@ netbsd32_utimensat(struct lwp *l, const syscallarg(netbsd32_timespecp_t) tptr; syscallarg(int) flag; } */ - struct sys_utimensat_args ua; + struct netbsd32_timespec ts32[2]; + struct timespec ts[2]; + int follow; + int error; - NETBSD32TO64_UAP(fd); - NETBSD32TOP_UAP(path, const char); - NETBSD32TOP_UAP(tptr, const struct timespec); - NETBSD32TO64_UAP(flag); + if ((error = copyin(SCARG_P32(uap, tptr), ts32, sizeof(ts32))) != 0) + return (error); - return sys_utimensat(l, ua, retval); + netbsd32_to_timespec(ts32[0], ts[0]); + netbsd32_to_timespec(ts32[1], ts[1]); + + follow = (SCARG(uap, flag) AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; + + error = do_sys_utimensat(l, SCARG(uap, fd), NULL, + SCARG_P32(uap, path), follow, ts, UIO_SYSSPACE); + + return error; } int @@ -1265,10 +1271,21 @@ netbsd32_futimens(struct lwp *l, const s syscallarg(int) fd; syscallarg(netbsd32_timespecp_t) tptr; } */ - struct sys_futimens_args ua; + struct netbsd32_timespec ts32; + struct timespec ts; + file_t *fp; + int error; - NETBSD32TO64_UAP(fd); - NETBSD32TOP_UAP(tptr, const struct timespec *); + if ((error = copyin(SCARG_P32(uap, tptr), ts32, sizeof(ts32))) != 0) + return (error); - return sys_futimens(l, ua, retval); + netbsd32_to_timespec(ts32, ts); + + /* fd_getvnode() will use the descriptor for us */ + if ((error = fd_getvnode(SCARG(uap, fd), fp)) != 0) + return (error); + error = do_sys_utimensat(l, AT_FDCWD, fp-f_data, NULL, 0, + ts, UIO_SYSSPACE); + fd_putfile(SCARG(uap, fd)); + return (error); }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Thu Jul 18 14:14:00 UTC 2013 Modified Files: src/sys/compat/netbsd32: netbsd32_fs.c Log Message: futimens uses two timespec as well. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/compat/netbsd32/netbsd32_fs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_fs.c diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.66 src/sys/compat/netbsd32/netbsd32_fs.c:1.67 --- src/sys/compat/netbsd32/netbsd32_fs.c:1.66 Thu Jul 18 14:07:43 2013 +++ src/sys/compat/netbsd32/netbsd32_fs.c Thu Jul 18 14:14:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.66 2013/07/18 14:07:43 matt Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.67 2013/07/18 14:14:00 matt Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.66 2013/07/18 14:07:43 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.67 2013/07/18 14:14:00 matt Exp $); #include sys/param.h #include sys/systm.h @@ -1271,21 +1271,22 @@ netbsd32_futimens(struct lwp *l, const s syscallarg(int) fd; syscallarg(netbsd32_timespecp_t) tptr; } */ - struct netbsd32_timespec ts32; - struct timespec ts; + struct netbsd32_timespec ts32[2]; + struct timespec ts[2]; file_t *fp; int error; - if ((error = copyin(SCARG_P32(uap, tptr), ts32, sizeof(ts32))) != 0) + if ((error = copyin(SCARG_P32(uap, tptr), ts32, sizeof(ts32))) != 0) return (error); - netbsd32_to_timespec(ts32, ts); + netbsd32_to_timespec(ts32[0], ts[0]); + netbsd32_to_timespec(ts32[1], ts[1]); /* fd_getvnode() will use the descriptor for us */ if ((error = fd_getvnode(SCARG(uap, fd), fp)) != 0) return (error); error = do_sys_utimensat(l, AT_FDCWD, fp-f_data, NULL, 0, - ts, UIO_SYSSPACE); + ts, UIO_SYSSPACE); fd_putfile(SCARG(uap, fd)); return (error); }
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Thu Jul 18 14:35:30 UTC 2013 Modified Files: src/share/man/man9: cprng.9 Log Message: Rework cprng(9) man page to reflect the current state of affairs. - Remove defunct cprng_strong_getflags/setflags. - Remove defunct cprng_strong_ready. - Document CPRNG_HARD. - Omit cprng_strong structure, which is now opaque. - Specify what can sleep and under what conditions. - Be a little more consistent about some markup. This is not the whole story (select/kqueue stuff for /dev/random is still omitted), and I plan to change it some more (to split cprng_strong into one routine that unconditionally guarantees as many bytes as you asked, and another routine that may block or return partial reads), but this will do until I find the time for those. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/cprng.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/cprng.9 diff -u src/share/man/man9/cprng.9:1.7 src/share/man/man9/cprng.9:1.8 --- src/share/man/man9/cprng.9:1.7 Sun Jun 23 02:39:32 2013 +++ src/share/man/man9/cprng.9 Thu Jul 18 14:35:30 2013 @@ -1,10 +1,10 @@ -.\ $NetBSD: cprng.9,v 1.7 2013/06/23 02:39:32 riastradh Exp $ +.\ $NetBSD: cprng.9,v 1.8 2013/07/18 14:35:30 riastradh Exp $ .\ -.\ Copyright (c) 2011 The NetBSD Foundation, Inc. +.\ Copyright (c) 2011-2013 The NetBSD Foundation, Inc. .\ All rights reserved. .\ .\ This code is derived from software contributed to The NetBSD Foundation -.\ by Thor Lancelot Simon. +.\ by Thor Lancelot Simon and Taylor R. Campbell. .\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions @@ -27,75 +27,52 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd December 17, 2011 +.Dd July 18, 2013 .Dt CPRNG 9 .Os .Sh NAME .Nm cprng , .Nm cprng_strong_create , +.Nm cprng_strong_destroy , .Nm cprng_strong , .Nm cprng_strong32 , .Nm cprng_strong64 , -.Nm cprng_strong_getflags , -.Nm cprng_strong_setflags , -.Nm cprng_strong_ready , -.Nm cprng_strong_destroy , .Nm cprng_fast , .Nm cprng_fast32 , .Nm cprng_fast64 , -.Nd cryptographic pseudo-random number generators +.Nd cryptographic pseudorandom number generators .Sh SYNOPSIS .In sys/cprng.h .Ft cprng_strong_t * -.Fn cprng_strong_create const char *const name int ipl int flags +.Fn cprng_strong_create const char *name int ipl int flags .Ft void .Fn cprng_strong_destroy cprng_strong_t *cprng .Ft size_t -.Fn cprng_strong cprng_strong_t *const cprng void *buf size_t len int blocking -.Ft size_t -.Fn cprng_fast void *buf size_t len +.Fn cprng_strong cprng_strong_t *cprng void *buf size_t len int flags .Ft uint32_t .Fn cprng_strong32 void .Ft uint64_t .Fn cprng_strong64 void +.Ft size_t +.Fn cprng_fast void *buf size_t len .Ft uint32_t .Fn cprng_fast32 void .Ft uint32_t .Fn cprng_fast64 void -.Ft int -.Fn cprng_strong_getflags cprng_strong_t *const cprng -.Ft void -.Fn cprng_strong_setflags cprng_strong_t *const cprng int flags .Bd -literal #define CPRNG_MAX_LEN 524288 - -typedef struct _cprng_strong { -kmutex_t mtx; -kcondvar_t cv; - struct selinfo selq; -NIST_CTR_DRBG drbg; -int flags; -char name[16]; -int reseed_pending; -rndsink_t reseed; -} cprng_strong_t; .Ed .Sh DESCRIPTION The .Nm -family of functions supply randomness to callers within the -.Nx -kernel. +family of functions provide cryptographic pseudorandom number +generators automatically seeded from the kernel entropy pool. They replace the .Xr arc4random 9 and .Xr rnd_extract_data 9 functions for this purpose. The -.Nm -functions provide stream generators automatically keyed (and if -necessary rekeyed) from the kernel entropy pool. -The .Nx kernel no longer supports direct reading from the kernel entropy pool; all access is mediated by the @@ -104,136 +81,181 @@ functions. .Pp The .Dq strong -family of functions supply cryptographically strong random numbers -suitable for keying crypto systems and similar purposes. +family of functions use cryptographically strong pseudorandom number +generators suitable for keying crypto systems and similar purposes. Calls to .Xr rnd_extract_data 9 -should be replaced with calls to -.Nm cprng_strong . +should be replaced by calls to +.Fn cprng_strong . .Pp The .Dq fast -family of functions supply less strong random numbers, suitable for -initialization vectors, nonces in certain protocols, and other -similar purposes, using a faster but less secure stream-cipher generator. +family of functions use cryptographically weaker pseudorandom number +generators suitable for initialization vectors, nonces in certain +protocols, and other similar purposes, using a faster but less
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Thu Jul 18 15:31:49 UTC 2013 Modified Files: src/usr.bin/make: main.c Log Message: From bmake: move decl of pwd nearer to where it is used so the whole thing can be ifdef'd out without causing unused variable errors. To generate a diff of this commit: cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.221 src/usr.bin/make/main.c:1.222 --- src/usr.bin/make/main.c:1.221 Tue Jul 16 14:22:13 2013 +++ src/usr.bin/make/main.c Thu Jul 18 15:31:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.221 2013/07/16 14:22:13 christos Exp $ */ +/* $NetBSD: main.c,v 1.222 2013/07/18 15:31:49 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = $NetBSD: main.c,v 1.221 2013/07/16 14:22:13 christos Exp $; +static char rcsid[] = $NetBSD: main.c,v 1.222 2013/07/18 15:31:49 sjg Exp $; #else #include sys/cdefs.h #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = @(#)main.c 8.3 (Berkeley) 3/19/94; #else -__RCSID($NetBSD: main.c,v 1.221 2013/07/16 14:22:13 christos Exp $); +__RCSID($NetBSD: main.c,v 1.222 2013/07/18 15:31:49 sjg Exp $); #endif #endif /* not lint */ #endif @@ -808,7 +808,7 @@ main(int argc, char **argv) Lst targs; /* target nodes to create -- passed to Make_Init */ Boolean outOfDate = FALSE; /* FALSE if all targets up to date */ struct stat sb, sa; - char *p1, *path, *pwd; + char *p1, *path; char mdpath[MAXPATHLEN]; const char *machine = getenv(MACHINE); const char *machine_arch = getenv(MACHINE_ARCH); @@ -1048,17 +1048,23 @@ main(int argc, char **argv) * So, to stop it breaking this case only, we ignore PWD if * MAKEOBJDIRPREFIX is set or MAKEOBJDIR contains a transform. */ - if (!ignorePWD - (pwd = getenv(PWD)) != NULL - getenv(MAKEOBJDIRPREFIX) == NULL) { - const char *makeobjdir = getenv(MAKEOBJDIR); - - if (makeobjdir == NULL || !strchr(makeobjdir, '$')) { - if (stat(pwd, sb) == 0 sa.st_ino == sb.st_ino - sa.st_dev == sb.st_dev) -(void)strncpy(curdir, pwd, MAXPATHLEN); +#ifndef NO_PWD_OVERRIDE + if (!ignorePWD) { + char *pwd; + + if ((pwd = getenv(PWD)) != NULL + getenv(MAKEOBJDIRPREFIX) == NULL) { + const char *makeobjdir = getenv(MAKEOBJDIR); + + if (makeobjdir == NULL || !strchr(makeobjdir, '$')) { +if (stat(pwd, sb) == 0 +sa.st_ino == sb.st_ino +sa.st_dev == sb.st_dev) + (void)strncpy(curdir, pwd, MAXPATHLEN); + } } } +#endif Var_Set(.CURDIR, curdir, VAR_GLOBAL, 0); /*
CVS commit: src/usr.bin/man
Module Name:src Committed By: christos Date: Thu Jul 18 15:39:08 UTC 2013 Modified Files: src/usr.bin/man: Makefile man.c manconf.c Log Message: WARNS=6 - fix cast qual issues - don't use snprintf on a user-provided buffer To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.bin/man/Makefile cvs rdiff -u -r1.47 -r1.48 src/usr.bin/man/man.c cvs rdiff -u -r1.6 -r1.7 src/usr.bin/man/manconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/Makefile diff -u src/usr.bin/man/Makefile:1.11 src/usr.bin/man/Makefile:1.12 --- src/usr.bin/man/Makefile:1.11 Tue Apr 14 18:15:23 2009 +++ src/usr.bin/man/Makefile Thu Jul 18 11:39:08 2013 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.11 2009/04/14 22:15:23 lukem Exp $ +# $NetBSD: Makefile,v 1.12 2013/07/18 15:39:08 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 -WARNS?= 2 # XXX -Wcast-qual issues +WARNS?= 6 PROG= man SRCS= man.c manconf.c Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.47 src/usr.bin/man/man.c:1.48 --- src/usr.bin/man/man.c:1.47 Thu Jul 18 00:05:32 2013 +++ src/usr.bin/man/man.c Thu Jul 18 11:39:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.47 2013/07/18 04:05:32 uwe Exp $ */ +/* $NetBSD: man.c,v 1.48 2013/07/18 15:39:08 christos Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.47 2013/07/18 04:05:32 uwe Exp $); +__RCSID($NetBSD: man.c,v 1.48 2013/07/18 15:39:08 christos Exp $); #endif #endif /* not lint */ @@ -114,7 +114,7 @@ static void cat(char *); static const char *check_pager(const char *); static int cleanup(void); static void how(char *); -static void jump(char **, char *, char *); +static void jump(char **, const char *, const char *); static int manual(char *, struct manstate *, glob_t *); static void onsig(int); static void usage(void) __attribute__((__noreturn__)); @@ -122,13 +122,15 @@ static void addpath(struct manstate *, static const char *getclass(const char *); static void printmanpath(struct manstate *); +static char EMPTY[1]; + /* * main function */ int main(int argc, char **argv) { - static struct manstate m = { 0 }; /* init to zero */ + static struct manstate m; int ch, abs_section, found; ENTRY *esubd, *epath; char *p, **ap, *cmd; @@ -464,6 +466,21 @@ main(int argc, char **argv) exit(cleanup()); } +static void +fixstring(char *buf, size_t len, const char *fmt, const char *str) +{ + const char *ptr = strstr(fmt, %s); + size_t l; + if (ptr == NULL) { + strlcpy(buf, fmt, len); + return; + } + l = (size_t)(ptr - fmt) + 1; + strlcpy(buf, fmt, MIN(l, len)); + strlcat(buf, str, len); + strlcat(buf, ptr + 2, len); +} + static int manual_find_buildkeyword(char *escpage, const char *fmt, struct manstate *mp, glob_t *pg, size_t cnt) @@ -483,7 +500,7 @@ manual_find_buildkeyword(char *escpage, continue; *p = '\0'; - (void)snprintf(buf, sizeof(buf), fmt, escpage, suffix-s); + fixstring(buf, sizeof(buf), fmt, escpage); if (!fnmatch(buf, pg-gl_pathv[cnt], 0)) { if (!mp-where) build_page(p + 1, pg-gl_pathv[cnt], mp); @@ -570,14 +587,14 @@ manual(char *page, struct manstate *mp, if (!mp-all) { /* Delete any other matches. */ while (++cnt pg-gl_pathc) - pg-gl_pathv[cnt] = ; + pg-gl_pathv[cnt] = EMPTY; break; } continue; } /* It's not a man page, forget about it. */ - pg-gl_pathv[cnt] = ; + pg-gl_pathv[cnt] = EMPTY; } notfound: @@ -626,7 +643,7 @@ manual(char *page, struct manstate *mp, if (mp-pathsearch) { p = strstr(pg-gl_pathv[cnt], mp-pathsearch); if (!p || strchr(p, '/') == NULL) { - pg-gl_pathv[cnt] = ; /* zap! */ + pg-gl_pathv[cnt] = EMPTY; /* zap! */ continue; } } @@ -665,14 +682,14 @@ next:anyfound = 1; if (!mp-all) { /* Delete any other matches. */ while (++cnt pg-gl_pathc) - pg-gl_pathv[cnt] = ; + pg-gl_pathv[cnt] = EMPTY; break; } continue; } /* It's not a man page, forget about it. */ - pg-gl_pathv[cnt] = ; + pg-gl_pathv[cnt] = EMPTY; } if (anyfound !mp-all) @@ -700,7 +717,8 @@ static void build_page(char *fmt, char **pathp, struct manstate *mp) { static int warned; - int olddir, fd, n, tmpdirlen; + int olddir, fd, n; + size_t tmpdirlen; char *p, *b; char buf[MAXPATHLEN], cmd[MAXPATHLEN], tpath[MAXPATHLEN]; const char *tmpdir; @@ -765,7 +783,7 @@ build_page(char *fmt, char **pathp, stru exit(EXIT_FAILURE); } (void)snprintf(buf, sizeof(buf), %s %s, fmt, tpath); - (void)snprintf(cmd, sizeof(cmd), buf, p); + fixstring(cmd, sizeof(cmd), buf, p); (void)system(cmd); (void)close(fd); if ((*pathp = strdup(tpath)) == NULL) { @@ -842,7 +860,8 @@
CVS commit: src/sys/rump
Module Name:src Committed By: kefren Date: Thu Jul 18 15:59:28 UTC 2013 Modified Files: src/sys/rump/librump/rumpnet: netisr.c src/sys/rump/net: Makefile.rumpnetcomp src/sys/rump/net/lib/libnet: Makefile src/sys/rump/net/lib/libnet/opt: opt_mpls.h Added Files: src/sys/rump/net/lib/libnetmpls: Makefile Makefile.inc component.c shlib_version Log Message: Add librumpnet_netmpls that provides MPLS features into rump kernels ok'ed pooka@ To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/librump/rumpnet/netisr.c cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/Makefile.rumpnetcomp cvs rdiff -u -r1.17 -r1.18 src/sys/rump/net/lib/libnet/Makefile cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnet/opt/opt_mpls.h cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetmpls/Makefile \ src/sys/rump/net/lib/libnetmpls/Makefile.inc \ src/sys/rump/net/lib/libnetmpls/component.c \ src/sys/rump/net/lib/libnetmpls/shlib_version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpnet/netisr.c diff -u src/sys/rump/librump/rumpnet/netisr.c:1.5 src/sys/rump/librump/rumpnet/netisr.c:1.6 --- src/sys/rump/librump/rumpnet/netisr.c:1.5 Thu Dec 30 16:19:39 2010 +++ src/sys/rump/librump/rumpnet/netisr.c Thu Jul 18 15:59:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: netisr.c,v 1.5 2010/12/30 16:19:39 pooka Exp $ */ +/* $NetBSD: netisr.c,v 1.6 2013/07/18 15:59:27 kefren Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netisr.c,v 1.5 2010/12/30 16:19:39 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: netisr.c,v 1.6 2013/07/18 15:59:27 kefren Exp $); #include sys/param.h #include sys/intr.h @@ -36,6 +36,7 @@ __KERNEL_RCSID(0, $NetBSD: netisr.c,v 1 #include netinet/if_inarp.h #include netinet/ip6.h #include netinet6/ip6_var.h +#include netmpls/mpls_var.h #include net/netisr.h #include rump/rumpuser.h @@ -63,11 +64,12 @@ __netisr_stub(void) __weak_alias(ipintr,__netisr_stub); __weak_alias(arpintr,__netisr_stub); __weak_alias(ip6intr,__netisr_stub); +__weak_alias(mplsintr,__netisr_stub); void rump_netisr_init(void) { - void *iphand, *arphand, *ip6hand, *sym; + void *iphand, *arphand, *ip6hand, *mplshand, *sym; iphand = ipintr; if ((sym = rumpuser_dl_globalsym(rumpns_ipintr)) != NULL) @@ -80,6 +82,10 @@ rump_netisr_init(void) ip6hand = ip6intr; if ((sym = rumpuser_dl_globalsym(rumpns_ip6intr)) != NULL) ip6hand = sym; + + mplshand = mplsintr; + if ((sym = rumpuser_dl_globalsym(rumpns_mplsintr)) != NULL) + mplshand = sym; netisrs[NETISR_IP] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE, (void (*)(void *))iphand, NULL); @@ -87,4 +93,6 @@ rump_netisr_init(void) (void (*)(void *))arphand, NULL); netisrs[NETISR_IPV6] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE, (void (*)(void *))ip6hand, NULL); + netisrs[NETISR_MPLS] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE, + (void (*)(void *))mplshand, NULL); } Index: src/sys/rump/net/Makefile.rumpnetcomp diff -u src/sys/rump/net/Makefile.rumpnetcomp:1.5 src/sys/rump/net/Makefile.rumpnetcomp:1.6 --- src/sys/rump/net/Makefile.rumpnetcomp:1.5 Wed Aug 15 17:56:58 2012 +++ src/sys/rump/net/Makefile.rumpnetcomp Thu Jul 18 15:59:27 2013 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile.rumpnetcomp,v 1.5 2012/08/15 17:56:58 rmind Exp $ +# $NetBSD: Makefile.rumpnetcomp,v 1.6 2013/07/18 15:59:27 kefren Exp $ # -RUMPNETCOMP= agr bridge net net80211 netbt netinet npf local shmif virtif +RUMPNETCOMP= agr bridge net net80211 netbt netinet netmpls npf +RUMPNETCOMP+= local shmif virtif RUMPNETSOCKIN= sockin Index: src/sys/rump/net/lib/libnet/Makefile diff -u src/sys/rump/net/lib/libnet/Makefile:1.17 src/sys/rump/net/lib/libnet/Makefile:1.18 --- src/sys/rump/net/lib/libnet/Makefile:1.17 Sat Jun 1 10:54:24 2013 +++ src/sys/rump/net/lib/libnet/Makefile Thu Jul 18 15:59:28 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2013/06/01 10:54:24 pooka Exp $ +# $NetBSD: Makefile,v 1.18 2013/07/18 15:59:28 kefren Exp $ # .PATH: ${.CURDIR}/../../../../net ${.CURDIR}/../../../../compat/common @@ -15,6 +15,7 @@ CPPFLAGS+= -I${.CURDIR}/opt -I${.CURDIR} CPPFLAGS+= -DCOMPAT_OIFREQ -DCOMPAT_OIFDATA .include ${.CURDIR}/../libnetinet/Makefile.inc +.include ${.CURDIR}/../libnetmpls/Makefile.inc .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/net/lib/libnet/opt/opt_mpls.h diff -u src/sys/rump/net/lib/libnet/opt/opt_mpls.h:1.1 src/sys/rump/net/lib/libnet/opt/opt_mpls.h:1.2 --- src/sys/rump/net/lib/libnet/opt/opt_mpls.h:1.1 Sat Jun 26 14:24:28 2010 +++ src/sys/rump/net/lib/libnet/opt/opt_mpls.h Thu Jul 18 15:59:28 2013 @@ -1,3 +1,3 @@ -/* $NetBSD: opt_mpls.h,v 1.1 2010/06/26 14:24:28 kefren Exp $ */ +/* $NetBSD: opt_mpls.h,v 1.2 2013/07/18 15:59:28 kefren Exp $
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: kefren Date: Thu Jul 18 16:01:41 UTC 2013 Modified Files: src/distrib/sets/lists/base: shl.mi src/distrib/sets/lists/comp: mi shl.mi Log Message: Add librumpnet_netmpls into sets' lists To generate a diff of this commit: cvs rdiff -u -r1.665 -r1.666 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.1828 -r1.1829 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.249 -r1.250 src/distrib/sets/lists/comp/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.665 src/distrib/sets/lists/base/shl.mi:1.666 --- src/distrib/sets/lists/base/shl.mi:1.665 Sun Apr 28 04:05:38 2013 +++ src/distrib/sets/lists/base/shl.mi Thu Jul 18 16:01:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.665 2013/04/28 04:05:38 joerg Exp $ +# $NetBSD: shl.mi,v 1.666 2013/07/18 16:01:41 kefren Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -660,6 +660,9 @@ ./usr/lib/librumpnet_netinet.so base-rump-shlib rump ./usr/lib/librumpnet_netinet.so.0 base-rump-shlib rump ./usr/lib/librumpnet_netinet.so.0.0 base-rump-shlib rump +./usr/lib/librumpnet_netmpls.so base-rump-shlib rump +./usr/lib/librumpnet_netmpls.so.0 base-rump-shlib rump +./usr/lib/librumpnet_netmpls.so.0.0 base-rump-shlib rump ./usr/lib/librumpnet_shmif.so base-rump-shlib rump ./usr/lib/librumpnet_shmif.so.0 base-rump-shlib rump ./usr/lib/librumpnet_shmif.so.0.0 base-rump-shlib rump Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1828 src/distrib/sets/lists/comp/mi:1.1829 --- src/distrib/sets/lists/comp/mi:1.1828 Wed Jun 26 12:07:21 2013 +++ src/distrib/sets/lists/comp/mi Thu Jul 18 16:01:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1828 2013/06/26 12:07:21 njoly Exp $ +# $NetBSD: mi,v 1.1829 2013/07/18 16:01:41 kefren Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -3235,6 +3235,8 @@ ./usr/lib/librumpnet_netbt_p.a comp-c-proflib profile,rump ./usr/lib/librumpnet_netinet.a comp-c-lib rump ./usr/lib/librumpnet_netinet_p.a comp-c-proflib profile,rump +./usr/lib/librumpnet_netmpls.a comp-c-lib rump +./usr/lib/librumpnet_netmpls_p.a comp-c-proflib profile,rump ./usr/lib/librumpnet_npf.a comp-c-lib rump ./usr/lib/librumpnet_npf_p.a comp-c-lib profile,rump ./usr/lib/librumpnet_p.a comp-c-proflib profile,rump Index: src/distrib/sets/lists/comp/shl.mi diff -u src/distrib/sets/lists/comp/shl.mi:1.249 src/distrib/sets/lists/comp/shl.mi:1.250 --- src/distrib/sets/lists/comp/shl.mi:1.249 Sun Apr 28 04:05:40 2013 +++ src/distrib/sets/lists/comp/shl.mi Thu Jul 18 16:01:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.249 2013/04/28 04:05:40 joerg Exp $ +# $NetBSD: shl.mi,v 1.250 2013/07/18 16:01:41 kefren Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -203,6 +203,7 @@ ./usr/lib/librumpnet_net_pic.a comp-c-piclib rump ./usr/lib/librumpnet_netbt_pic.a comp-c-piclib rump ./usr/lib/librumpnet_netinet_pic.a comp-c-piclib rump +./usr/lib/librumpnet_netmpls_pic.a comp-c-piclib rump ./usr/lib/librumpnet_npf.so comp-c-piclib rump ./usr/lib/librumpnet_npf.so.0 comp-c-piclib rump ./usr/lib/librumpnet_npf.so.0.0 comp-c-piclib rump
CVS commit: src/usr.bin/man
Module Name:src Committed By: christos Date: Thu Jul 18 16:01:25 UTC 2013 Modified Files: src/usr.bin/man: man.c Log Message: Set the string to NUL instread of providing an new empty string (from uwe) To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.48 src/usr.bin/man/man.c:1.49 --- src/usr.bin/man/man.c:1.48 Thu Jul 18 11:39:08 2013 +++ src/usr.bin/man/man.c Thu Jul 18 12:01:25 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.48 2013/07/18 15:39:08 christos Exp $ */ +/* $NetBSD: man.c,v 1.49 2013/07/18 16:01:25 christos Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.48 2013/07/18 15:39:08 christos Exp $); +__RCSID($NetBSD: man.c,v 1.49 2013/07/18 16:01:25 christos Exp $); #endif #endif /* not lint */ @@ -122,8 +122,6 @@ static void addpath(struct manstate *, static const char *getclass(const char *); static void printmanpath(struct manstate *); -static char EMPTY[1]; - /* * main function */ @@ -587,14 +585,14 @@ manual(char *page, struct manstate *mp, if (!mp-all) { /* Delete any other matches. */ while (++cnt pg-gl_pathc) - pg-gl_pathv[cnt] = EMPTY; + *pg-gl_pathv[cnt] = '\0'; break; } continue; } /* It's not a man page, forget about it. */ - pg-gl_pathv[cnt] = EMPTY; + *pg-gl_pathv[cnt] = '\0'; } notfound: @@ -643,7 +641,7 @@ manual(char *page, struct manstate *mp, if (mp-pathsearch) { p = strstr(pg-gl_pathv[cnt], mp-pathsearch); if (!p || strchr(p, '/') == NULL) { - pg-gl_pathv[cnt] = EMPTY; /* zap! */ + *pg-gl_pathv[cnt] = '\0'; /* zap! */ continue; } } @@ -682,14 +680,14 @@ next:anyfound = 1; if (!mp-all) { /* Delete any other matches. */ while (++cnt pg-gl_pathc) - pg-gl_pathv[cnt] = EMPTY; + *pg-gl_pathv[cnt] = '\0'; break; } continue; } /* It's not a man page, forget about it. */ - pg-gl_pathv[cnt] = EMPTY; + *pg-gl_pathv[cnt] = '\0'; } if (anyfound !mp-all)
CVS commit: src/usr.bin/man
Module Name:src Committed By: christos Date: Thu Jul 18 16:28:52 UTC 2013 Modified Files: src/usr.bin/man: Makefile man.c Log Message: use -Wno-format and revert fixstring To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.bin/man/Makefile cvs rdiff -u -r1.49 -r1.50 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/Makefile diff -u src/usr.bin/man/Makefile:1.12 src/usr.bin/man/Makefile:1.13 --- src/usr.bin/man/Makefile:1.12 Thu Jul 18 11:39:08 2013 +++ src/usr.bin/man/Makefile Thu Jul 18 12:28:52 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2013/07/18 15:39:08 christos Exp $ +# $NetBSD: Makefile,v 1.13 2013/07/18 16:28:52 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 WARNS?= 6 @@ -7,6 +7,8 @@ PROG= man SRCS= man.c manconf.c MAN= man.1 man.conf.5 +COPTS.man.c += -Wno-format + DPADD+= ${LIBUTIL} LDADD+= -lutil Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.49 src/usr.bin/man/man.c:1.50 --- src/usr.bin/man/man.c:1.49 Thu Jul 18 12:01:25 2013 +++ src/usr.bin/man/man.c Thu Jul 18 12:28:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.49 2013/07/18 16:01:25 christos Exp $ */ +/* $NetBSD: man.c,v 1.50 2013/07/18 16:28:52 christos Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.49 2013/07/18 16:01:25 christos Exp $); +__RCSID($NetBSD: man.c,v 1.50 2013/07/18 16:28:52 christos Exp $); #endif #endif /* not lint */ @@ -464,21 +464,6 @@ main(int argc, char **argv) exit(cleanup()); } -static void -fixstring(char *buf, size_t len, const char *fmt, const char *str) -{ - const char *ptr = strstr(fmt, %s); - size_t l; - if (ptr == NULL) { - strlcpy(buf, fmt, len); - return; - } - l = (size_t)(ptr - fmt) + 1; - strlcpy(buf, fmt, MIN(l, len)); - strlcat(buf, str, len); - strlcat(buf, ptr + 2, len); -} - static int manual_find_buildkeyword(char *escpage, const char *fmt, struct manstate *mp, glob_t *pg, size_t cnt) @@ -498,7 +483,7 @@ manual_find_buildkeyword(char *escpage, continue; *p = '\0'; - fixstring(buf, sizeof(buf), fmt, escpage); + (void)snprintf(buf, sizeof(buf), fmt, escpage, suffix-s); if (!fnmatch(buf, pg-gl_pathv[cnt], 0)) { if (!mp-where) build_page(p + 1, pg-gl_pathv[cnt], mp); @@ -781,7 +766,7 @@ build_page(char *fmt, char **pathp, stru exit(EXIT_FAILURE); } (void)snprintf(buf, sizeof(buf), %s %s, fmt, tpath); - fixstring(cmd, sizeof(cmd), buf, p); + (void)snprintf(cmd, sizeof(cmd), buf, p); (void)system(cmd); (void)close(fd); if ((*pathp = strdup(tpath)) == NULL) {
CVS commit: src/usr.bin/man
Module Name:src Committed By: uwe Date: Thu Jul 18 16:33:31 UTC 2013 Modified Files: src/usr.bin/man: man.c Log Message: Don't access memory outside the array if tmpdirlen == 0. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.50 src/usr.bin/man/man.c:1.51 --- src/usr.bin/man/man.c:1.50 Thu Jul 18 16:28:52 2013 +++ src/usr.bin/man/man.c Thu Jul 18 16:33:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.50 2013/07/18 16:28:52 christos Exp $ */ +/* $NetBSD: man.c,v 1.51 2013/07/18 16:33:31 uwe Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.50 2013/07/18 16:28:52 christos Exp $); +__RCSID($NetBSD: man.c,v 1.51 2013/07/18 16:33:31 uwe Exp $); #endif #endif /* not lint */ @@ -759,7 +759,7 @@ build_page(char *fmt, char **pathp, stru tmpdir = _PATH_TMP; tmpdirlen = strlen(tmpdir); (void)snprintf(tpath, sizeof (tpath), %s%s%s, tmpdir, - (tmpdirlen tmpdir[tmpdirlen-1] == '/') ? : /, TMPFILE); + (tmpdirlen 0 tmpdir[tmpdirlen-1] == '/') ? : /, TMPFILE); if ((fd = mkstemp(tpath)) == -1) { warn(%s, tpath); (void)cleanup();
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: christos Date: Thu Jul 18 17:02:58 UTC 2013 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: grabmyaddr.c Log Message: add RTM_LOSING, RTM_REDIRECT To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 \ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c diff -u src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.31 src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.32 --- src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.31 Fri Apr 12 05:53:10 2013 +++ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c Thu Jul 18 13:02:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: grabmyaddr.c,v 1.31 2013/04/12 09:53:10 tteras Exp $ */ +/* $NetBSD: grabmyaddr.c,v 1.32 2013/07/18 17:02:58 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 2008 Timo Teras timo.te...@iki.fi. @@ -766,6 +766,12 @@ kernel_handle_message(msg) case RTM_CHANGE: case RTM_GET: case RTM_MISS: +#ifdef RTM_LOSING + case RTM_LOSING: +#endif +#ifdef RTM_REDIRECT + case RTM_REDIRECT: +#endif case RTM_IFINFO: #ifdef RTM_OIFINFO case RTM_OIFINFO:
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: njoly Date: Thu Jul 18 17:31:02 UTC 2013 Modified Files: src/sys/compat/linux/common: linux_futex.c Log Message: Do not make FUTEX_WAIT wait indefinitely for an invalid timeout (tv_nsec = -1). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/compat/linux/common/linux_futex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/linux/common/linux_futex.c diff -u src/sys/compat/linux/common/linux_futex.c:1.30 src/sys/compat/linux/common/linux_futex.c:1.31 --- src/sys/compat/linux/common/linux_futex.c:1.30 Wed Apr 17 14:39:40 2013 +++ src/sys/compat/linux/common/linux_futex.c Thu Jul 18 17:31:02 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_futex.c,v 1.30 2013/04/17 14:39:40 christos Exp $ */ +/* $NetBSD: linux_futex.c,v 1.31 2013/07/18 17:31:02 njoly Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(1, $NetBSD: linux_futex.c,v 1.30 2013/04/17 14:39:40 christos Exp $); +__KERNEL_RCSID(1, $NetBSD: linux_futex.c,v 1.31 2013/07/18 17:31:02 njoly Exp $); #include sys/param.h #include sys/time.h @@ -195,6 +195,8 @@ linux_do_futex(struct lwp *l, const stru /*FALLTHROUGH*/ case LINUX_FUTEX_WAIT_BITSET: if ((error = ts2timo(clk, 0, ts, tout, NULL)) != 0) { + if (error != ETIMEDOUT) +return error; /* * If the user process requests a non null timeout, * make sure we do not turn it into an infinite @@ -203,7 +205,7 @@ linux_do_futex(struct lwp *l, const stru * We use a minimal timeout of 1/hz. Maybe it would make * sense to just return ETIMEDOUT without sleeping. */ - if (error == ETIMEDOUT SCARG(uap, timeout) != NULL) + if (SCARG(uap, timeout) != NULL) tout = 1; else tout = 0;
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: njoly Date: Thu Jul 18 18:11:30 UTC 2013 Modified Files: src/distrib/sets/lists/debug: shl.mi Log Message: +librumpnet_netmpls.so.0.0.debug To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/distrib/sets/lists/debug/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/debug/shl.mi diff -u src/distrib/sets/lists/debug/shl.mi:1.26 src/distrib/sets/lists/debug/shl.mi:1.27 --- src/distrib/sets/lists/debug/shl.mi:1.26 Wed May 8 15:35:33 2013 +++ src/distrib/sets/lists/debug/shl.mi Thu Jul 18 18:11:30 2013 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.26 2013/05/08 15:35:33 christos Exp $ +# $NetBSD: shl.mi,v 1.27 2013/07/18 18:11:30 njoly Exp $ ./usr/libdata/debug/lib/libc.so.12.185.debug comp-sys-debug debug ./usr/libdata/debug/lib/libcrypt.so.1.0.debug comp-sys-debug debug ./usr/libdata/debug/lib/libcrypto.so.8.1.debug comp-sys-debug debug @@ -216,6 +216,7 @@ ./usr/libdata/debug/usr/lib/librumpnet_net80211.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpnet_netbt.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpnet_netinet.so.0.0.debug comp-rump-debug debug,rump +./usr/libdata/debug/usr/lib/librumpnet_netmpls.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpnet_npf.so.0.0.debug comp-rump-debug npf,debug,rump ./usr/libdata/debug/usr/lib/librumpnet_shmif.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpnet_sockin.so.0.0.debug comp-rump-debug debug,rump
CVS commit: src/lib/csu/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 18:43:04 UTC 2013 Modified Files: src/lib/csu/arch/m68k: crtbegin.h Log Message: s/bsrl/jsr/ and let gas figure it out To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/arch/m68k/crtbegin.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/arch/m68k/crtbegin.h diff -u src/lib/csu/arch/m68k/crtbegin.h:1.1 src/lib/csu/arch/m68k/crtbegin.h:1.2 --- src/lib/csu/arch/m68k/crtbegin.h:1.1 Thu Jul 11 17:07:35 2013 +++ src/lib/csu/arch/m68k/crtbegin.h Thu Jul 18 18:43:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 17:07:35 matt Exp $ */ +/* $NetBSD: crtbegin.h,v 1.2 2013/07/18 18:43:04 matt Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,9 +29,9 @@ */ __asm( .pushsection .init -\n\t bsrl __do_global_ctors_aux +\n\t jsr __do_global_ctors_aux \n\t .popsection); __asm( .pushsection .fini -\n\t bsrl __do_global_dtors_aux +\n\t jsr __do_global_dtors_aux \n\t .popsection);
CVS commit: src/lib/csu/common
Module Name:src Committed By: matt Date: Thu Jul 18 18:43:56 UTC 2013 Modified Files: src/lib/csu/common: Makefile.inc Log Message: Only supplie -fPIE to crtbegin.c if MKPIC is yes. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/csu/common/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/csu/common/Makefile.inc diff -u src/lib/csu/common/Makefile.inc:1.14 src/lib/csu/common/Makefile.inc:1.15 --- src/lib/csu/common/Makefile.inc:1.14 Wed Jul 17 14:23:45 2013 +++ src/lib/csu/common/Makefile.inc Thu Jul 18 18:43:56 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.14 2013/07/17 14:23:45 martin Exp $ +# $NetBSD: Makefile.inc,v 1.15 2013/07/18 18:43:56 matt Exp $ .include bsd.own.mk @@ -12,6 +12,7 @@ OBJS+= crtbegin.o crtend.o .if ${MKPIC} == yes OBJS+= crtbeginS.o +CFLAGS.crtbegin.c+= -fPIE .endif realall: ${OBJS} @@ -23,7 +24,7 @@ crtbegin.o: crtbegin.S .else crtbegin.o: crtbegin.c crtbegin.h ${_MKTARGET_COMPILE} - ${COMPILE.c} -fPIE ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o + ${COMPILE.c} ${CFLAGS.crtbegin.c} ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o .endif ${LD} -x -r -o ${.TARGET} ${.TARGET}.o rm -f ${.TARGET}.o
CVS commit: src/sys/kern
Module Name:src Committed By: alnsn Date: Thu Jul 18 19:39:49 UTC 2013 Modified Files: src/sys/kern: subr_vmem.c Log Message: Always terminate qc_name with NUL because pool_init(9) uses strcmp(3) to compare wchans. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/kern/subr_vmem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/subr_vmem.c diff -u src/sys/kern/subr_vmem.c:1.83 src/sys/kern/subr_vmem.c:1.84 --- src/sys/kern/subr_vmem.c:1.83 Wed Mar 6 11:20:10 2013 +++ src/sys/kern/subr_vmem.c Thu Jul 18 19:39:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_vmem.c,v 1.83 2013/03/06 11:20:10 yamt Exp $ */ +/* $NetBSD: subr_vmem.c,v 1.84 2013/07/18 19:39:49 alnsn Exp $ */ /*- * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi, @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_vmem.c,v 1.83 2013/03/06 11:20:10 yamt Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_vmem.c,v 1.84 2013/07/18 19:39:49 alnsn Exp $); #if defined(_KERNEL) #include opt_ddb.h @@ -553,6 +553,7 @@ qc_init(vmem_t *vm, size_t qcache_max, i qc-qc_vmem = vm; snprintf(qc-qc_name, sizeof(qc-qc_name), %s-%zu, vm-vm_name, size); + qc-qc_name[sizeof(qc-qc_name) - 1] = '\0'; pc = pool_cache_init(size, ORDER2SIZE(vm-vm_quantum_shift), 0,
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: matt Date: Thu Jul 18 19:49:01 UTC 2013 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: invert tests ${MACHINE} != m68000 - ${MACHINE} == m68k To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/Makefile.inc diff -u src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.9 src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.10 --- src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.9 Sun Jan 4 17:54:29 2009 +++ src/common/lib/libc/arch/m68k/atomic/Makefile.inc Thu Jul 18 19:49:00 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.9 2009/01/04 17:54:29 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.10 2013/07/18 19:49:00 matt Exp $ # # Note: The atomic operations here in these assembly files are atomic @@ -11,7 +11,7 @@ .if defined(LIB) (${LIB} == kern || ${LIB} == c || ${LIB} == pthread \ || ${LIB} == rump) -.if ${MACHINE_ARCH} != m68000 +.if ${MACHINE_ARCH} == m68k SRCS+= atomic_add.S atomic_and.S atomic_cas.S atomic_dec.S \ atomic_inc.S atomic_or.S atomic_swap.S membar_ops_nop.c @@ -27,7 +27,7 @@ SRCS+= atomic_add_32_cas.c atomic_add_3 .endif .if defined(LIB) (${LIB} == c || ${LIB} == pthread) -.if ${MACHINE_ARCH} != m68000 +.if ${MACHINE_ARCH} == m68k SRCS+= atomic_init_cas.c
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: matt Date: Thu Jul 18 20:35:39 UTC 2013 Modified Files: src/distrib/sets/lists/debug: mi Log Message: Make the shared library related tests dependent on pic To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/distrib/sets/lists/debug/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.27 src/distrib/sets/lists/debug/mi:1.28 --- src/distrib/sets/lists/debug/mi:1.27 Fri Jul 5 15:30:36 2013 +++ src/distrib/sets/lists/debug/mi Thu Jul 18 20:35:39 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.27 2013/07/05 15:30:36 njoly Exp $ +# $NetBSD: mi,v 1.28 2013/07/18 20:35:39 matt Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/libdata/debug/bin/cat.debug comp-util-debug debug ./usr/libdata/debug/bin/chio.debug comp-util-debug debug @@ -1751,10 +1751,10 @@ ./usr/libdata/debug/usr/tests/lib/libposix/posix2/t_rename.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libppath/t_ppath.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libprop/t_basic.debug tests-lib-debug debug,atf -./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/h_pthread_dlopen.so.1.debug tests-lib-debug debug,atf -./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_dso_pthread_create.debug tests-lib-debug debug,atf -./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_dlopen.debug tests-lib-debug debug,atf -./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_main_pthread_create.debug tests-lib-debug debug,atf +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/h_pthread_dlopen.so.1.debug tests-lib-debug debug,atf,pic +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_dso_pthread_create.debug tests-lib-debug debug,atf,pic +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_dlopen.debug tests-lib-debug debug,atf,pic +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_main_pthread_create.debug tests-lib-debug debug,atf,pic ./usr/libdata/debug/usr/tests/lib/libpthread/h_atexit.debug tests-lib-tests debug,atf ./usr/libdata/debug/usr/tests/lib/libpthread/h_cancel.debug tests-lib-tests debug,atf @@ -1800,16 +1800,16 @@ ./usr/libdata/debug/usr/tests/lib/libutil/t_pidfile.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libutil/t_snprintb.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libutil/t_sockaddr_snprintf.debug tests-lib-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_df_1_noopen1.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_df_1_noopen2.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_dl_symver_v0.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_dl_symver_v1.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_dl_symver_v2.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_locking.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlerror-cleared.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlerror-false.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlinfo.debug tests-libexec-debug debug,atf -./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlvsym.debug tests-libexec-debug debug,atf +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_df_1_noopen1.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_df_1_noopen2.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_dl_symver_v0.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_dl_symver_v1.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_dl_symver_v2.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_locking.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlerror-cleared.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlerror-false.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlinfo.debug tests-libexec-debug debug,atf,pic +./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlvsym.debug tests-libexec-debug debug,atf,pic ./usr/libdata/debug/usr/tests/net/bpf/t_bpf.debug tests-net-debug debug,atf,rump ./usr/libdata/debug/usr/tests/net/bpf/t_div-by-zero.debug tests-net-debug debug,atf,rump ./usr/libdata/debug/usr/tests/net/bpfilter/t_bpfilter.debug tests-net-debug debug,atf,rump
CVS commit: src
Module Name:src Committed By: matt Date: Thu Jul 18 21:03:07 UTC 2013 Modified Files: src/distrib/sets/lists/base: md.sun2 src/usr.bin/fdformat: Makefile Log Message: Make sure fdformat is on m68k (even sun2) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/base/md.sun2 cvs rdiff -u -r1.13 -r1.14 src/usr.bin/fdformat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/md.sun2 diff -u src/distrib/sets/lists/base/md.sun2:1.9 src/distrib/sets/lists/base/md.sun2:1.10 --- src/distrib/sets/lists/base/md.sun2:1.9 Sat Feb 14 11:33:56 2009 +++ src/distrib/sets/lists/base/md.sun2 Thu Jul 18 21:03:07 2013 @@ -1,7 +1,8 @@ -# $NetBSD: md.sun2,v 1.9 2009/02/14 11:33:56 abs Exp $ +# $NetBSD: md.sun2,v 1.10 2013/07/18 21:03:07 matt Exp $ ./usr/mdec/bootxxbase-sysutil-bin ./usr/mdec/bootyybase-sysutil-bin ./usr/mdec/installbootbase-obsolete obsolete ./usr/mdec/netbootbase-sysutil-bin ./usr/mdec/tapebootbase-sysutil-bin ./usr/mdec/ufsbootbase-sysutil-bin +./usr/bin/fdformatbase-util-bin Index: src/usr.bin/fdformat/Makefile diff -u src/usr.bin/fdformat/Makefile:1.13 src/usr.bin/fdformat/Makefile:1.14 --- src/usr.bin/fdformat/Makefile:1.13 Tue Mar 30 07:26:23 2010 +++ src/usr.bin/fdformat/Makefile Thu Jul 18 21:03:07 2013 @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.13 2010/03/30 07:26:23 mrg Exp $ +# $NetBSD: Makefile,v 1.14 2013/07/18 21:03:07 matt Exp $ .include bsd.own.mk .if (${MACHINE_ARCH} == alpha || \ ${MACHINE_CPU} == arm || \ ${MACHINE_ARCH} == i386 || \ - ${MACHINE_ARCH} == m68k || \ + ${MACHINE_CPU} == m68k || \ ${MACHINE_CPU} == powerpc || \ ${MACHINE_ARCH} == sparc || \ ${MACHINE_ARCH} == sparc64 || \
CVS commit: src/usr.bin/elf2aout
Module Name:src Committed By: matt Date: Thu Jul 18 21:11:47 UTC 2013 Modified Files: src/usr.bin/elf2aout: Makefile Log Message: Use ${MACHINE_CPU} == m68k To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/elf2aout/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/elf2aout/Makefile diff -u src/usr.bin/elf2aout/Makefile:1.8 src/usr.bin/elf2aout/Makefile:1.9 --- src/usr.bin/elf2aout/Makefile:1.8 Tue Mar 30 07:26:23 2010 +++ src/usr.bin/elf2aout/Makefile Thu Jul 18 21:11:47 2013 @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.8 2010/03/30 07:26:23 mrg Exp $ +# $NetBSD: Makefile,v 1.9 2013/07/18 21:11:47 matt Exp $ # from: @(#)Makefile 5.4 (Berkeley) 5/11/90 +.include bsd.own.mk # for MACHINE_CPU + # Build ELF to {ecoff, aout} tools on m68k/powerpc, for kernels with old amigappc bootblocks. -.if (${MACHINE_ARCH} == m68000 || \ - ${MACHINE_ARCH} == m68k || \ +.if (${MACHINE_CPU} == m68k || \ ${MACHINE_ARCH} == powerpc || \ ${MACHINE_ARCH} == powerpc64) PROG= elf2aout
CVS commit: src/lib/libc/arch/m68k/quad
Module Name:src Committed By: matt Date: Thu Jul 18 21:18:36 UTC 2013 Modified Files: src/lib/libc/arch/m68k/quad: ashldi3.S ashrdi3.S lshrdi3.S Log Message: Use stack adjustment in the lnk instruction to adjust the stack. Saves one word on the following moveml To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/m68k/quad/ashldi3.S \ src/lib/libc/arch/m68k/quad/ashrdi3.S cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/m68k/quad/lshrdi3.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/quad/ashldi3.S diff -u src/lib/libc/arch/m68k/quad/ashldi3.S:1.6 src/lib/libc/arch/m68k/quad/ashldi3.S:1.7 --- src/lib/libc/arch/m68k/quad/ashldi3.S:1.6 Tue Jul 16 21:49:45 2013 +++ src/lib/libc/arch/m68k/quad/ashldi3.S Thu Jul 18 21:18:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ashldi3.S,v 1.6 2013/07/16 21:49:45 matt Exp $ */ +/* $NetBSD: ashldi3.S,v 1.7 2013/07/18 21:18:36 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -37,8 +37,8 @@ | d3 offset (32 - shift) ENTRY(__ashldi3) - link %fp,#0 - moveml %d2-%d4,-(%sp) + link %fp,#-12 + moveml %d2-%d4,(%sp) movel 8(%fp),%d0 movel 12(%fp),%d1 movel 16(%fp),%d2 Index: src/lib/libc/arch/m68k/quad/ashrdi3.S diff -u src/lib/libc/arch/m68k/quad/ashrdi3.S:1.6 src/lib/libc/arch/m68k/quad/ashrdi3.S:1.7 --- src/lib/libc/arch/m68k/quad/ashrdi3.S:1.6 Tue Jul 16 21:49:45 2013 +++ src/lib/libc/arch/m68k/quad/ashrdi3.S Thu Jul 18 21:18:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ashrdi3.S,v 1.6 2013/07/16 21:49:45 matt Exp $ */ +/* $NetBSD: ashrdi3.S,v 1.7 2013/07/18 21:18:36 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -37,8 +37,8 @@ | d3 offset (32 - shift) ENTRY(__ashrdi3) - link %fp,#0 - moveml %d2-%d4,-(%sp) + link %fp,#-12 + moveml %d2-%d4,(%sp) movel 8(%fp),%d0 movel 12(%fp),%d1 movel 16(%fp),%d2 Index: src/lib/libc/arch/m68k/quad/lshrdi3.S diff -u src/lib/libc/arch/m68k/quad/lshrdi3.S:1.7 src/lib/libc/arch/m68k/quad/lshrdi3.S:1.8 --- src/lib/libc/arch/m68k/quad/lshrdi3.S:1.7 Tue Jul 16 21:49:45 2013 +++ src/lib/libc/arch/m68k/quad/lshrdi3.S Thu Jul 18 21:18:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lshrdi3.S,v 1.7 2013/07/16 21:49:45 matt Exp $ */ +/* $NetBSD: lshrdi3.S,v 1.8 2013/07/18 21:18:36 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -37,8 +37,8 @@ | d3 offset (32 - shift) ENTRY(__lshrdi3) - link %fp,#0 - moveml %d2-%d4,-(%sp) + link %fp,#-12 + moveml %d2-%d4,(%sp) movel 8(%fp),%d0 movel 12(%fp),%d1 movel 16(%fp),%d2
CVS commit: src/lib/libc/arch/m68k/gdtoa
Module Name:src Committed By: matt Date: Thu Jul 18 21:19:50 UTC 2013 Modified Files: src/lib/libc/arch/m68k/gdtoa: Makefile.inc Log Message: ${MACHINE_ARCH} != m68000 -- ${MACHINE_ARCH} == m68k To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/m68k/gdtoa/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/gdtoa/Makefile.inc diff -u src/lib/libc/arch/m68k/gdtoa/Makefile.inc:1.3 src/lib/libc/arch/m68k/gdtoa/Makefile.inc:1.4 --- src/lib/libc/arch/m68k/gdtoa/Makefile.inc:1.3 Tue Mar 21 22:50:13 2006 +++ src/lib/libc/arch/m68k/gdtoa/Makefile.inc Thu Jul 18 21:19:50 2013 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile.inc,v 1.3 2006/03/21 22:50:13 he Exp $ +# $NetBSD: Makefile.inc,v 1.4 2013/07/18 21:19:50 matt Exp $ SRCS+= strtof.c -.if ${MACHINE_ARCH} != m68000 +.if ${MACHINE_ARCH} == m68k SRCS+= strtold_pxL.c SRCS+= strtopxL.c .endif
CVS commit: src/lib/libc/arch/m68k/hardfloat
Module Name:src Committed By: matt Date: Thu Jul 18 21:25:11 UTC 2013 Added Files: src/lib/libc/arch/m68k/hardfloat: fixunssfsi.S floatunsidf.S floatunsisf.S Log Message: Add for softfloat compatibility To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/m68k/hardfloat/fixunssfsi.S \ src/lib/libc/arch/m68k/hardfloat/floatunsidf.S \ src/lib/libc/arch/m68k/hardfloat/floatunsisf.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libc/arch/m68k/hardfloat/fixunssfsi.S diff -u /dev/null src/lib/libc/arch/m68k/hardfloat/fixunssfsi.S:1.1 --- /dev/null Thu Jul 18 21:25:11 2013 +++ src/lib/libc/arch/m68k/hardfloat/fixunssfsi.S Thu Jul 18 21:25:11 2013 @@ -0,0 +1,75 @@ +/* $NetBSD: fixunssfsi.S,v 1.1 2013/07/18 21:25:11 matt Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#include machine/asm.h + +#if defined(LIBC_SCCS) !defined(lint) +#if 0 + RCSID(from: @(#)fixunssfsi.s 5.1 (Berkeley) 6/7/90) +#else + RCSID($NetBSD: fixunssfsi.S,v 1.1 2013/07/18 21:25:11 matt Exp $) +#endif +#endif /* LIBC_SCCS and not lint */ + +#ifdef __mcoldfire__ + .section .rodata,a + .p2align 4 +L2G: .double 0r2147483648.0 +#endif + +/* single - unsigned */ +ENTRY(__fixunssfsi) + fintrzs 4(%sp),%fp0 +#ifdef __mcoldfire__ + LEA_LCL(L2G,%a0) + fmoved (%a0),%fp1 + fcmpd %fp1,%fp0 +#else + fmoved #0r2147483648.0,%fp1 + fcmpx %fp1,%fp0 +#endif + fbge Lwaybig + fmovel %fp0,%d0 + rts +Lwaybig: +#ifdef __mcoldfire__ + fsubd %fp1,%fp0 +#else + fsubx %fp1,%fp0 +#endif + fmovel %fp0,%d0 + bset #31,%d0 + rts +END(__fixunssfsi) Index: src/lib/libc/arch/m68k/hardfloat/floatunsidf.S diff -u /dev/null src/lib/libc/arch/m68k/hardfloat/floatunsidf.S:1.1 --- /dev/null Thu Jul 18 21:25:11 2013 +++ src/lib/libc/arch/m68k/hardfloat/floatunsidf.S Thu Jul 18 21:25:11 2013 @@ -0,0 +1,70 @@ +/* $NetBSD: floatunsidf.S,v 1.1 2013/07/18 21:25:11 matt Exp $ */ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
CVS commit: src/lib/libc/arch/m68k/hardfloat
Module Name:src Committed By: matt Date: Thu Jul 18 21:29:31 UTC 2013 Added Files: src/lib/libc/arch/m68k/hardfloat: Makefile.inc Log Message: Add the Makefile To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/m68k/hardfloat/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libc/arch/m68k/hardfloat/Makefile.inc diff -u /dev/null src/lib/libc/arch/m68k/hardfloat/Makefile.inc:1.1 --- /dev/null Thu Jul 18 21:29:31 2013 +++ src/lib/libc/arch/m68k/hardfloat/Makefile.inc Thu Jul 18 21:29:31 2013 @@ -0,0 +1,16 @@ +# $NetBSD: Makefile.inc,v 1.1 2013/07/18 21:29:31 matt Exp $ + +SRCS+= modf.S +SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ + fpsetround.c fpsetsticky.c +# +# These allow softfloat programs to use the FPU. +# +SRCS+= adddf3.S addsf3.S cmpdf2.S cmpsf2.S divdf3.S divsf3.S \ + extendsfdf2.S fixdfsi.S fixunsdfsi.S fixunssfsi.S floatsidf.S \ + muldf3.S mulsf3.S subdf3.S subsf3.S truncdfsf2.S + +SRCS+= floatunsidf.S floatunsisf.S + +SRCS+= lesf2.S ltsf2.S nesf2.S unordsf2.S +SRCS+= ledf2.S ltdf2.S nedf2.S unorddf2.S
CVS commit: src/lib/libc/arch/m68k/hardfloat
Module Name:src Committed By: matt Date: Thu Jul 18 21:29:08 UTC 2013 Modified Files: src/lib/libc/arch/m68k/hardfloat: cmpdf2.S cmpsf2.S fixunsdfsi.S modf.S Log Message: Update to compile on coldfire. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/m68k/hardfloat/cmpdf2.S \ src/lib/libc/arch/m68k/hardfloat/cmpsf2.S \ src/lib/libc/arch/m68k/hardfloat/fixunsdfsi.S \ src/lib/libc/arch/m68k/hardfloat/modf.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/hardfloat/cmpdf2.S diff -u src/lib/libc/arch/m68k/hardfloat/cmpdf2.S:1.1 src/lib/libc/arch/m68k/hardfloat/cmpdf2.S:1.2 --- src/lib/libc/arch/m68k/hardfloat/cmpdf2.S:1.1 Wed Jul 17 06:39:06 2013 +++ src/lib/libc/arch/m68k/hardfloat/cmpdf2.S Thu Jul 18 21:29:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: cmpdf2.S,v 1.1 2013/07/17 06:39:06 matt Exp $ */ +/* $NetBSD: cmpdf2.S,v 1.2 2013/07/18 21:29:08 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -39,7 +39,7 @@ #if 0 RCSID(from: @(#)cmpdf2.s 5.1 (Berkeley) 6/7/90) #else - RCSID($NetBSD: cmpdf2.S,v 1.1 2013/07/17 06:39:06 matt Exp $) + RCSID($NetBSD: cmpdf2.S,v 1.2 2013/07/18 21:29:08 matt Exp $) #endif #endif /* LIBC_SCCS and not lint */ @@ -49,11 +49,21 @@ ENTRY(__cmpdf2) fmoved 4(%sp),%fp0 fcmpd 12(%sp),%fp0 - fbgt Lagtb + fbgt Lbgt +#ifdef __mcoldfire__ + fbeq Lbeq + movql #-1,%d0 +#else fslt %d0 extbl %d0 +#endif rts -Lagtb: +Lbgt: moveq #1,%d0 rts +#ifdef __mcoldfire__ +Lbeq: + clrl %d0 + rts +#endif END(__cmpdf2) Index: src/lib/libc/arch/m68k/hardfloat/cmpsf2.S diff -u src/lib/libc/arch/m68k/hardfloat/cmpsf2.S:1.1 src/lib/libc/arch/m68k/hardfloat/cmpsf2.S:1.2 --- src/lib/libc/arch/m68k/hardfloat/cmpsf2.S:1.1 Wed Jul 17 06:39:06 2013 +++ src/lib/libc/arch/m68k/hardfloat/cmpsf2.S Thu Jul 18 21:29:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: cmpsf2.S,v 1.1 2013/07/17 06:39:06 matt Exp $ */ +/* $NetBSD: cmpsf2.S,v 1.2 2013/07/18 21:29:08 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -39,7 +39,7 @@ #if 0 RCSID(from: @(#)cmpsf2.s 5.1 (Berkeley) 6/7/90) #else - RCSID($NetBSD: cmpsf2.S,v 1.1 2013/07/17 06:39:06 matt Exp $) + RCSID($NetBSD: cmpsf2.S,v 1.2 2013/07/18 21:29:08 matt Exp $) #endif #endif /* LIBC_SCCS and not lint */ @@ -49,11 +49,21 @@ ENTRY(__cmpsf2) fmoves 4(%sp),%fp0 fcmps 8(%sp),%fp0 - fbgt Lagtb + fbgt Lbgt +#ifdef __mcoldfire__ + fbeq Lbeq + movql #-1,%d0 +#else fslt %d0 extbl %d0 +#endif rts -Lagtb: +Lbgt: moveq #1,%d0 rts +#ifdef __mcoldfire__ +Lbeq: + clrl %d0 + rts +#endif END(__cmpsf2) Index: src/lib/libc/arch/m68k/hardfloat/fixunsdfsi.S diff -u src/lib/libc/arch/m68k/hardfloat/fixunsdfsi.S:1.1 src/lib/libc/arch/m68k/hardfloat/fixunsdfsi.S:1.2 --- src/lib/libc/arch/m68k/hardfloat/fixunsdfsi.S:1.1 Wed Jul 17 06:39:06 2013 +++ src/lib/libc/arch/m68k/hardfloat/fixunsdfsi.S Thu Jul 18 21:29:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: fixunsdfsi.S,v 1.1 2013/07/17 06:39:06 matt Exp $ */ +/* $NetBSD: fixunsdfsi.S,v 1.2 2013/07/18 21:29:08 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -39,19 +39,36 @@ #if 0 RCSID(from: @(#)fixunsdfsi.s 5.1 (Berkeley) 6/7/90) #else - RCSID($NetBSD: fixunsdfsi.S,v 1.1 2013/07/17 06:39:06 matt Exp $) + RCSID($NetBSD: fixunsdfsi.S,v 1.2 2013/07/18 21:29:08 matt Exp $) #endif #endif /* LIBC_SCCS and not lint */ +#ifdef __mcoldfire__ + .section .rodata,a + .p2align 4 +L2G: .double 0r2147483648.0 +#endif + /* (unsigned) double */ ENTRY(__fixunsdfsi) fintrzd 4(%sp),%fp0 - fcmpd #0r2147483648.0,%fp0 +#ifdef __mcoldfire__ + LEA_LCL(L2G,%a0) + fmoved (%a0),%fp1 + fcmpd %fp1,%fp0 +#else + fmoved #0r2147483648.0,%fp1 + fcmpx %fp1,%fp0 +#endif fbge Lwaybig fmovel %fp0,%d0 rts Lwaybig: - fsubd #0r2147483648.0,%fp0 +#ifdef __mcoldfire__ + fsubd %fp1,%fp0 +#else + fsubx %fp1,%fp0 +#endif fmovel %fp0,%d0 bset #31,%d0 rts Index: src/lib/libc/arch/m68k/hardfloat/modf.S diff -u src/lib/libc/arch/m68k/hardfloat/modf.S:1.1 src/lib/libc/arch/m68k/hardfloat/modf.S:1.2 --- src/lib/libc/arch/m68k/hardfloat/modf.S:1.1 Wed Jul 17 06:39:06 2013 +++ src/lib/libc/arch/m68k/hardfloat/modf.S Thu Jul 18 21:29:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: modf.S,v 1.1 2013/07/17 06:39:06 matt Exp $ */ +/* $NetBSD: modf.S,v 1.2 2013/07/18 21:29:08 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -39,7 +39,7 @@ #if 0 RCSID(from: @(#)modf.s 5.1 (Berkeley) 5/12/90) #else - RCSID($NetBSD: modf.S,v 1.1 2013/07/17 06:39:06 matt Exp $) + RCSID($NetBSD: modf.S,v 1.2 2013/07/18 21:29:08 matt Exp $) #endif #endif /* LIBC_SCCS and not lint */ @@ -50,9 +50,17 @@ ENTRY(modf) fmoved 4(%sp),%fp0 movel 12(%sp),%a0 +#ifdef __mcoldfire__ + fintrzd %fp0,%fp1 +#else fintrzx %fp0,%fp1 +#endif fmoved %fp1,(%a0)
CVS commit: src/lib/libc/arch/m68k/softfloat
Module Name:src Committed By: matt Date: Thu Jul 18 21:30:40 UTC 2013 Modified Files: src/lib/libc/arch/m68k/softfloat: softfloat.h Log Message: Coldfire doesn't do FLOATX80 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/m68k/softfloat/softfloat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/softfloat/softfloat.h diff -u src/lib/libc/arch/m68k/softfloat/softfloat.h:1.4 src/lib/libc/arch/m68k/softfloat/softfloat.h:1.5 --- src/lib/libc/arch/m68k/softfloat/softfloat.h:1.4 Thu Jul 7 07:14:57 2011 +++ src/lib/libc/arch/m68k/softfloat/softfloat.h Thu Jul 18 21:30:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: softfloat.h,v 1.4 2011/07/07 07:14:57 matt Exp $ */ +/* $NetBSD: softfloat.h,v 1.5 2013/07/18 21:30:40 matt Exp $ */ /* This is a derivative work. */ @@ -41,7 +41,9 @@ input or output the `floatx80' type will the `FLOAT128' macro and the quadruple-precision format `float128'. --- */ +#ifndef __mcoldfire__ #define FLOATX80 +#endif /* #define FLOAT128 */ #include machine/ieeefp.h
CVS commit: src/lib/libc/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 21:31:22 UTC 2013 Modified Files: src/lib/libc/arch/m68k: Makefile.inc Log Message: Move hardfloat support to its own directory To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/m68k/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/Makefile.inc diff -u src/lib/libc/arch/m68k/Makefile.inc:1.15 src/lib/libc/arch/m68k/Makefile.inc:1.16 --- src/lib/libc/arch/m68k/Makefile.inc:1.15 Wed Jul 17 01:41:17 2013 +++ src/lib/libc/arch/m68k/Makefile.inc Thu Jul 18 21:31:22 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.15 2013/07/17 01:41:17 matt Exp $ +# $NetBSD: Makefile.inc,v 1.16 2013/07/18 21:31:22 matt Exp $ SRCS+= __sigaction14_sigtramp.c __sigtramp2.S __m68k_read_tp.S __mmap.S @@ -9,4 +9,7 @@ CPPFLAGS+= -I. # for assym.h .if ${MKSOFTFLOAT} != no CPPFLAGS+= -DSOFTFLOAT_NEED_FIXUNS -DSOFTFLOAT -DSOFTFLOATM68K_FOR_GCC . include softfloat/Makefile.inc +.elif ${MACHINE_ARCH} != m68000 +.PATH : ${ARCHDIR}/hardfloat +. include ${ARCHDIR}/hardfloat/Makefile.inc .endif
CVS commit: src/lib/libc/arch/m68k/gen
Module Name:src Committed By: matt Date: Thu Jul 18 21:34:33 UTC 2013 Modified Files: src/lib/libc/arch/m68k/gen: Makefile.inc Log Message: Cleanup. hardfloat stuff is now in its own directory To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/libc/arch/m68k/gen/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/gen/Makefile.inc diff -u src/lib/libc/arch/m68k/gen/Makefile.inc:1.31 src/lib/libc/arch/m68k/gen/Makefile.inc:1.32 --- src/lib/libc/arch/m68k/gen/Makefile.inc:1.31 Tue Nov 22 15:25:28 2011 +++ src/lib/libc/arch/m68k/gen/Makefile.inc Thu Jul 18 21:34:33 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.31 2011/11/22 15:25:28 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.32 2013/07/18 21:34:33 matt Exp $ SRCS+= alloca.S fabs.S @@ -14,7 +14,7 @@ SRCS+= nanf.c # 68000-based machines use a double-extended `long double' type # for which the generic ieee754 versions can be used -.if ${MACHINE_ARCH} == m68000 +.if ${MACHINE_ARCH} != m68k SRCS+= infinityl_dbl_ieee754.c .else SRCS+= infinityl.c @@ -37,15 +37,10 @@ SRCS+= flt_rounds_softfloat.S .if ${MKSOFTFLOAT} != yes SRCS+= fpfake.c .endif -.else -SRCS+= modf.S -SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \ - fpsetround.S fpsetsticky.S -SRCS+= adddf3.S addsf3.S cmpdf2.S cmpsf2.S divdf3.S \ - divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \ - floatsidf.S modsi3.S muldf3.S mulsf3.S mulsi3.S \ - subdf3.S subsf3.S truncdfsf2.S udivsi3.S \ - umodsi3.S umulsi3.S +.endif + +.if ${MACHINE_ARCH} == m68k +SRCS+= divsi3.S modsi3.S mulsi3.S udivsi3.S umodsi3.S umulsi3.S .endif SRCS+= setjmp.S longjmp.c @@ -54,17 +49,7 @@ SRCS+= sigsetjmp.S SRCS+= makecontext.c resumecontext.S swapcontext.S -.ifdef M68040 -SRCS+= ldexp_ieee754.c # generic ieee754 version -.elifdef MKSOFTFLOAT SRCS+= ldexp_ieee754.c # generic ieee754 version -.elifdef M68060 -SRCS+= ldexp_ieee754.c # generic ieee754 version -.elif ${MACHINE_ARCH} == m68000 -SRCS+= ldexp_ieee754.c # generic ieee754 version -.else -SRCS+= ldexp_881.c -.endif LSRCS.m68k.gen= Lint_bswap16.c Lint_bswap32.c Lint_bswap64.c \ Lint_resumecontext.c Lint_swapcontext.c
CVS commit: src/lib/libc/arch/m68k/gen
Module Name:src Committed By: matt Date: Thu Jul 18 21:36:08 UTC 2013 Modified Files: src/lib/libc/arch/m68k/gen: flt_rounds_softfloat.S Log Message: Fix typo. Don't define map if it isn't used. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/m68k/gen/flt_rounds_softfloat.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/m68k/gen/flt_rounds_softfloat.S diff -u src/lib/libc/arch/m68k/gen/flt_rounds_softfloat.S:1.4 src/lib/libc/arch/m68k/gen/flt_rounds_softfloat.S:1.5 --- src/lib/libc/arch/m68k/gen/flt_rounds_softfloat.S:1.4 Tue Jul 16 22:12:20 2013 +++ src/lib/libc/arch/m68k/gen/flt_rounds_softfloat.S Thu Jul 18 21:36:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: flt_rounds_softfloat.S,v 1.4 2013/07/16 22:12:20 matt Exp $ */ +/* $NetBSD: flt_rounds_softfloat.S,v 1.5 2013/07/18 21:36:08 matt Exp $ */ /* * Written by J.T. Conklin, Apr 6, 1995 @@ -12,14 +12,14 @@ #include machine/asm.h .text - .even - +#if 0 /* NB: this is tied to the gcc-2.95 lb1sf68.asm: */ _map: .byte 1 /* round to nearest */ .byte 0 /* round to zero */ .byte 2 /* round to positive infinity */ .byte 3 /* round to negative infinity */ +#endif ENTRY(__flt_rounds) /* lea _C_LABEL(_fpCCR),%a0 | check the rounding mode */ @@ -27,4 +27,4 @@ ENTRY(__flt_rounds) /* lea _map,%a0 */ moveb #0,%d0 rts -END(_flt_rounds) +END(__flt_rounds)
CVS commit: src/lib/libc/arch/m68k/gen
Module Name:src Committed By: matt Date: Thu Jul 18 21:36:37 UTC 2013 Removed Files: src/lib/libc/arch/m68k/gen: adddf3.S addsf3.S cmpdf2.S cmpsf2.S divdf3.S divsf3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S floatsidf.S flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S fpsetround.S fpsetsticky.S modf.S muldf3.S mulsf3.S subdf3.S subsf3.S truncdfsf2.S Log Message: Remove hardfloat now that it's someplace else. To generate a diff of this commit: cvs rdiff -u -r1.8 -r0 src/lib/libc/arch/m68k/gen/adddf3.S \ src/lib/libc/arch/m68k/gen/addsf3.S src/lib/libc/arch/m68k/gen/divdf3.S \ src/lib/libc/arch/m68k/gen/divsf3.S \ src/lib/libc/arch/m68k/gen/extendsfdf2.S \ src/lib/libc/arch/m68k/gen/floatsidf.S \ src/lib/libc/arch/m68k/gen/fpgetmask.S \ src/lib/libc/arch/m68k/gen/fpgetsticky.S \ src/lib/libc/arch/m68k/gen/modf.S src/lib/libc/arch/m68k/gen/mulsf3.S \ src/lib/libc/arch/m68k/gen/subdf3.S src/lib/libc/arch/m68k/gen/subsf3.S \ src/lib/libc/arch/m68k/gen/truncdfsf2.S cvs rdiff -u -r1.7 -r0 src/lib/libc/arch/m68k/gen/cmpdf2.S \ src/lib/libc/arch/m68k/gen/cmpsf2.S src/lib/libc/arch/m68k/gen/fixdfsi.S \ src/lib/libc/arch/m68k/gen/fixunsdfsi.S cvs rdiff -u -r1.10 -r0 src/lib/libc/arch/m68k/gen/flt_rounds.S \ src/lib/libc/arch/m68k/gen/fpsetround.S cvs rdiff -u -r1.9 -r0 src/lib/libc/arch/m68k/gen/fpgetround.S \ src/lib/libc/arch/m68k/gen/fpsetmask.S \ src/lib/libc/arch/m68k/gen/fpsetsticky.S \ src/lib/libc/arch/m68k/gen/muldf3.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/libexec/ld.aout_so
Module Name:src Committed By: matt Date: Thu Jul 18 21:39:11 UTC 2013 Modified Files: src/libexec/ld.aout_so: Makefile Log Message: Use ${MACHINE_CPU} for m68k To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/libexec/ld.aout_so/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.aout_so/Makefile diff -u src/libexec/ld.aout_so/Makefile:1.49 src/libexec/ld.aout_so/Makefile:1.50 --- src/libexec/ld.aout_so/Makefile:1.49 Tue Feb 5 15:19:18 2013 +++ src/libexec/ld.aout_so/Makefile Thu Jul 18 21:39:11 2013 @@ -1,10 +1,11 @@ -# $NetBSD: Makefile,v 1.49 2013/02/05 15:19:18 martin Exp $ +# $NetBSD: Makefile,v 1.50 2013/07/18 21:39:11 matt Exp $ .include bsd.own.mk # for MKPIC definition .include bsd.endian.mk # for TARGET_ENDIANNESS .if ${MKPIC} != no -.if ${TARGET_ENDIANNESS} == 1234 ${MACHINE_CPU} == arm +.if (${TARGET_ENDIANNESS} == 1234 ${MACHINE_CPU} == arm) \ +|| ${MACHINE_CPU} == m68k UUDECODE_FILES= ld.so.${MACHINE_CPU} .else UUDECODE_FILES= ld.so.${MACHINE_ARCH}
CVS commit: src/libexec/ld.elf_so
Module Name:src Committed By: matt Date: Thu Jul 18 21:58:14 UTC 2013 Modified Files: src/libexec/ld.elf_so: Makefile Log Message: Support MACHINE_ARCH of coldfire To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.121 src/libexec/ld.elf_so/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/Makefile diff -u src/libexec/ld.elf_so/Makefile:1.120 src/libexec/ld.elf_so/Makefile:1.121 --- src/libexec/ld.elf_so/Makefile:1.120 Thu May 9 11:44:36 2013 +++ src/libexec/ld.elf_so/Makefile Thu Jul 18 21:58:13 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.120 2013/05/09 11:44:36 skrll Exp $ +# $NetBSD: Makefile,v 1.121 2013/07/18 21:58:13 matt Exp $ # # NOTE: when changing ld.so, ensure that ldd still compiles. # @@ -28,6 +28,7 @@ M= ${.CURDIR}/arch/${ARCHSUBDIR} .if ((${LDELFSO_MACHINE_ARCH} == alpha) ||\ (${MACHINE_CPU} == arm) || \ + (${LDELFSO_MACHINE_ARCH} == coldfire) ||\ (${LDELFSO_MACHINE_ARCH} == hppa) ||\ (${LDELFSO_MACHINE_ARCH} == i386) ||\ (${LDELFSO_MACHINE_ARCH} == m68k) ||\
CVS commit: src/libexec/ld.elf_so/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 21:57:42 UTC 2013 Modified Files: src/libexec/ld.elf_so/arch/m68k: rtld_start.S Log Message: Use new macros from machine/asm.h to be more portable To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/libexec/ld.elf_so/arch/m68k/rtld_start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/m68k/rtld_start.S diff -u src/libexec/ld.elf_so/arch/m68k/rtld_start.S:1.9 src/libexec/ld.elf_so/arch/m68k/rtld_start.S:1.10 --- src/libexec/ld.elf_so/arch/m68k/rtld_start.S:1.9 Mon Apr 28 20:23:03 2008 +++ src/libexec/ld.elf_so/arch/m68k/rtld_start.S Thu Jul 18 21:57:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rtld_start.S,v 1.9 2008/04/28 20:23:03 martin Exp $ */ +/* $NetBSD: rtld_start.S,v 1.10 2013/07/18 21:57:42 matt Exp $ */ /*- * Copyright (c) 1999, 2002, 2003 The NetBSD Foundation, Inc. @@ -38,8 +38,9 @@ .rtld_start: subql #8,%sp | storage for obj and cleanup - lea (%pc,_GLOBAL_OFFSET_TABLE_@GOTPC),%a0 - lea (%pc,_DYNAMIC),%a1 + GOT_SETUP(%a0) + LEA_LCL(_DYNAMIC,%a1) + movel %a1,%a5 subl (%a0),%a5 @@ -63,7 +64,7 @@ .globl _rtld_bind_start .type _rtld_bind_start,@function _rtld_bind_start: - moveml %d0-%d1/%a0-%a1,-(%sp) | preserve caller-saved registers + INTERRUPT_SAVEREG movel 20(%sp),-(%sp) | push reloff movel (16+4)(%sp),-(%sp) | push obj jbsr _rtld_bind@PLTPC | %a0 = _rtld_bind(obj, reloff) @@ -73,7 +74,7 @@ _rtld_bind_start: #else movel %d0,(16+4)(%sp) | write fake `return' address over obj #endif - moveml (%sp)+,%d0-%d1/%a0-%a1 | restore caller-saved registers + INTERRUPT_RESTOREREG | restore caller-saved registers addql #4,%sp | skip reloff rts| `return' right into function .size _rtld_bind_start,.-_rtld_bind_start
CVS commit: src/sbin/ldconfig
Module Name:src Committed By: matt Date: Thu Jul 18 21:59:46 UTC 2013 Modified Files: src/sbin/ldconfig: Makefile Log Message: Use MACHINE_CPU with m68k (m68000 will not be matched due to MKPIC=no) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/ldconfig/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ldconfig/Makefile diff -u src/sbin/ldconfig/Makefile:1.26 src/sbin/ldconfig/Makefile:1.27 --- src/sbin/ldconfig/Makefile:1.26 Tue Feb 5 07:23:00 2013 +++ src/sbin/ldconfig/Makefile Thu Jul 18 21:59:46 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.26 2013/02/05 07:23:00 matt Exp $ +# $NetBSD: Makefile,v 1.27 2013/07/18 21:59:46 matt Exp $ .include bsd.own.mk # For MKPIC .include bsd.shlib.mk @@ -7,7 +7,7 @@ .if ${MKPIC} != no \ ((${MACHINE_CPU} == arm ${TARGET_ENDIANNESS} == 1234) || \ ${MACHINE_ARCH} == i386 || \ - ${MACHINE_ARCH} == m68k || \ + ${MACHINE_CPU} == m68k || \ ${MACHINE_ARCH} == sparc || \ ${MACHINE_ARCH} == vax)
CVS commit: src/tools/gcc
Module Name:src Committed By: matt Date: Thu Jul 18 22:00:48 UTC 2013 Modified Files: src/tools/gcc: Makefile Log Message: m68k doesn't support with-float=soft To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/tools/gcc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/gcc/Makefile diff -u src/tools/gcc/Makefile:1.56 src/tools/gcc/Makefile:1.57 --- src/tools/gcc/Makefile:1.56 Fri Jun 28 08:30:10 2013 +++ src/tools/gcc/Makefile Thu Jul 18 22:00:48 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.56 2013/06/28 08:30:10 mrg Exp $ +# $NetBSD: Makefile,v 1.57 2013/07/18 22:00:48 matt Exp $ .include bsd.own.mk @@ -28,7 +28,7 @@ MULTILIB_ARGS= --enable-multilib MULTILIB_ARGS= --disable-multilib .endif -.if ${MKSOFTFLOAT} != no +.if ${MKSOFTFLOAT} != no ${MACHINE_CPU} != m68k SOFTFLOAT_ARGS= -with-float=soft .endif
CVS commit: src/share/mk
Module Name:src Committed By: matt Date: Thu Jul 18 22:06:09 UTC 2013 Modified Files: src/share/mk: bsd.endian.mk bsd.own.mk bsd.sys.mk sys.mk Log Message: Test BSD makefile about coldfire. XXX still hate m68k--netbsdelf-coldfire To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/share/mk/bsd.endian.mk cvs rdiff -u -r1.737 -r1.738 src/share/mk/bsd.own.mk cvs rdiff -u -r1.225 -r1.226 src/share/mk/bsd.sys.mk cvs rdiff -u -r1.116 -r1.117 src/share/mk/sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.endian.mk diff -u src/share/mk/bsd.endian.mk:1.17 src/share/mk/bsd.endian.mk:1.18 --- src/share/mk/bsd.endian.mk:1.17 Sun Feb 3 05:35:25 2013 +++ src/share/mk/bsd.endian.mk Thu Jul 18 22:06:09 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.endian.mk,v 1.17 2013/02/03 05:35:25 matt Exp $ +# $NetBSD: bsd.endian.mk,v 1.18 2013/07/18 22:06:09 matt Exp $ .if !defined(_BSD_ENDIAN_MK_) _BSD_ENDIAN_MK_=1 @@ -15,7 +15,8 @@ _BSD_ENDIAN_MK_=1 ${MACHINE_ARCH} == x86_64 || \ ${MACHINE_ARCH:C/^.*el$/el/} == el TARGET_ENDIANNESS= 1234 -.elif ${MACHINE_ARCH} == hppa || \ +.elif ${MACHINE_ARCH} == coldfire || \ + ${MACHINE_ARCH} == hppa || \ ${MACHINE_ARCH} == m68000 || \ ${MACHINE_ARCH} == m68k || \ ${MACHINE_ARCH} == powerpc || \ Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.737 src/share/mk/bsd.own.mk:1.738 --- src/share/mk/bsd.own.mk:1.737 Thu Jul 11 06:58:30 2013 +++ src/share/mk/bsd.own.mk Thu Jul 18 22:06:09 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.737 2013/07/11 06:58:30 martin Exp $ +# $NetBSD: bsd.own.mk,v 1.738 2013/07/18 22:06:09 matt Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -14,7 +14,7 @@ MAKECONF?= /etc/mk.conf # # CPU model, derived from MACHINE_ARCH # -MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/} +MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:S/armeb/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/} # # Subdirectory used below ${RELEASEDIR} when building a release @@ -61,6 +61,7 @@ HAVE_GCC?=45 .if \ ${MACHINE_CPU} == arm || \ ${MACHINE_ARCH} == i386 || \ +${MACHINE_CPU} == m68k || \ ${MACHINE_CPU} == mips || \ ${MACHINE_ARCH} == powerpc || \ ${MACHINE_CPU} == sh3 || \ @@ -707,6 +708,8 @@ MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_AR # .if (!empty(MACHINE_ARCH:Mearm*)) MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:S/earm/eabi/} +.elif ${MACHINE_ARCH} == coldfire +MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-coldfire .elif (${MACHINE_GNU_ARCH} == arm || \ ${MACHINE_GNU_ARCH} == armeb || \ ${MACHINE_ARCH} == i386 || \ @@ -815,11 +818,13 @@ MKCOMPATMODULES:= no # # Default mips64 to softfloat now. -# arm is always softfloat +# arm is always softfloat unless it isn't # emips is always softfloat. +# coldfire is always softfloat # .if ${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el || \ (${MACHINE_CPU} == arm ${MACHINE_ARCH:M*hf*} == ) || \ +${MACHINE_ARCH} == coldfire || \ ${MACHINE} == emips MKSOFTFLOAT?= yes .endif Index: src/share/mk/bsd.sys.mk diff -u src/share/mk/bsd.sys.mk:1.225 src/share/mk/bsd.sys.mk:1.226 --- src/share/mk/bsd.sys.mk:1.225 Wed Jul 17 19:24:56 2013 +++ src/share/mk/bsd.sys.mk Thu Jul 18 22:06:09 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.225 2013/07/17 19:24:56 martin Exp $ +# $NetBSD: bsd.sys.mk,v 1.226 2013/07/18 22:06:09 matt Exp $ # # Build definitions used for NetBSD source tree builds. @@ -75,7 +75,8 @@ CFLAGS+= ${${ACTIVE_CC} == gcc:? -Wno- CFLAGS+= ${${ACTIVE_CC} == clang:? -Wpointer-sign -Wmissing-noreturn :} .endif .if (defined(HAVE_GCC) ${HAVE_GCC} == 45 \ - (${MACHINE_ARCH} == sh3eb || \ + (${MACHINE_ARCH} == coldfire || \ + ${MACHINE_ARCH} == sh3eb || \ ${MACHINE_ARCH} == sh3el || \ ${MACHINE_ARCH} == m68k || \ ${MACHINE_ARCH} == m68000)) @@ -104,6 +105,9 @@ COPTS+= ${${ACTIVE_CC} == gcc:? --para .if ${MKSOFTFLOAT:Uno} != no COPTS+= -msoft-float FOPTS+= -msoft-float +.elif ${MACHINE_ARCH} == coldfire +COPTS+= -mhard-float +FOPTS+= -mhard-float .endif .if ${MKIEEEFP:Uno} != no Index: src/share/mk/sys.mk diff -u src/share/mk/sys.mk:1.116 src/share/mk/sys.mk:1.117 --- src/share/mk/sys.mk:1.116 Wed Mar 6 11:19:08 2013 +++ src/share/mk/sys.mk Thu Jul 18 22:06:09 2013 @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.116 2013/03/06 11:19:08 yamt Exp $ +# $NetBSD: sys.mk,v 1.117 2013/07/18 22:06:09 matt Exp $ # @(#)sys.mk 8.2 (Berkeley) 3/21/94 # # This file contains the basic rules for make(1) and is read first @@ -30,6 +30,8 @@ DBG?= -Os -freorder-blocks .elif ${MACHINE_ARCH} == m68k ||
CVS commit: src/sys/dev/pci
Module Name:src Committed By: soren Date: Thu Jul 18 22:14:54 UTC 2013 Modified Files: src/sys/dev/pci: ichsmb.c piixpm.c Log Message: Clear errors before beginning a transfer. Closes PR port-i386/46792. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ichsmb.c cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/piixpm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ichsmb.c diff -u src/sys/dev/pci/ichsmb.c:1.31 src/sys/dev/pci/ichsmb.c:1.32 --- src/sys/dev/pci/ichsmb.c:1.31 Thu Jul 18 03:14:09 2013 +++ src/sys/dev/pci/ichsmb.c Thu Jul 18 22:14:54 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ichsmb.c,v 1.31 2013/07/18 03:14:09 msaitoh Exp $ */ +/* $NetBSD: ichsmb.c,v 1.32 2013/07/18 22:14:54 soren Exp $ */ /* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */ /* @@ -22,7 +22,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ichsmb.c,v 1.31 2013/07/18 03:14:09 msaitoh Exp $); +__KERNEL_RCSID(0, $NetBSD: ichsmb.c,v 1.32 2013/07/18 22:14:54 soren Exp $); #include sys/param.h #include sys/device.h @@ -224,6 +224,13 @@ ichsmb_i2c_exec(void *cookie, i2c_op_t o flags 0x%02x\n, device_xname(sc-sc_dev), op, addr, cmdlen, len, flags)); + /* Clear status bits */ + bus_space_write_1(sc-sc_iot, sc-sc_ioh, LPCIB_SMB_HS, + LPCIB_SMB_HS_INTR | LPCIB_SMB_HS_DEVERR | + LPCIB_SMB_HS_BUSERR | LPCIB_SMB_HS_FAILED); + bus_space_barrier(sc-sc_iot, sc-sc_ioh, LPCIB_SMB_HS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + /* Wait for bus to be idle */ for (retries = 100; retries 0; retries--) { st = bus_space_read_1(sc-sc_iot, sc-sc_ioh, LPCIB_SMB_HS); Index: src/sys/dev/pci/piixpm.c diff -u src/sys/dev/pci/piixpm.c:1.40 src/sys/dev/pci/piixpm.c:1.41 --- src/sys/dev/pci/piixpm.c:1.40 Tue Feb 14 15:08:07 2012 +++ src/sys/dev/pci/piixpm.c Thu Jul 18 22:14:54 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: piixpm.c,v 1.40 2012/02/14 15:08:07 pgoyette Exp $ */ +/* $NetBSD: piixpm.c,v 1.41 2013/07/18 22:14:54 soren Exp $ */ /* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */ /* @@ -22,7 +22,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.40 2012/02/14 15:08:07 pgoyette Exp $); +__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.41 2013/07/18 22:14:54 soren Exp $); #include sys/param.h #include sys/systm.h @@ -390,6 +390,13 @@ piixpm_i2c_exec(void *cookie, i2c_op_t o DPRINTF((%s: exec: op %d, addr 0x%x, cmdlen %zu, len %zu, flags 0x%x\n, device_xname(sc-sc_dev), op, addr, cmdlen, len, flags)); + /* Clear status bits */ + bus_space_write_1(sc-sc_smb_iot, sc-sc_smb_ioh, PIIX_SMB_HS, + PIIX_SMB_HS_INTR | PIIX_SMB_HS_DEVERR | + PIIX_SMB_HS_BUSERR | PIIX_SMB_HS_FAILED); +bus_space_barrier(sc-sc_smb_iot, sc-sc_smb_ioh, PIIX_SMB_HS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + /* Wait for bus to be idle */ for (retries = 100; retries 0; retries--) { st = bus_space_read_1(sc-sc_smb_iot, sc-sc_smb_ioh,
CVS commit: src/lib/libarch
Module Name:src Committed By: matt Date: Thu Jul 18 22:14:10 UTC 2013 Modified Files: src/lib/libarch: Makefile src/lib/libarch/m68k: Makefile.inc Log Message: Use MACHINE_CPU for m68k To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libarch/Makefile cvs rdiff -u -r1.8 -r1.9 src/lib/libarch/m68k/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libarch/Makefile diff -u src/lib/libarch/Makefile:1.25 src/lib/libarch/Makefile:1.26 --- src/lib/libarch/Makefile:1.25 Sat Apr 27 06:24:22 2013 +++ src/lib/libarch/Makefile Thu Jul 18 22:14:10 2013 @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.25 2013/04/27 06:24:22 matt Exp $ +# $NetBSD: Makefile,v 1.26 2013/07/18 22:14:10 matt Exp $ + +.include bsd.own.mk # These should always be a MACHINE_CPU value ARCHDIRS= alpha arm i386 m68k sparc x86_64 Index: src/lib/libarch/m68k/Makefile.inc diff -u src/lib/libarch/m68k/Makefile.inc:1.8 src/lib/libarch/m68k/Makefile.inc:1.9 --- src/lib/libarch/m68k/Makefile.inc:1.8 Wed Sep 18 06:19:27 2002 +++ src/lib/libarch/m68k/Makefile.inc Thu Jul 18 22:14:10 2013 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.8 2002/09/18 06:19:27 lukem Exp $ +# $NetBSD: Makefile.inc,v 1.9 2013/07/18 22:14:10 matt Exp $ -.if (${MACHINE_ARCH} == m68k || ${MACHINE_ARCH} == m68000) +.if ${MACHINE_CPU} == m68k NOLINT= # defined SRCS= m68k_sync_icache.S .endif
CVS commit: src/sys/lib/libkern/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 22:14:48 UTC 2013 Modified Files: src/sys/lib/libkern/arch/m68k: scanc.S skpc.S Log Message: Adjust for coldfire To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/lib/libkern/arch/m68k/scanc.S \ src/sys/lib/libkern/arch/m68k/skpc.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/m68k/scanc.S diff -u src/sys/lib/libkern/arch/m68k/scanc.S:1.8 src/sys/lib/libkern/arch/m68k/scanc.S:1.9 --- src/sys/lib/libkern/arch/m68k/scanc.S:1.8 Thu Jul 18 12:42:24 2013 +++ src/sys/lib/libkern/arch/m68k/scanc.S Thu Jul 18 22:14:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: scanc.S,v 1.8 2013/07/18 12:42:24 matt Exp $ */ +/* $NetBSD: scanc.S,v 1.9 2013/07/18 22:14:48 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -51,13 +51,22 @@ ENTRY(scanc) movb 19(%sp),%d1 | and mask to use movl %d2,-(%sp) | need a scratch register clrl %d2 | clear it out +#ifndef __mcoldfire__ subqw #1,%d0 | adjust for dbra +#endif Lscloop: movb (%a0)+,%d2 | get character movb (%a1,%d2),%d2 | get table entry andl %d1,%d2 | mask it +#ifdef __mcoldfire__ + jne 1f | break out if mask matched + subql #1,%d0 | decrement + jne Lscloop | keep going til no more +1: +#else dbne %d0,Lscloop | keep going til no more or non-zero addqw #1,%d0 | overshot by one +#endif movl (%sp)+,%d2 | restore scratch Lscdone: rts Index: src/sys/lib/libkern/arch/m68k/skpc.S diff -u src/sys/lib/libkern/arch/m68k/skpc.S:1.8 src/sys/lib/libkern/arch/m68k/skpc.S:1.9 --- src/sys/lib/libkern/arch/m68k/skpc.S:1.8 Thu Jul 18 12:54:08 2013 +++ src/sys/lib/libkern/arch/m68k/skpc.S Thu Jul 18 22:14:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: skpc.S,v 1.8 2013/07/18 12:54:08 matt Exp $ */ +/* $NetBSD: skpc.S,v 1.9 2013/07/18 22:14:48 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -48,10 +48,18 @@ ENTRY(skpc) jeq Lskdone | nothing to do, return movb 7(%sp),%d1 | mask to use movl 12(%sp),%a0 | where to start +#ifndef __mcoldfire__ subqw #1,%d0 | adjust for dbcc +#endif Lskloop: cmpb (%a0)+,%d1 | compare with mask +#ifdef __mcoldfire__ + jne Lskdone | keep going til no more or zero + subql #1,%d0 + jne Lskloop +#else dbne %d0,Lskloop | keep going til no more or zero addqw #1,%d0 | overshot by one +#endif Lskdone: rts
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: matt Date: Thu Jul 18 22:15:45 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern Log Message: Coldfire uses atomic_cas_generic.c To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/rump/librump/rumpkern/Makefile.rumpkern Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.128 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.129 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.128 Sun Jun 23 02:35:24 2013 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Thu Jul 18 22:15:45 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.128 2013/06/23 02:35:24 riastradh Exp $ +# $NetBSD: Makefile.rumpkern,v 1.129 2013/07/18 22:15:45 matt Exp $ # .include ${RUMPTOP}/Makefile.rump @@ -204,7 +204,8 @@ KERNMISCCPPFLAGS+= -D_RUMPKERNEL # .if (${MACHINE_CPU} == arm empty(ARMV6)) || ${MACHINE_CPU} == hppa \ || ${MACHINE_CPU} == mips || ${MACHINE_CPU} == sh3 \ -|| ${MACHINE_CPU} == vax || ${MACHINE_ARCH} == m68000 +|| ${MACHINE_CPU} == vax || ${MACHINE_ARCH} == m68000 \ +|| ${MACHINE_ARCH} == coldfire CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic SRCS+= atomic_cas_generic.c #SRCS+= rump_atomic_cas_up.c
CVS commit: src/sys/arch/m68k/include
Module Name:src Committed By: matt Date: Thu Jul 18 22:18:31 UTC 2013 Modified Files: src/sys/arch/m68k/include: fpreg.h Log Message: Fix some definitions To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/include/fpreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/m68k/include/fpreg.h diff -u src/sys/arch/m68k/include/fpreg.h:1.1 src/sys/arch/m68k/include/fpreg.h:1.2 --- src/sys/arch/m68k/include/fpreg.h:1.1 Tue Jan 27 20:03:12 2009 +++ src/sys/arch/m68k/include/fpreg.h Thu Jul 18 22:18:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: fpreg.h,v 1.1 2009/01/27 20:03:12 martin Exp $ */ +/* $NetBSD: fpreg.h,v 1.2 2013/07/18 22:18:31 matt Exp $ */ /* * Copyright (c) 1995 Gordon Ross @@ -49,6 +49,7 @@ # define FPSR_QSG 0x0080 # define FPSR_QUO 0x007f #define FPSR_EXCP 0xff00 +#define FPSR_EXCP2 0x3e00 # define FPSR_BSUN 0x8000 # define FPSR_SNAN 0x4000 # define FPSR_OPERR 0x2000 @@ -57,7 +58,7 @@ # define FPSR_DZ0x0400 # define FPSR_INEX2 0x0200 # define FPSR_INEX1 0x0100 -#define FPSR_AEX0x00ff +#define FPSR_AEX0x00f8 # define FPSR_AIOP 0x0080 # define FPSR_AOVFL 0x0040 # define FPSR_AUNFL 0x0020 @@ -66,6 +67,7 @@ /* fpcr */ #define FPCR_EXCP FPSR_EXCP +#define FPCR_EXCP2 FPSR_EXCP2 # define FPCR_BSUN FPSR_BSUN # define FPCR_SNAN FPSR_SNAN # define FPCR_OPERR FPSR_OPERR
CVS commit: src/sys/arch/m68k/include
Module Name:src Committed By: matt Date: Thu Jul 18 22:17:57 UTC 2013 Modified Files: src/sys/arch/m68k/include: float.h math.h profile.h Log Message: Coldfire FPU looks like the 68010 FPU (no long double) To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/float.h cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/math.h cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/profile.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/m68k/include/float.h diff -u src/sys/arch/m68k/include/float.h:1.19 src/sys/arch/m68k/include/float.h:1.20 --- src/sys/arch/m68k/include/float.h:1.19 Sun Dec 11 12:17:53 2005 +++ src/sys/arch/m68k/include/float.h Thu Jul 18 22:17:57 2013 @@ -1,9 +1,19 @@ -/* $NetBSD: float.h,v 1.19 2005/12/11 12:17:53 christos Exp $ */ +/* $NetBSD: float.h,v 1.20 2013/07/18 22:17:57 matt Exp $ */ #ifndef _M68K_FLOAT_H_ #define _M68K_FLOAT_H_ -#ifndef __mc68010__ +#if defined(__LDBL_MANT_DIG__) +#define LDBL_MANT_DIG __LDBL_MANT_DIG__ +#define LDBL_EPSILON __LDBL_EPSILON__ +#define LDBL_DIG __LDBL_DIG__ +#define LDBL_MIN_EXP __LDBL_MIN_EXP__ +#define LDBL_MIN __LDBL_MIN__ +#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ +#define LDBL_MAX_EXP __LDBL_MAX_EXP__ +#define LDBL_MAX __LDBL_MAX__ +#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ +#elif !defined(__mc68010__) !defined(__mcoldfire__) #define LDBL_MANT_DIG 64 #define LDBL_EPSILON 1.0842021724855044340E-19L #define LDBL_DIG 18 @@ -17,7 +27,7 @@ #include sys/float_ieee754.h -#ifndef __mc68010__ +#if !defined(__mc68010__) !defined(__mcoldfire__) #if !defined(_ANSI_SOURCE) !defined(_POSIX_C_SOURCE) \ !defined(_XOPEN_SOURCE) || \ ((__STDC_VERSION__ - 0) = 199901L) || \ @@ -26,6 +36,6 @@ defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE) #define DECIMAL_DIG 21 #endif /* !defined(_ANSI_SOURCE) ... */ -#endif /* !__mc68010__ */ +#endif /* !__mc68010__ !__mcoldfire__ */ #endif /* !_M68K_FLOAT_H_ */ Index: src/sys/arch/m68k/include/math.h diff -u src/sys/arch/m68k/include/math.h:1.7 src/sys/arch/m68k/include/math.h:1.8 --- src/sys/arch/m68k/include/math.h:1.7 Sun Dec 11 12:17:53 2005 +++ src/sys/arch/m68k/include/math.h Thu Jul 18 22:17:57 2013 @@ -1,6 +1,6 @@ -/* $NetBSD: math.h,v 1.7 2005/12/11 12:17:53 christos Exp $ */ +/* $NetBSD: math.h,v 1.8 2013/07/18 22:17:57 matt Exp $ */ -#ifndef __mc68010__ +#if !defined(__mc68010__) !defined(__mcoldfire__) #define __HAVE_LONG_DOUBLE #endif #define __HAVE_NANF Index: src/sys/arch/m68k/include/profile.h diff -u src/sys/arch/m68k/include/profile.h:1.20 src/sys/arch/m68k/include/profile.h:1.21 --- src/sys/arch/m68k/include/profile.h:1.20 Wed Mar 21 19:59:18 2012 +++ src/sys/arch/m68k/include/profile.h Thu Jul 18 22:17:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.h,v 1.20 2012/03/21 19:59:18 he Exp $ */ +/* $NetBSD: profile.h,v 1.21 2013/07/18 22:17:57 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ #define MCOUNT_ENTRY mcount #endif -#ifndef __mc68010__ +#if !defined(__mc68010__) !defined(__mcoldfire__) #define MCOUNT \ extern void mcount(void) __asm(MCOUNT_ENTRY) \ __attribute__((__no_instrument_function__)); \
CVS commit: src/sys/arch/m68k/include
Module Name:src Committed By: matt Date: Thu Jul 18 22:21:31 UTC 2013 Modified Files: src/sys/arch/m68k/include: asm.h Log Message: Adjust LEA_LCL, GOT_SETUP, INTERRUPT_{SAVE,RESTORE}REG for Coldfire To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/m68k/include/asm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/m68k/include/asm.h diff -u src/sys/arch/m68k/include/asm.h:1.31 src/sys/arch/m68k/include/asm.h:1.32 --- src/sys/arch/m68k/include/asm.h:1.31 Tue Jul 16 23:01:05 2013 +++ src/sys/arch/m68k/include/asm.h Thu Jul 18 22:21:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: asm.h,v 1.31 2013/07/16 23:01:05 matt Exp $ */ +/* $NetBSD: asm.h,v 1.32 2013/07/18 22:21:31 matt Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -73,12 +73,22 @@ #ifndef _M68K_ASM_H_ #define _M68K_ASM_H_ -#if defined(PIC) +#define __IMMEDIATE # + +#if defined(PIC) || defined(__pic__) #define PIC_PLT(name) name@PLTPC +#ifdef __mcoldfire__ +#define LEA_LCL(name,reg) \ + movl __IMMEDIATE name - .,reg ; \ + lea (-6,%pc,reg),reg +#define GOT_SETUP(reg) \ + movl __IMMEDIATE _GLOBAL_OFFSET_TABLE_@GOTPC,reg ; \ + lea (-6,%pc,reg),reg +#else #define LEA_LCL(name,reg) lea (name,%pc),reg #define GOT_SETUP(reg) lea (_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),reg +#endif #else -#define __IMMEDIATE # #define PIC_PLT(name) name #define LEA_LCL(name,reg) movl __IMMEDIATE name,reg #define GOT_SETUP(reg) /* nothing */ @@ -166,8 +176,13 @@ * Need a better place for these but these are common across * all m68k ports so let's define just once. */ -#define INTERRUPT_SAVEREG moveml #0xC0C0,%sp@- -#define INTERRUPT_RESTOREREG moveml %sp@+,#0x0303 +#ifdef __mcoldfire__ +#define INTERRUPT_SAVEREG lea -16(%sp),%sp; moveml #0xC0C0,(%sp) +#define INTERRUPT_RESTOREREG moveml (%sp),#0x0303; lea 16(%sp),%sp +#else +#define INTERRUPT_SAVEREG moveml #0xC0C0,-(%sp) +#define INTERRUPT_RESTOREREG moveml (%sp)+,#0x0303 +#endif #ifdef _KERNEL /*
CVS commit: src/sys/arch/m68k/include
Module Name:src Committed By: matt Date: Thu Jul 18 22:20:48 UTC 2013 Modified Files: src/sys/arch/m68k/include: byte_swap.h Log Message: Teach to use coldfire isac byterev if available, otherwise let the compiler figure it since there is rorw instruction to fall back on. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/byte_swap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/m68k/include/byte_swap.h diff -u src/sys/arch/m68k/include/byte_swap.h:1.9 src/sys/arch/m68k/include/byte_swap.h:1.10 --- src/sys/arch/m68k/include/byte_swap.h:1.9 Mon Apr 28 20:23:26 2008 +++ src/sys/arch/m68k/include/byte_swap.h Thu Jul 18 22:20:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: byte_swap.h,v 1.9 2008/04/28 20:23:26 martin Exp $ */ +/* $NetBSD: byte_swap.h,v 1.10 2013/07/18 22:20:48 matt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -42,8 +42,14 @@ static __inline uint16_t __byte_swap_u16 static __inline uint16_t __byte_swap_u16_variable(uint16_t var) { +#if defined(__mcfisac__) + __asm volatile (swap %0; byterev %0 : =d(var) : 0 (var)); +#elif defined(__mcoldfire__) + return (var 8) || (var 8); +#else __asm volatile (rorw #8, %0 : =d (var) : 0 (var)); return (var); +#endif } #define __BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable @@ -51,8 +57,15 @@ static __inline uint32_t __byte_swap_u32 static __inline uint32_t __byte_swap_u32_variable(uint32_t var) { +#if defined(__mcfisac__) + __asm volatile (byterev %0 : =d(var) : 0 (var)); +#elif defined(__mcoldfire__) + return (var 24) | (var 24) | ((var 0x00ff) 8) + | ((var 8) 0x00ff); +#else __asm volatile ( rorw #8, %0; swap %0; rorw #8, %0 : =d (var) : 0 (var)); +#endif return (var); }
CVS commit: src/sys/arch/m68k/include
Module Name:src Committed By: matt Date: Thu Jul 18 22:24:53 UTC 2013 Added Files: src/sys/arch/m68k/include: pmap_coldfire.h pte_coldfire.h Log Message: pte and pmap files for the soft tlb on coldfire cpus. (uncompiled and mostly probably wrong.) To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/m68k/include/pmap_coldfire.h \ src/sys/arch/m68k/include/pte_coldfire.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/m68k/include/pmap_coldfire.h diff -u /dev/null src/sys/arch/m68k/include/pmap_coldfire.h:1.1 --- /dev/null Thu Jul 18 22:24:53 2013 +++ src/sys/arch/m68k/include/pmap_coldfire.h Thu Jul 18 22:24:53 2013 @@ -0,0 +1,145 @@ +/* $NetBSD: pmap_coldfire.h,v 1.1 2013/07/18 22:24:53 matt Exp $ */ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _M68K_PMAP_COLDFIRE_H_ +#define M68K_PMAP_COLDFIRE_H_ + +#ifdef _LOCORE +#error use assym.h instead +#endif + +#if defined(_MODULE) +#error this file should not be included by loadable kernel modules +#endif + +#ifdef _KERNEL_OPT +#include opt_pmap.h +#endif + +#include sys/cpu.h +#include sys/kcore.h +#include uvm/uvm_page.h +#ifdef __PMAP_PRIVATE +#include powerpc/booke/cpuvar.h +#include powerpc/cpuset.h +#endif + +#define PMAP_NEED_PROCWR + +#include uvm/pmap/vmpagemd.h + +#include m68k/pte_coldfire.h + +#define NBSEG (NBPG*NPTEPG) +#define SEGSHIFT (PGSHIFT + PGSHIFT - 2) +#define SEGOFSET ((1 SEGSHIFT) - 1) +#define PMAP_SEGTABSIZE (1 (32 - SEGSHIFT)) +#define NPTEPG (NBPG 2) + +#define KERNEL_PID 0 + +#define PMAP_TLB_MAX 1 +#define PMAP_TLB_NUM_PIDS 256 +#define PMAP_INVALID_SEGTAB_ADDRESS ((pmap_segtab_t *)0xfeeddead) + +#define pmap_phys_address(x) (x) + +void pmap_procwr(struct proc *, vaddr_t, size_t); +#define PMAP_NEED_PROCWR + +#ifdef __PMAP_PRIVATE +struct vm_page * + pmap_md_alloc_poolpage(int flags); +vaddr_t pmap_md_map_poolpage(paddr_t, vsize_t); +void pmap_md_unmap_poolpage(vaddr_t, vsize_t); +bool pmap_md_direct_mapped_vaddr_p(vaddr_t); +bool pmap_md_io_vaddr_p(vaddr_t); +paddr_t pmap_md_direct_mapped_vaddr_to_paddr(vaddr_t); +vaddr_t pmap_md_direct_map_paddr(paddr_t); +void pmap_md_init(void); + +bool pmap_md_tlb_check_entry(void *, vaddr_t, tlb_asid_t, pt_entry_t); + +#ifdef PMAP_MINIMALTLB +vaddr_t pmap_kvptefill(vaddr_t, vaddr_t, pt_entry_t); +#endif +#endif + +void pmap_md_page_syncicache(struct vm_page *, const kcpuset_t *); +vaddr_t pmap_bootstrap(vaddr_t, vaddr_t, phys_ram_seg_t *, size_t); +bool pmap_extract(struct pmap *, vaddr_t, paddr_t *); + +static inline paddr_t vtophys(vaddr_t); + +static inline paddr_t +vtophys(vaddr_t va) +{ + paddr_t pa; + + if (pmap_extract(pmap_kernel(), va, pa)) + return pa; + KASSERT(0); + return (paddr_t) -1; +} + +#ifdef __PMAP_PRIVATE +/* + * Virtual Cache Alias helper routines. Not a problem for Booke CPUs. + */ +static inline bool +pmap_md_vca_add(struct vm_page *pg, vaddr_t va, pt_entry_t *nptep) +{ + return false; +} + +static inline void +pmap_md_vca_remove(struct vm_page *pg, vaddr_t va) +{ + +} + +static inline void +pmap_md_vca_clean(struct vm_page *pg, vaddr_t va, int op) +{ +} + +static inline size_t +pmap_md_tlb_asid_max(void) +{ + return PMAP_TLB_NUM_PIDS - 1; +} +#endif + +#define POOL_VTOPHYS(va) ((paddr_t)(vaddr_t)(va)) +#define POOL_PHYSTOV(pa) ((vaddr_t)(paddr_t)(pa)) + +#include uvm/pmap/pmap.h + +#endif /* !_M68K_PMAP_COLDFIRE_H_ */ Index:
CVS commit: src/lib/libm/src
Module Name:src Committed By: matt Date: Thu Jul 18 22:31:13 UTC 2013 Modified Files: src/lib/libm/src: s_nextafterl.c Log Message: Only compile is __HAVE_LONG_DOUBLE is defined To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_nextafterl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/src/s_nextafterl.c diff -u src/lib/libm/src/s_nextafterl.c:1.3 src/lib/libm/src/s_nextafterl.c:1.4 --- src/lib/libm/src/s_nextafterl.c:1.3 Thu Feb 14 08:56:56 2013 +++ src/lib/libm/src/s_nextafterl.c Thu Jul 18 22:31:13 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: s_nextafterl.c,v 1.3 2013/02/14 08:56:56 matt Exp $ */ +/* $NetBSD: s_nextafterl.c,v 1.4 2013/07/18 22:31:13 matt Exp $ */ /* @(#)s_nextafter.c 5.1 93/09/24 */ /* @@ -13,12 +13,14 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: s_nextafterl.c,v 1.3 2013/02/14 08:56:56 matt Exp $); +__RCSID($NetBSD: s_nextafterl.c,v 1.4 2013/07/18 22:31:13 matt Exp $); #include float.h #include math.h #include machine/ieee.h +#ifdef __HAVE_LONG_DOUBLE + #ifdef EXT_EXP_INFNAN #if LDBL_MAX_EXP != 0x4000 #error Unsupported long double format @@ -98,3 +100,5 @@ nextafterl(long double x, long double y) return ux.extu_ld; } #endif + +#endif /* __HAVE_LONG_DOUBLE */
CVS commit: src/lib/libm/src
Module Name:src Committed By: matt Date: Thu Jul 18 22:32:53 UTC 2013 Modified Files: src/lib/libm/src: s_nextafter.c Log Message: If __HAVE_LONG_DOUBLE is not defined, add a strong alias for nextafterl to nextafter To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/s_nextafter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/src/s_nextafter.c diff -u src/lib/libm/src/s_nextafter.c:1.12 src/lib/libm/src/s_nextafter.c:1.13 --- src/lib/libm/src/s_nextafter.c:1.12 Mon Apr 18 15:59:09 2011 +++ src/lib/libm/src/s_nextafter.c Thu Jul 18 22:32:53 2013 @@ -12,7 +12,7 @@ #include sys/cdefs.h #if defined(LIBM_SCCS) !defined(lint) -__RCSID($NetBSD: s_nextafter.c,v 1.12 2011/04/18 15:59:09 drochner Exp $); +__RCSID($NetBSD: s_nextafter.c,v 1.13 2013/07/18 22:32:53 matt Exp $); #endif /* IEEE functions @@ -25,6 +25,10 @@ __RCSID($NetBSD: s_nextafter.c,v 1.12 2 #include math.h #include math_private.h +#ifndef __HAVE_LONG_DOUBLE +__strong_alias(nextafterl, nextafter) +#endif + double nextafter(double x, double y) {
CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 22:38:52 UTC 2013 Modified Files: src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h Log Message: Cleanup old cruft that wasn't working properly Adjust for supporting Coldfire processors (default them to softfloat). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.5 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.6 --- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.5 Sun Sep 25 13:33:43 2011 +++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h Thu Jul 18 22:38:52 2013 @@ -35,53 +35,39 @@ along with GCC; see the file COPYING3. } \ while (0) -/* Don't try using XFmode on the 68010. */ +/* Don't try using XFmode on the 68010 or coldfire. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE (TARGET_68020 ? 80 : 64) #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -#ifdef __mc68010__ +#if defined(__mc68010__) || defined(__mcoldfire__) #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 #else #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80 #endif +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS \ + { \ +if (TARGET_COLDFIRE) \ + { \ + target_flags |= MASK_STRICT_ALIGNMENT | MASK_CF_HWDIV; \ + if ((target_flags_explicit MASK_HARD_FLOAT) == 0) \ + { \ + target_flags = ~MASK_HARD_FLOAT; \ + m68k_fpu = FPUTYPE_NONE; \ + } \ + } \ + } #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ - { cpp_cpu_default_spec, CPP_CPU_DEFAULT_SPEC }, \ - { cpp_cpu_spec, CPP_CPU_SPEC }, \ - { cpp_fpu_spec, CPP_FPU_SPEC }, \ - { asm_default_spec, ASM_DEFAULT_SPEC }, \ { netbsd_cpp_spec, NETBSD_CPP_SPEC }, \ { netbsd_entry_point, NETBSD_ENTRY_POINT }, -#define CPP_CPU_SPEC \ - %{m68010:-D__mc68010__} \ - %{m68020:-D__mc68020__} \ - %{m68030:-D__mc68030__} \ - %{m68040:-D__mc68040__} \ - %(cpp_cpu_default_spec) - - #undef TARGET_VERSION -#if TARGET_DEFAULT MASK_68020 #define TARGET_VERSION fprintf (stderr, (NetBSD/m68k ELF)); -#define CPP_CPU_DEFAULT_SPEC %{!m680*:-D__mc68020__} -#define ASM_DEFAULT_SPEC %{!m680*:-m68020} -#else -#define TARGET_VERSION fprintf (stderr, (NetBSD/68010 ELF)); -#define CPP_CPU_DEFAULT_SPEC %{!m680*:-D__mc68010__} -#define ASM_DEFAULT_SPEC %{!m680*:-m68010} -#endif - - -#if TARGET_DEFAULT MASK_68881 -#define CPP_FPU_SPEC %{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} -#else -#define CPP_FPU_SPEC %{m68881:-D__HAVE_68881__ -D__HAVE_FPU__} -#endif /* Provide a CPP_SPEC appropriate for NetBSD m68k targets. Currently we @@ -90,7 +76,7 @@ along with GCC; see the file COPYING3. #undef CPP_SPEC #define CPP_SPEC \ - %(netbsd_cpp_spec) %(cpp_cpu_spec) %(cpp_fpu_spec) + %(netbsd_cpp_spec) /* Provide an ASM_SPEC appropriate for NetBSD m68k ELF targets. We need @@ -100,6 +86,8 @@ along with GCC; see the file COPYING3. #define ASM_SPEC \ %(asm_default_spec) \ %{m68010} %{m68020} %{m68030} %{m68040} %{m68060} \ +%{m5200} %{m5206e} %{m528x} %{m5307} %{m5407} %{mcfv4e}\ +%{mcpu=*:-mcpu=%*} %{march=*:-march=%*}\ %{fpic|fpie:-k} %{fPIC|fPIE:-k -K} #define AS_NEEDS_DASH_FOR_PIPED_INPUT @@ -123,7 +111,13 @@ along with GCC; see the file COPYING3. #define FUNCTION_PROFILER(FILE, LABELNO)\ do \ { \ -asm_fprintf (FILE, \tlea (%LLP%d,%Rpc),%Ra1\n, (LABELNO)); \ +if (TARGET_COLDFIRE) \ + { \ +asm_fprintf (FILE, \tmovea.l #%LLP%d-.,%Ra1\n, (LABELNO)); \ +asm_fprintf (FILE, \tlea (-6,%Rpc,%Ra1),%Ra1\n, (LABELNO)); \ + } \ +else\ + asm_fprintf (FILE, \tlea (%LLP%d,%Rpc),%Ra1\n, (LABELNO)); \ if (flag_pic) \ fprintf (FILE, \tbsr.l __mcount@PLTPC\n); \ else\
CVS commit: src/external/gpl3/gcc/lib/libgcc
Module Name:src Committed By: matt Date: Thu Jul 18 22:39:57 UTC 2013 Modified Files: src/external/gpl3/gcc/lib/libgcc: Makefile.inc Log Message: Don't emit _fix _floatun for coldfire To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gcc/lib/libgcc/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.19 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.20 --- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.19 Thu Feb 14 09:19:28 2013 +++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc Thu Jul 18 22:39:57 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.19 2013/02/14 09:19:28 matt Exp $ +# $NetBSD: Makefile.inc,v 1.20 2013/07/18 22:39:57 matt Exp $ .if ${MKGCC} != no LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH} @@ -46,6 +46,8 @@ LIB2FUNCS_ALL= \ _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3\ _divtc3 _bswapsi2 _bswapdi2 +.if ${MACHINE_ARCH} != coldfire + # non swfloat versions .for _p in _fix _fixuns . for _m in sf df xf tf @@ -62,6 +64,7 @@ LIB2FUNCS_ALL+= ${_p}di${_m} .for _m in sf df xf LIB2FUNCS_ALL+= _fixuns${_m}si .endfor +.endif LIB2FUNCS_SHORT:=${LIB2FUNCS_ALL} LIB2_DIVMOD_FUNCS:=${G_LIB2_DIVMOD_FUNCS}
CVS commit: src/external/lgpl3/gmp
Module Name:src Committed By: matt Date: Thu Jul 18 22:40:58 UTC 2013 Modified Files: src/external/lgpl3/gmp: Makefile.netbsd-gmp Log Message: default to MACHINE_GNU_PLATFORM so that when run with nbmake-foo the right thing happens To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/lgpl3/gmp/Makefile.netbsd-gmp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/lgpl3/gmp/Makefile.netbsd-gmp diff -u src/external/lgpl3/gmp/Makefile.netbsd-gmp:1.2 src/external/lgpl3/gmp/Makefile.netbsd-gmp:1.3 --- src/external/lgpl3/gmp/Makefile.netbsd-gmp:1.2 Tue Feb 5 02:54:01 2013 +++ src/external/lgpl3/gmp/Makefile.netbsd-gmp Thu Jul 18 22:40:58 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.netbsd-gmp,v 1.2 2013/02/05 02:54:01 matt Exp $ +# $NetBSD: Makefile.netbsd-gmp,v 1.3 2013/07/18 22:40:58 matt Exp $ # hack makefile to help build gmp ./configure @@ -6,7 +6,7 @@ CCADDFLAGS= --sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include -TARGET?=hppa-netbsd +TARGET?=${MACHINE_GNU_PLATFORM} #TARGET=mips64el-netbsd ENV_ARGS=\ CC=${CC:Q}' '${CCADDFLAGS:Q} \
CVS commit: src/common/lib/libc/arch/m68k
Module Name:src Committed By: matt Date: Thu Jul 18 22:42:51 UTC 2013 Modified Files: src/common/lib/libc/arch/m68k/gen: bswap16.S bswap32.S bswap64.S src/common/lib/libc/arch/m68k/string: bcmp.S bcopy.S bzero.S ffs.S memcmp.S memset.S strcmp.S strncmp.S strncpy.S Log Message: Adjust for Coldfire To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/gen/bswap16.S \ src/common/lib/libc/arch/m68k/gen/bswap32.S cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/gen/bswap64.S cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/string/bcmp.S \ src/common/lib/libc/arch/m68k/string/bcopy.S \ src/common/lib/libc/arch/m68k/string/bzero.S \ src/common/lib/libc/arch/m68k/string/ffs.S \ src/common/lib/libc/arch/m68k/string/memset.S \ src/common/lib/libc/arch/m68k/string/strcmp.S \ src/common/lib/libc/arch/m68k/string/strncmp.S cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/string/memcmp.S \ src/common/lib/libc/arch/m68k/string/strncpy.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/gen/bswap16.S diff -u src/common/lib/libc/arch/m68k/gen/bswap16.S:1.4 src/common/lib/libc/arch/m68k/gen/bswap16.S:1.5 --- src/common/lib/libc/arch/m68k/gen/bswap16.S:1.4 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/gen/bswap16.S Thu Jul 18 22:42:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bswap16.S,v 1.4 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: bswap16.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */ /* * Copyright (C) 1996 Scott Reynolds. All rights reserved. @@ -35,7 +35,20 @@ #endif /* defined(_KERNEL) || defined(_STANDALONE) */ _ENTRY(BSWAP16) +#ifdef __mcfisac__ + mvzw 6(%sp),%d0 + swap %d0 + byterev %d0 +#elif defined(__mcoldfire__) + mvzw 6(%sp),%d0 + movl %d0,%d1 + mvzb %d0,%d0 + lsll #8,%d0 + lsrl #8,%d1 + orl %d1,%d0 +#else movl 4(%sp),%d0 rolw #8,%d0 +#endif rts END(BSWAP16) Index: src/common/lib/libc/arch/m68k/gen/bswap32.S diff -u src/common/lib/libc/arch/m68k/gen/bswap32.S:1.4 src/common/lib/libc/arch/m68k/gen/bswap32.S:1.5 --- src/common/lib/libc/arch/m68k/gen/bswap32.S:1.4 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/gen/bswap32.S Thu Jul 18 22:42:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bswap32.S,v 1.4 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: bswap32.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */ /* * Copyright (C) 1996 Scott Reynolds. All rights reserved. @@ -36,8 +36,20 @@ _ENTRY(BSWAP32) movl 4(%sp),%d0 +#ifdef __mcfisac__ + byterev %d0 +#elif defined(__mcoldfire__) + movl %d0,%d1 + lsrl #8,%d0 | ABCD - 0ABC + andl #0x00ff00ff,%d0 | 0ABC - 0A0C + andl #0x00ff00ff,%d1 | ABCD - 0B0D + lsll #8,%d1 | 0B0D - B0D0 + orl %d1,%d0 | 0A0C | B0D0 - BADC + swap %d0 | BADC - DCBA +#else + rolw #8,%d0 + swap %d0 rolw #8,%d0 - swap %d0 - rolw #8,%d0 +#endif rts END(BSWAP32) Index: src/common/lib/libc/arch/m68k/gen/bswap64.S diff -u src/common/lib/libc/arch/m68k/gen/bswap64.S:1.3 src/common/lib/libc/arch/m68k/gen/bswap64.S:1.4 --- src/common/lib/libc/arch/m68k/gen/bswap64.S:1.3 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/gen/bswap64.S Thu Jul 18 22:42:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bswap64.S,v 1.3 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: bswap64.S,v 1.4 2013/07/18 22:42:50 matt Exp $ */ /* * Copyright (C) 1996 Scott Reynolds. All rights reserved. @@ -31,11 +31,34 @@ ENTRY(bswap64) movl 4(%sp),%d1 movl 8(%sp),%d0 +#ifdef __mcfisac__ + byterev %d0 + byterev %d1 +#elif defined(__mcoldfire__) + movl %d3,-(%sp) + movl %d2,-(%sp) + movl #0x00ff00ff, %d3 + movl %d0,%d2 + andl %d3,%d2 + lsll #8,%d2 + lsrl #8,%d0 + andl %d3,%d0 + orl %d2,%d0 + movl %d1,%d2 + andl %d3,%d2 + lsll #8,%d2 + lsrl #8,%d1 + andl %d3,%d1 + orl %d2,%d1 + movl (%sp)+,%d2 + movl (%sp)+,%d3 +#else rolw #8,%d1 rolw #8,%d0 swap %d1 swap %d0 rolw #8,%d0 rolw #8,%d1 +#endif rts END(bswap64) Index: src/common/lib/libc/arch/m68k/string/bcmp.S diff -u src/common/lib/libc/arch/m68k/string/bcmp.S:1.4 src/common/lib/libc/arch/m68k/string/bcmp.S:1.5 --- src/common/lib/libc/arch/m68k/string/bcmp.S:1.4 Tue Jul 16 23:24:19 2013 +++ src/common/lib/libc/arch/m68k/string/bcmp.S Thu Jul 18 22:42:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcmp.S,v 1.4 2013/07/16 23:24:19 matt Exp $ */ +/* $NetBSD: bcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -68,14 +68,27 @@ #if 0 RCSID(from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90) #else - RCSID($NetBSD: bcmp.S,v 1.4 2013/07/16 23:24:19 matt Exp $) + RCSID($NetBSD: bcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $) #endif #endif /* LIBC_SCCS and not lint */ +#ifdef __mcoldfire__ +#define CMPMB(a,b) movb b,%d2; cmpb a,%d2 +#define CMPMW(a,b) movw b,%d2; cmpw a,%d2 +#define CMPML(a,b) movl b,%d2; cmpl a,%d2 +#else +#define CMPMB(a,b) cmpmb a,b
CVS commit: src/lib/librumphijack
Module Name:src Committed By: pooka Date: Thu Jul 18 22:58:35 UTC 2013 Modified Files: src/lib/librumphijack: hijack.c hijackdlsym.c Log Message: sys/cdefs.h should come from rumpuser_port.h Noticed by Justin Cormack while building against musl libc. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/lib/librumphijack/hijack.c cvs rdiff -u -r1.3 -r1.4 src/lib/librumphijack/hijackdlsym.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumphijack/hijack.c diff -u src/lib/librumphijack/hijack.c:1.100 src/lib/librumphijack/hijack.c:1.101 --- src/lib/librumphijack/hijack.c:1.100 Tue Oct 16 12:56:10 2012 +++ src/lib/librumphijack/hijack.c Thu Jul 18 22:58:35 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: hijack.c,v 1.100 2012/10/16 12:56:10 pooka Exp $ */ +/* $NetBSD: hijack.c,v 1.101 2013/07/18 22:58:35 pooka Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -30,8 +30,9 @@ #include rumpuser_port.h -#include sys/cdefs.h -__RCSID($NetBSD: hijack.c,v 1.100 2012/10/16 12:56:10 pooka Exp $); +#if !defined(lint) +__RCSID($NetBSD: hijack.c,v 1.101 2013/07/18 22:58:35 pooka Exp $); +#endif #include sys/param.h #include sys/types.h Index: src/lib/librumphijack/hijackdlsym.c diff -u src/lib/librumphijack/hijackdlsym.c:1.3 src/lib/librumphijack/hijackdlsym.c:1.4 --- src/lib/librumphijack/hijackdlsym.c:1.3 Sat Aug 25 18:00:06 2012 +++ src/lib/librumphijack/hijackdlsym.c Thu Jul 18 22:58:35 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: hijackdlsym.c,v 1.3 2012/08/25 18:00:06 pooka Exp $ */ +/* $NetBSD: hijackdlsym.c,v 1.4 2013/07/18 22:58:35 pooka Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -27,8 +27,9 @@ #include rumpuser_port.h -#include sys/cdefs.h -__RCSID($NetBSD: hijackdlsym.c,v 1.3 2012/08/25 18:00:06 pooka Exp $); +#if !defined(lint) +__RCSID($NetBSD: hijackdlsym.c,v 1.4 2013/07/18 22:58:35 pooka Exp $); +#endif #include dlfcn.h
CVS commit: src/sys/dev/ic
Module Name:src Committed By: soren Date: Fri Jul 19 01:02:49 UTC 2013 Modified Files: src/sys/dev/ic: spdmem.c spdmemvar.h Log Message: Print the part number for DDR3 modules. Also closes PR kern/44665. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/spdmem.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/spdmemvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/spdmem.c diff -u src/sys/dev/ic/spdmem.c:1.7 src/sys/dev/ic/spdmem.c:1.8 --- src/sys/dev/ic/spdmem.c:1.7 Sat Oct 27 17:18:22 2012 +++ src/sys/dev/ic/spdmem.c Fri Jul 19 01:02:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: spdmem.c,v 1.7 2012/10/27 17:18:22 chs Exp $ */ +/* $NetBSD: spdmem.c,v 1.8 2013/07/19 01:02:49 soren Exp $ */ /* * Copyright (c) 2007 Nicolas Joly @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: spdmem.c,v 1.7 2012/10/27 17:18:22 chs Exp $); +__KERNEL_RCSID(0, $NetBSD: spdmem.c,v 1.8 2013/07/19 01:02:49 soren Exp $); #include sys/param.h #include sys/device.h @@ -259,19 +259,6 @@ spdmem_common_attach(struct spdmem_softc for (i = 3; i spd_len; i++) ((uint8_t *)s)[i] = (sc-sc_read)(sc, i); -#ifdef DEBUG - for (i = 0; i spd_len; i += 16) { - unsigned int j, k; - aprint_debug(\n); - aprint_debug_dev(self, 0x%02x:, i); - k = (spd_len i + 16) ? spd_len : i + 16; - for (j = i; j k; j++) - aprint_debug( %02x, ((uint8_t *)s)[j]); - } - aprint_debug(\n); - aprint_debug_dev(self, ); -#endif - /* * Setup our sysctl subtree, hw.spdmemN */ @@ -336,9 +323,6 @@ spdmem_common_attach(struct spdmem_softc } } - aprint_naive(\n); - aprint_normal(\n); - aprint_normal_dev(self, %s, type); strlcpy(sc-sc_type, type, SPDMEM_TYPE_MAXLEN); if (node != NULL) sysctl_createv(sc-sc_sysctl_log, 0, NULL, NULL, @@ -349,7 +333,9 @@ spdmem_common_attach(struct spdmem_softc CTL_HW, node-sysctl_num, CTL_CREATE, CTL_EOL); if (IS_RAMBUS_TYPE) { - aprint_normal(, SPD Revision %s, rambus_rev); + aprint_naive(\n); + aprint_normal(\n); + aprint_normal_dev(self, %s, SPD Revision %s, type, rambus_rev); dimm_size = 1 (s-sm_rdr.rdr_rows + s-sm_rdr.rdr_cols - 13); if (dimm_size = 1024) aprint_normal(, %dGB\n, dimm_size / 1024); @@ -384,6 +370,16 @@ spdmem_common_attach(struct spdmem_softc decode_fbdimm(node, self, s); break; } + + /* Dump SPD */ + for (i = 0; i spd_len; i += 16) { + unsigned int j, k; + aprint_debug_dev(self, 0x%02x:, i); + k = (spd_len (i + 16)) ? i + 16 : spd_len; + for (j = i; j k; j++) + aprint_debug( %02x, ((uint8_t *)s)[j]); + aprint_debug(\n); + } } int @@ -487,6 +483,10 @@ decode_voltage_refresh(device_t self, st static void decode_edofpm(const struct sysctlnode *node, device_t self, struct spdmem *s) { + aprint_naive(\n); + aprint_normal(\n); + aprint_normal_dev(self, %s, spdmem_basic_types[s-sm_type]); + aprint_normal(\n); aprint_verbose_dev(self, %d rows, %d cols, %d banks, %dns tRAC, %dns tCAC\n, @@ -496,6 +496,10 @@ decode_edofpm(const struct sysctlnode *n static void decode_rom(const struct sysctlnode *node, device_t self, struct spdmem *s) { + aprint_naive(\n); + aprint_normal(\n); + aprint_normal_dev(self, %s, spdmem_basic_types[s-sm_type]); + aprint_normal(\n); aprint_verbose_dev(self, %d rows, %d cols, %d banks\n, s-sm_rom.rom_rows, s-sm_rom.rom_cols, s-sm_rom.rom_banks); @@ -506,6 +510,10 @@ decode_sdram(const struct sysctlnode *no int spd_len) { int dimm_size, cycle_time, bits, tAA, i, speed, freq; + aprint_naive(\n); + aprint_normal(\n); + aprint_normal_dev(self, %s, spdmem_basic_types[s-sm_type]); + aprint_normal(%s, %s, , (s-sm_sdr.sdr_mod_attrs SPDMEM_SDR_MASK_REG)? (registered):, @@ -566,6 +574,10 @@ static void decode_ddr(const struct sysctlnode *node, device_t self, struct spdmem *s) { int dimm_size, cycle_time, bits, tAA, i; + aprint_naive(\n); + aprint_normal(\n); + aprint_normal_dev(self, %s, spdmem_basic_types[s-sm_type]); + aprint_normal(%s, %s, , (s-sm_ddr.ddr_mod_attrs SPDMEM_DDR_MASK_REG)? (registered):, @@ -610,6 +622,10 @@ static void decode_ddr2(const struct sysctlnode *node, device_t self, struct spdmem *s) { int dimm_size, cycle_time, bits, tAA, i; + aprint_naive(\n); + aprint_normal(\n); + aprint_normal_dev(self, %s, spdmem_basic_types[s-sm_type]); + aprint_normal(%s, %s, , (s-sm_ddr2.ddr2_mod_attrs SPDMEM_DDR2_MASK_REG)? (registered):, @@ -654,6 +670,10 @@ static void decode_ddr3(const struct sysctlnode *node, device_t self, struct spdmem *s) { int dimm_size, cycle_time, bits; + aprint_naive(\n); + aprint_normal(: %18s\n, s-sm_ddr3.ddr3_part); + aprint_normal_dev(self, %s, spdmem_basic_types[s-sm_type]); + if (s-sm_ddr3.ddr3_mod_type == SPDMEM_DDR3_TYPE_MINI_RDIMM || s-sm_ddr3.ddr3_mod_type == SPDMEM_DDR3_TYPE_RDIMM) @@ -705,6 +725,10 @@ static void
CVS commit: src/share/man/man4
Module Name:src Committed By: msaitoh Date: Fri Jul 19 03:29:35 UTC 2013 Modified Files: src/share/man/man4: ichsmb.4 Log Message: Update ichsmb(4) manual. We support both PCH and C6xx series, too. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/ichsmb.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/ichsmb.4 diff -u src/share/man/man4/ichsmb.4:1.2 src/share/man/man4/ichsmb.4:1.3 --- src/share/man/man4/ichsmb.4:1.2 Fri Jul 30 15:46:56 2010 +++ src/share/man/man4/ichsmb.4 Fri Jul 19 03:29:35 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: ichsmb.4,v 1.2 2010/07/30 15:46:56 njoly Exp $ +.\ $NetBSD: ichsmb.4,v 1.3 2013/07/19 03:29:35 msaitoh Exp $ .\ $OpenBSD: ichiic.4,v 1.10 2007/05/31 19:19:50 jmc Exp $ .\ .\ Copyright (c) 2005 Alexander Yurchenko gra...@openbsd.org @@ -15,20 +15,20 @@ .\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\ -.Dd July 30, 2010 +.Dd July 19, 2013 .Dt ICHSMB 4 .Os .Sh NAME .Nm ichsmb -.Nd Intel ICH SMBus controller +.Nd Intel Chipset internal SMBus controller .Sh SYNOPSIS .Cd ichsmb* at pci? .Cd iic* at ichsmb? .Sh DESCRIPTION The .Nm -driver provides support for the Intel ICH SMBus host interface to be -used with the +driver provides support for the Intel chipset internal SMBus host interface to +be used with the .Xr iic 4 framework. .Pp @@ -36,8 +36,13 @@ Supported chipsets: .Pp .Bl -bullet -compact -offset indent .It -Intel ICH, ICH2, ICH3, ICH4, ICH4-M, ICH5, ICH5R, ICH6, ICH6-M, ICH6R, ICH7, -ICH8, ICH9, ICH10, C-ICH, 6300ESB and 6321ESB. +ICH series. +.It +PCH series. +.It +63xxESB series. +.It +C6xx series. .El .Sh SEE ALSO .Xr iic 4 ,
CVS commit: src
Module Name:src Committed By: kefren Date: Fri Jul 19 04:00:40 UTC 2013 Modified Files: src/distrib/sets/lists/tests: mi src/etc/mtree: NetBSD.dist.tests src/tests/net: Makefile Added Files: src/tests/net/mpls: Makefile t_mpls_fw.sh Log Message: Add a couple of basic IP/MPLS forwarding tests To generate a diff of this commit: cvs rdiff -u -r1.539 -r1.540 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.96 -r1.97 src/etc/mtree/NetBSD.dist.tests cvs rdiff -u -r1.14 -r1.15 src/tests/net/Makefile cvs rdiff -u -r0 -r1.1 src/tests/net/mpls/Makefile \ src/tests/net/mpls/t_mpls_fw.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.539 src/distrib/sets/lists/tests/mi:1.540 --- src/distrib/sets/lists/tests/mi:1.539 Wed Jul 3 14:01:29 2013 +++ src/distrib/sets/lists/tests/mi Fri Jul 19 04:00:40 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.539 2013/07/03 14:01:29 nakayama Exp $ +# $NetBSD: mi,v 1.540 2013/07/19 04:00:40 kefren Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -2597,6 +2597,10 @@ ./usr/tests/net/if_loop/Atffile tests-net-tests atf,rump ./usr/tests/net/if_loop/Kyuafile tests-net-tests atf,rump,kyua ./usr/tests/net/if_loop/t_pr tests-net-tests atf,rump +./usr/tests/net/mplstests-net-tests +./usr/tests/net/mpls/Atffile tests-net-tests atf,rump +./usr/tests/net/mpls/Kyuafile tests-net-tests atf,rump,kyua +./usr/tests/net/mpls/t_mpls_fw tests-net-tests atf,rump ./usr/tests/net/nettests-net-tests ./usr/tests/net/net/Atffile tests-net-tests atf ./usr/tests/net/net/Kyuafile tests-net-tests atf,kyua Index: src/etc/mtree/NetBSD.dist.tests diff -u src/etc/mtree/NetBSD.dist.tests:1.96 src/etc/mtree/NetBSD.dist.tests:1.97 --- src/etc/mtree/NetBSD.dist.tests:1.96 Thu Mar 21 19:17:51 2013 +++ src/etc/mtree/NetBSD.dist.tests Fri Jul 19 04:00:40 2013 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.96 2013/03/21 19:17:51 christos Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.97 2013/07/19 04:00:40 kefren Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -302,6 +302,7 @@ ./usr/tests/net/icmp ./usr/tests/net/if ./usr/tests/net/if_loop +./usr/tests/net/mpls ./usr/tests/net/net ./usr/tests/net/npf ./usr/tests/net/route Index: src/tests/net/Makefile diff -u src/tests/net/Makefile:1.14 src/tests/net/Makefile:1.15 --- src/tests/net/Makefile:1.14 Wed Jul 3 14:01:29 2013 +++ src/tests/net/Makefile Fri Jul 19 04:00:40 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2013/07/03 14:01:29 nakayama Exp $ +# $NetBSD: Makefile,v 1.15 2013/07/19 04:00:40 kefren Exp $ .include bsd.own.mk @@ -6,7 +6,7 @@ TESTSDIR= ${TESTSBASE}/net TESTS_SUBDIRS= fdpass net route sys .if (${MKRUMP} != no) -TESTS_SUBDIRS+= bpf bpfilter carp icmp if if_loop npf +TESTS_SUBDIRS+= bpf bpfilter carp icmp if if_loop mpls npf .endif .include bsd.test.mk Added files: Index: src/tests/net/mpls/Makefile diff -u /dev/null src/tests/net/mpls/Makefile:1.1 --- /dev/null Fri Jul 19 04:00:40 2013 +++ src/tests/net/mpls/Makefile Fri Jul 19 04:00:40 2013 @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2013/07/19 04:00:40 kefren Exp $ +# + +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/net/mpls + +TESTS_SH= t_mpls_fw + +.include bsd.test.mk Index: src/tests/net/mpls/t_mpls_fw.sh diff -u /dev/null src/tests/net/mpls/t_mpls_fw.sh:1.1 --- /dev/null Fri Jul 19 04:00:40 2013 +++ src/tests/net/mpls/t_mpls_fw.sh Fri Jul 19 04:00:40 2013 @@ -0,0 +1,188 @@ +# $NetBSD: t_mpls_fw.sh,v 1.1 2013/07/19 04:00:40 kefren Exp $ +# +# Copyright (c) 2013 The NetBSD Foundation, Inc. +# 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
CVS commit: src/usr.bin/man
Module Name:src Committed By: uwe Date: Fri Jul 19 04:17:02 UTC 2013 Modified Files: src/usr.bin/man: Makefile Log Message: Use -Wno-format-nonliteral instead of blanket -Wno-format. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/man/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/Makefile diff -u src/usr.bin/man/Makefile:1.13 src/usr.bin/man/Makefile:1.14 --- src/usr.bin/man/Makefile:1.13 Thu Jul 18 16:28:52 2013 +++ src/usr.bin/man/Makefile Fri Jul 19 04:17:02 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2013/07/18 16:28:52 christos Exp $ +# $NetBSD: Makefile,v 1.14 2013/07/19 04:17:02 uwe Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 WARNS?= 6 @@ -7,7 +7,7 @@ PROG= man SRCS= man.c manconf.c MAN= man.1 man.conf.5 -COPTS.man.c += -Wno-format +COPTS.man.c += -Wno-format-nonliteral DPADD+= ${LIBUTIL} LDADD+= -lutil
CVS commit: src/usr.bin/man
Module Name:src Committed By: uwe Date: Fri Jul 19 04:18:10 UTC 2013 Modified Files: src/usr.bin/man: man.c Log Message: Fix manual_find_buildkeyword() to not use non-literal printf format. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.51 src/usr.bin/man/man.c:1.52 --- src/usr.bin/man/man.c:1.51 Thu Jul 18 16:33:31 2013 +++ src/usr.bin/man/man.c Fri Jul 19 04:18:10 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.51 2013/07/18 16:33:31 uwe Exp $ */ +/* $NetBSD: man.c,v 1.52 2013/07/19 04:18:10 uwe Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.51 2013/07/18 16:33:31 uwe Exp $); +__RCSID($NetBSD: man.c,v 1.52 2013/07/19 04:18:10 uwe Exp $); #endif #endif /* not lint */ @@ -465,7 +465,7 @@ main(int argc, char **argv) } static int -manual_find_buildkeyword(char *escpage, const char *fmt, +manual_find_buildkeyword(const char *prefix, const char *escpage, struct manstate *mp, glob_t *pg, size_t cnt) { ENTRY *suffix; @@ -483,7 +483,8 @@ manual_find_buildkeyword(char *escpage, continue; *p = '\0'; - (void)snprintf(buf, sizeof(buf), fmt, escpage, suffix-s); + (void)snprintf(buf, sizeof(buf), %s%s%s, + prefix, escpage, suffix-s); if (!fnmatch(buf, pg-gl_pathv[cnt], 0)) { if (!mp-where) build_page(p + 1, pg-gl_pathv[cnt], mp); @@ -563,7 +564,7 @@ manual(char *page, struct manstate *mp, for (cnt = pg-gl_pathc - pg-gl_matchc; cnt pg-gl_pathc; ++cnt) { - found = manual_find_buildkeyword(escpage, %s%s, + found = manual_find_buildkeyword(, escpage, mp, pg, cnt); if (found) { anyfound = 1; @@ -658,7 +659,7 @@ manual(char *page, struct manstate *mp, goto next; /* Try the _build key words next. */ - found = manual_find_buildkeyword(escpage, */%s%s, + found = manual_find_buildkeyword(*/, escpage, mp, pg, cnt); if (found) { next:anyfound = 1;
CVS commit: src/usr.bin/man
Module Name:src Committed By: uwe Date: Fri Jul 19 04:55:06 UTC 2013 Modified Files: src/usr.bin/man: man.c Log Message: manual_find_buildkeyword() - now that we control the format string, we may use asterisk precision specification instead of temporary modifying the _build string itself. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.52 src/usr.bin/man/man.c:1.53 --- src/usr.bin/man/man.c:1.52 Fri Jul 19 04:18:10 2013 +++ src/usr.bin/man/man.c Fri Jul 19 04:55:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.52 2013/07/19 04:18:10 uwe Exp $ */ +/* $NetBSD: man.c,v 1.53 2013/07/19 04:55:05 uwe Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.52 2013/07/19 04:18:10 uwe Exp $); +__RCSID($NetBSD: man.c,v 1.53 2013/07/19 04:55:05 uwe Exp $); #endif #endif /* not lint */ @@ -471,28 +471,26 @@ manual_find_buildkeyword(const char *pre ENTRY *suffix; int found; char *p, buf[MAXPATHLEN]; + int suflen; found = 0; /* Try the _build key words next. */ TAILQ_FOREACH(suffix, mp-buildlist-entrylist, q) { - for (p = suffix-s; + for (p = suffix-s, suflen = 0; *p != '\0' !isspace((unsigned char)*p); ++p) - continue; + ++suflen; if (*p == '\0') continue; - *p = '\0'; - (void)snprintf(buf, sizeof(buf), %s%s%s, - prefix, escpage, suffix-s); + (void)snprintf(buf, sizeof(buf), %s%s%.*s, + prefix, escpage, suflen, suffix-s); if (!fnmatch(buf, pg-gl_pathv[cnt], 0)) { if (!mp-where) build_page(p + 1, pg-gl_pathv[cnt], mp); - *p = ' '; found = 1; break; - } - *p = ' '; + } } return found;
CVS commit: src/usr.bin/man
Module Name:src Committed By: uwe Date: Fri Jul 19 04:59:46 UTC 2013 Modified Files: src/usr.bin/man: man.c Log Message: Spell keywords without space. Fix couple of typos. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.53 src/usr.bin/man/man.c:1.54 --- src/usr.bin/man/man.c:1.53 Fri Jul 19 04:55:05 2013 +++ src/usr.bin/man/man.c Fri Jul 19 04:59:46 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.53 2013/07/19 04:55:05 uwe Exp $ */ +/* $NetBSD: man.c,v 1.54 2013/07/19 04:59:46 uwe Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.53 2013/07/19 04:55:05 uwe Exp $); +__RCSID($NetBSD: man.c,v 1.54 2013/07/19 04:59:46 uwe Exp $); #endif #endif /* not lint */ @@ -474,7 +474,7 @@ manual_find_buildkeyword(const char *pre int suflen; found = 0; - /* Try the _build key words next. */ + /* Try the _build keywords next. */ TAILQ_FOREACH(suffix, mp-buildlist-entrylist, q) { for (p = suffix-s, suflen = 0; *p != '\0' !isspace((unsigned char)*p); @@ -631,11 +631,11 @@ manual(char *page, struct manstate *mp, } /* - * Try the _suffix key words first. + * Try the _suffix keywords first. * * XXX - * Older versions of man.conf didn't have the suffix - * key words, it was assumed that everything was a .0. + * Older versions of man.conf didn't have the _suffix + * keywords, it was assumed that everything was a .0. * We just test for .0 first, it's fast and probably * going to hit. */ @@ -656,7 +656,7 @@ manual(char *page, struct manstate *mp, if (found) goto next; - /* Try the _build key words next. */ + /* Try the _build keywords next. */ found = manual_find_buildkeyword(*/, escpage, mp, pg, cnt); if (found) { @@ -746,7 +746,7 @@ build_page(char *fmt, char **pathp, stru } - /* advance fmt pass the suffix spec to the printf format string */ + /* advance fmt past the suffix spec to the printf format string */ for (; *fmt isspace((unsigned char)*fmt); ++fmt) continue;
CVS commit: src/usr.bin/man
Module Name:src Committed By: uwe Date: Fri Jul 19 05:05:59 UTC 2013 Modified Files: src/usr.bin/man: man.c Log Message: Constify some more. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/usr.bin/man/man.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/man/man.c diff -u src/usr.bin/man/man.c:1.54 src/usr.bin/man/man.c:1.55 --- src/usr.bin/man/man.c:1.54 Fri Jul 19 04:59:46 2013 +++ src/usr.bin/man/man.c Fri Jul 19 05:05:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: man.c,v 1.54 2013/07/19 04:59:46 uwe Exp $ */ +/* $NetBSD: man.c,v 1.55 2013/07/19 05:05:59 uwe Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1987, 19 #if 0 static char sccsid[] = @(#)man.c 8.17 (Berkeley) 1/31/95; #else -__RCSID($NetBSD: man.c,v 1.54 2013/07/19 04:59:46 uwe Exp $); +__RCSID($NetBSD: man.c,v 1.55 2013/07/19 05:05:59 uwe Exp $); #endif #endif /* not lint */ @@ -109,11 +109,11 @@ struct manstate { /* * prototypes */ -static void build_page(char *, char **, struct manstate *); -static void cat(char *); +static void build_page(const char *, char **, struct manstate *); +static void cat(const char *); static const char *check_pager(const char *); static int cleanup(void); -static void how(char *); +static void how(const char *); static void jump(char **, const char *, const char *); static int manual(char *, struct manstate *, glob_t *); static void onsig(int); @@ -470,7 +470,8 @@ manual_find_buildkeyword(const char *pre { ENTRY *suffix; int found; - char *p, buf[MAXPATHLEN]; + char buf[MAXPATHLEN]; + const char *p; int suflen; found = 0; @@ -696,7 +697,7 @@ next:anyfound = 1; * Build a man page for display. */ static void -build_page(char *fmt, char **pathp, struct manstate *mp) +build_page(const char *fmt, char **pathp, struct manstate *mp) { static int warned; int olddir, fd, n; @@ -793,12 +794,13 @@ build_page(char *fmt, char **pathp, stru * display how information */ static void -how(char *fname) +how(const char *fname) { FILE *fp; int lcnt, print; - char *p, buf[256]; + char buf[256]; + const char *p; if (!(fp = fopen(fname, r))) { warn(%s, fname); @@ -840,7 +842,7 @@ how(char *fname) * cat out the file */ static void -cat(char *fname) +cat(const char *fname) { int fd; ssize_t n;