head 1.7; access; symbols netbsd-10-0-RELEASE:1.7 netbsd-10-0-RC6:1.7 netbsd-10-0-RC5:1.7 netbsd-10-0-RC4:1.7 netbsd-10-0-RC3:1.7 netbsd-10-0-RC2:1.7 thorpej-ifq:1.7.0.62 thorpej-ifq-base:1.7 thorpej-altq-separation:1.7.0.60 thorpej-altq-separation-base:1.7 netbsd-10-0-RC1:1.7 netbsd-10:1.7.0.58 netbsd-10-base:1.7 bouyer-sunxi-drm:1.7.0.56 bouyer-sunxi-drm-base:1.7 netbsd-9-3-RELEASE:1.7 thorpej-i2c-spi-conf2:1.7.0.54 thorpej-i2c-spi-conf2-base:1.7 thorpej-futex2:1.7.0.52 thorpej-futex2-base:1.7 thorpej-cfargs2:1.7.0.50 thorpej-cfargs2-base:1.7 cjep_sun2x-base1:1.7 cjep_sun2x:1.7.0.48 cjep_sun2x-base:1.7 cjep_staticlib_x-base1:1.7 netbsd-9-2-RELEASE:1.7 cjep_staticlib_x:1.7.0.46 cjep_staticlib_x-base:1.7 thorpej-i2c-spi-conf:1.7.0.44 thorpej-i2c-spi-conf-base:1.7 thorpej-cfargs:1.7.0.42 thorpej-cfargs-base:1.7 thorpej-futex:1.7.0.40 thorpej-futex-base:1.7 netbsd-9-1-RELEASE:1.7 bouyer-xenpvh-base2:1.7 phil-wifi-20200421:1.7 bouyer-xenpvh-base1:1.7 phil-wifi-20200411:1.7 bouyer-xenpvh:1.7.0.38 bouyer-xenpvh-base:1.7 is-mlppp:1.7.0.36 is-mlppp-base:1.7 phil-wifi-20200406:1.7 netbsd-8-2-RELEASE:1.7 ad-namecache-base3:1.7 netbsd-9-0-RELEASE:1.7 netbsd-9-0-RC2:1.7 ad-namecache-base2:1.7 ad-namecache-base1:1.7 ad-namecache:1.7.0.34 ad-namecache-base:1.7 netbsd-9-0-RC1:1.7 phil-wifi-20191119:1.7 netbsd-9:1.7.0.32 netbsd-9-base:1.7 phil-wifi-20190609:1.7 netbsd-8-1-RELEASE:1.7 netbsd-8-1-RC1:1.7 isaki-audio2:1.7.0.30 isaki-audio2-base:1.7 pgoyette-compat-merge-20190127:1.7 pgoyette-compat-20190127:1.7 pgoyette-compat-20190118:1.7 pgoyette-compat-1226:1.7 pgoyette-compat-1126:1.7 pgoyette-compat-1020:1.7 pgoyette-compat-0930:1.7 pgoyette-compat-0906:1.7 netbsd-7-2-RELEASE:1.7 pgoyette-compat-0728:1.7 netbsd-8-0-RELEASE:1.7 phil-wifi:1.7.0.28 phil-wifi-base:1.7 pgoyette-compat-0625:1.7 netbsd-8-0-RC2:1.7 pgoyette-compat-0521:1.7 pgoyette-compat-0502:1.7 pgoyette-compat-0422:1.7 netbsd-8-0-RC1:1.7 pgoyette-compat-0415:1.7 pgoyette-compat-0407:1.7 pgoyette-compat-0330:1.7 pgoyette-compat-0322:1.7 pgoyette-compat-0315:1.7 netbsd-7-1-2-RELEASE:1.7 pgoyette-compat:1.7.0.26 pgoyette-compat-base:1.7 netbsd-7-1-1-RELEASE:1.7 tls-maxphys-base-20171202:1.7 matt-nb8-mediatek:1.7.0.24 matt-nb8-mediatek-base:1.7 nick-nhusb-base-20170825:1.7 perseant-stdc-iso10646:1.7.0.22 perseant-stdc-iso10646-base:1.7 netbsd-8:1.7.0.20 netbsd-8-base:1.7 prg-localcount2-base3:1.7 prg-localcount2-base2:1.7 prg-localcount2-base1:1.7 prg-localcount2:1.7.0.18 prg-localcount2-base:1.7 pgoyette-localcount-20170426:1.7 bouyer-socketcan-base1:1.7 jdolecek-ncq:1.7.0.16 jdolecek-ncq-base:1.7 pgoyette-localcount-20170320:1.7 netbsd-7-1:1.7.0.14 netbsd-7-1-RELEASE:1.7 netbsd-7-1-RC2:1.7 nick-nhusb-base-20170204:1.7 netbsd-7-nhusb-base-20170116:1.7 bouyer-socketcan:1.7.0.12 bouyer-socketcan-base:1.7 pgoyette-localcount-20170107:1.7 netbsd-7-1-RC1:1.7 nick-nhusb-base-20161204:1.7 pgoyette-localcount-20161104:1.7 netbsd-7-0-2-RELEASE:1.7 nick-nhusb-base-20161004:1.7 localcount-20160914:1.7 netbsd-7-nhusb:1.7.0.10 netbsd-7-nhusb-base:1.7 pgoyette-localcount-20160806:1.7 pgoyette-localcount-20160726:1.7 pgoyette-localcount:1.7.0.8 pgoyette-localcount-base:1.7 nick-nhusb-base-20160907:1.7 nick-nhusb-base-20160529:1.7 netbsd-7-0-1-RELEASE:1.7 nick-nhusb-base-20160422:1.7 nick-nhusb-base-20160319:1.7 nick-nhusb-base-20151226:1.7 netbsd-7-0:1.7.0.6 netbsd-7-0-RELEASE:1.7 nick-nhusb-base-20150921:1.7 netbsd-7-0-RC3:1.7 netbsd-7-0-RC2:1.7 netbsd-7-0-RC1:1.7 nick-nhusb-base-20150606:1.7 nick-nhusb-base-20150406:1.7 nick-nhusb:1.7.0.4 nick-nhusb-base:1.7 netbsd-6-0-6-RELEASE:1.4 netbsd-6-1-5-RELEASE:1.4 netbsd-7:1.7.0.2 netbsd-7-base:1.7 yamt-pagecache-base9:1.7 yamt-pagecache-tag8:1.4 netbsd-6-1-4-RELEASE:1.4 netbsd-6-0-5-RELEASE:1.4 tls-earlyentropy:1.5.0.2 tls-earlyentropy-base:1.7 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.5 riastradh-drm2-base3:1.5 netbsd-6-1-3-RELEASE:1.4 netbsd-6-0-4-RELEASE:1.4 netbsd-6-1-2-RELEASE:1.4 netbsd-6-0-3-RELEASE:1.4 rmind-smpnet-nbase:1.7 netbsd-6-1-1-RELEASE:1.4 riastradh-drm2-base2:1.4 riastradh-drm2-base1:1.4 riastradh-drm2:1.4.0.26 riastradh-drm2-base:1.4 rmind-smpnet:1.4.0.18 rmind-smpnet-base:1.7 netbsd-6-1:1.4.0.24 netbsd-6-0-2-RELEASE:1.4 netbsd-6-1-RELEASE:1.4 khorben-n900:1.4.0.22 netbsd-6-1-RC4:1.4 netbsd-6-1-RC3:1.4 agc-symver:1.4.0.20 agc-symver-base:1.4 netbsd-6-1-RC2:1.4 netbsd-6-1-RC1:1.4 yamt-pagecache-base8:1.4 netbsd-6-0-1-RELEASE:1.4 yamt-pagecache-base7:1.4 matt-nb6-plus-nbase:1.4 yamt-pagecache-base6:1.4 netbsd-6-0:1.4.0.16 netbsd-6-0-RELEASE:1.4 netbsd-6-0-RC2:1.4 tls-maxphys:1.4.0.14 tls-maxphys-base:1.7 matt-nb6-plus:1.4.0.12 matt-nb6-plus-base:1.4 netbsd-6-0-RC1:1.4 jmcneill-usbmp-base10:1.4 yamt-pagecache-base5:1.4 jmcneill-usbmp-base9:1.4 yamt-pagecache-base4:1.4 jmcneill-usbmp-base8:1.4 jmcneill-usbmp-base7:1.4 jmcneill-usbmp-base6:1.4 jmcneill-usbmp-base5:1.4 jmcneill-usbmp-base4:1.4 jmcneill-usbmp-base3:1.4 jmcneill-usbmp-pre-base2:1.4 jmcneill-usbmp-base2:1.4 netbsd-6:1.4.0.10 netbsd-6-base:1.4 jmcneill-usbmp:1.4.0.8 jmcneill-usbmp-base:1.4 jmcneill-audiomp3:1.4.0.6 jmcneill-audiomp3-base:1.4 yamt-pagecache-base3:1.4 yamt-pagecache-base2:1.4 yamt-pagecache:1.4.0.4 yamt-pagecache-base:1.4 rmind-uvmplock-nbase:1.4 cherry-xenmp:1.4.0.2 cherry-xenmp-base:1.4 bouyer-quota2-nbase:1.4 bouyer-quota2:1.3.0.14 bouyer-quota2-base:1.3 jruoho-x86intr:1.3.0.12 jruoho-x86intr-base:1.3 matt-mips64-premerge-20101231:1.3 uebayasi-xip-base4:1.3 uebayasi-xip-base3:1.3 yamt-nfs-mp-base11:1.3 uebayasi-xip-base2:1.3 yamt-nfs-mp-base10:1.3 uebayasi-xip-base1:1.3 rmind-uvmplock:1.3.0.10 rmind-uvmplock-base:1.4 yamt-nfs-mp-base9:1.3 uebayasi-xip:1.3.0.8 uebayasi-xip-base:1.3 matt-premerge-20091211:1.3 yamt-nfs-mp-base8:1.3 yamt-nfs-mp-base7:1.3 jymxensuspend-base:1.3 yamt-nfs-mp-base6:1.3 yamt-nfs-mp-base5:1.3 yamt-nfs-mp-base4:1.3 jym-xensuspend-base:1.3 jym-xensuspend:1.3.0.6 jym-xensuspend-nbase:1.3 yamt-nfs-mp:1.3.0.4 yamt-nfs-mp-base3:1.3 nick-hppapmap-base4:1.3 nick-hppapmap-base:1.3 nick-hppapmap:1.3.0.2 nick-hppapmap-base3:1.3; locks; strict; comment @ * @; 1.7 date 2014.04.12.19.25.48; author jakllsch; state Exp; branches; next 1.6; commitid CqbkrZcSUaYECqwx; 1.6 date 2014.04.12.19.01.49; author jakllsch; state Exp; branches; next 1.5; commitid wBUbZexXQraMsqwx; 1.5 date 2013.11.24.21.58.38; author rmind; state Exp; branches 1.5.2.1; next 1.4; commitid wLqYNyBFUwYHVzex; 1.4 date 2011.02.20.10.24.45; author hannken; state Exp; branches 1.4.4.1 1.4.14.1 1.4.18.1; next 1.3; 1.3 date 2009.03.09.06.07.05; author mrg; state Exp; branches 1.3.2.1 1.3.4.1 1.3.6.1 1.3.10.1 1.3.12.1 1.3.14.1; next 1.2; 1.2 date 2009.03.08.11.40.00; author mrg; state Exp; branches; next 1.1; 1.1 date 2009.03.07.22.02.17; author ad; state Exp; branches; next ; 1.5.2.1 date 2014.08.10.06.54.38; author tls; state Exp; branches; next ; commitid eWVh1fm0pgoVBMLx; 1.4.4.1 date 2014.05.22.11.40.19; author yamt; state Exp; branches; next ; commitid VUUXuyNWnt3AKwBx; 1.4.14.1 date 2014.08.20.00.03.35; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; 1.4.18.1 date 2014.05.18.17.45.34; author rmind; state Exp; branches; next ; commitid mL5ZYSzpqK6QS2Bx; 1.3.2.1 date 2009.03.09.06.07.05; author skrll; state dead; branches; next 1.3.2.2; 1.3.2.2 date 2009.04.28.07.35.12; author skrll; state Exp; branches; next ; 1.3.4.1 date 2009.03.09.06.07.05; author yamt; state dead; branches; next 1.3.4.2; 1.3.4.2 date 2009.05.04.08.12.32; author yamt; state Exp; branches; next ; 1.3.6.1 date 2009.03.09.06.07.05; author jym; state dead; branches; next 1.3.6.2; 1.3.6.2 date 2009.05.13.17.19.04; author jym; state Exp; branches; next ; 1.3.10.1 date 2011.03.05.20.52.58; author rmind; state Exp; branches; next ; 1.3.12.1 date 2011.06.06.09.07.37; author jruoho; state Exp; branches; next ; 1.3.14.1 date 2011.03.05.15.10.15; author bouyer; state Exp; branches; next ; desc @@ 1.7 log @Make this build. Hi jakllsch@@. @ text @/* $NetBSD: db_cpu.c,v 1.6 2014/04/12 19:01:49 jakllsch Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Andrew Doran. * * 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. */ #include __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.6 2014/04/12 19:01:49 jakllsch Exp $"); #ifndef _KERNEL #include #endif #include #include #include #include static int db_ncpu; static struct cpu_info **db_cpu_infos; static void db_cpu_init(void) { db_expr_t addr; db_value_of_name("ncpu", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_ncpu), (char *)&db_ncpu); db_value_of_name("cpu_infos", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_cpu_infos), (char *)&db_cpu_infos); } static struct cpu_info * db_cpu_by_index(u_int idx) { struct cpu_info *ci; db_read_bytes((db_addr_t)&db_cpu_infos[idx], sizeof(ci), (char *)&ci); return ci; } struct cpu_info * db_cpu_first(void) { db_cpu_init(); return db_cpu_by_index(0); } struct cpu_info * db_cpu_next(struct cpu_info *ci) { u_int idx; db_read_bytes((db_addr_t)&ci->ci_index, sizeof(idx), (char *)&idx); if ((idx + 1) >= (u_int)db_ncpu) return NULL; return db_cpu_by_index(idx + 1); } @ 1.6 log @Unbreak db_cpu_*. Allows backtraces on i386 to progress beyond the first function by not doing a NULL-deref in the debugger. Bug located by me. Patch implementation by riastradh@@. Hi rmind@@. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.5 2013/11/24 21:58:38 rmind Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.5 2013/11/24 21:58:38 rmind Exp $"); d84 1 a84 1 if ((idx + 1) >= ncpu) @ 1.5 log @Remove cpu_queue (and thus eleminate another use of CIRCLEQ) by replacing its uses with cpu_infos array. Extra testing by christos@@. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $"); d45 15 a59 1 static struct cpu_info **cpu_info_addr; d62 1 a62 1 db_cpu_index(u_int idx) a63 1 db_addr_t slot_addr = (db_addr_t)(cpu_info_addr + idx); d66 1 a66 1 db_read_bytes(slot_addr, sizeof(ci), (char *)&ci); d73 3 a75 2 db_value_of_name("cpu_infos", (db_expr_t *)&cpu_info_addr); return db_cpu_index(0); d84 3 a86 1 return db_cpu_index(idx + 1); @ 1.5.2.1 log @Rebase. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.7 2014/04/12 19:25:48 jakllsch Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.7 2014/04/12 19:25:48 jakllsch Exp $"); d45 1 a45 15 static int db_ncpu; static struct cpu_info **db_cpu_infos; static void db_cpu_init(void) { db_expr_t addr; db_value_of_name("ncpu", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_ncpu), (char *)&db_ncpu); db_value_of_name("cpu_infos", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_cpu_infos), (char *)&db_cpu_infos); } d48 1 a48 1 db_cpu_by_index(u_int idx) d50 1 d53 1 a53 1 db_read_bytes((db_addr_t)&db_cpu_infos[idx], sizeof(ci), (char *)&ci); d60 2 a61 3 db_cpu_init(); return db_cpu_by_index(0); d70 1 a70 3 if ((idx + 1) >= (u_int)db_ncpu) return NULL; return db_cpu_by_index(idx + 1); @ 1.4 log @When looking for the next element of cpu_queue compare the pointer to the address of the head, not to the head itself. Not sure if the cast of the arg to db_value_name() is right, but works on i386 and compiles on sparc64. Stack traces from ddb work again on i386. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $"); d45 11 a55 2 static struct cpu_info *head; static void *head_addr; d60 2 a61 4 head = db_read_ptr("cpu_queue"); (void) db_value_of_name("cpu_queue", (db_expr_t *)&head_addr); return head; d67 1 d69 2 a70 6 db_read_bytes((db_addr_t)&ci->ci_data.cpu_qchain.cqe_next, sizeof(ci), (char *)&ci); if (ci == head_addr) { ci = NULL; } return ci; @ 1.4.14.1 log @Rebase to HEAD as of a few days ago. @ text @d1 1 a1 1 /* $NetBSD$ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD$"); d45 2 a46 24 static int db_ncpu; static struct cpu_info **db_cpu_infos; static void db_cpu_init(void) { db_expr_t addr; db_value_of_name("ncpu", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_ncpu), (char *)&db_ncpu); db_value_of_name("cpu_infos", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_cpu_infos), (char *)&db_cpu_infos); } static struct cpu_info * db_cpu_by_index(u_int idx) { struct cpu_info *ci; db_read_bytes((db_addr_t)&db_cpu_infos[idx], sizeof(ci), (char *)&ci); return ci; } d52 3 a54 2 db_cpu_init(); return db_cpu_by_index(0); a59 1 u_int idx; d61 6 a66 4 db_read_bytes((db_addr_t)&ci->ci_index, sizeof(idx), (char *)&idx); if ((idx + 1) >= (u_int)db_ncpu) return NULL; return db_cpu_by_index(idx + 1); @ 1.4.4.1 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $"); d45 2 a46 24 static int db_ncpu; static struct cpu_info **db_cpu_infos; static void db_cpu_init(void) { db_expr_t addr; db_value_of_name("ncpu", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_ncpu), (char *)&db_ncpu); db_value_of_name("cpu_infos", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_cpu_infos), (char *)&db_cpu_infos); } static struct cpu_info * db_cpu_by_index(u_int idx) { struct cpu_info *ci; db_read_bytes((db_addr_t)&db_cpu_infos[idx], sizeof(ci), (char *)&ci); return ci; } d52 3 a54 2 db_cpu_init(); return db_cpu_by_index(0); a59 1 u_int idx; d61 6 a66 4 db_read_bytes((db_addr_t)&ci->ci_index, sizeof(idx), (char *)&idx); if ((idx + 1) >= (u_int)db_ncpu) return NULL; return db_cpu_by_index(idx + 1); @ 1.4.18.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $"); d45 2 a46 24 static int db_ncpu; static struct cpu_info **db_cpu_infos; static void db_cpu_init(void) { db_expr_t addr; db_value_of_name("ncpu", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_ncpu), (char *)&db_ncpu); db_value_of_name("cpu_infos", &addr); db_read_bytes((db_addr_t)addr, sizeof(db_cpu_infos), (char *)&db_cpu_infos); } static struct cpu_info * db_cpu_by_index(u_int idx) { struct cpu_info *ci; db_read_bytes((db_addr_t)&db_cpu_infos[idx], sizeof(ci), (char *)&ci); return ci; } d52 3 a54 2 db_cpu_init(); return db_cpu_by_index(0); a59 1 u_int idx; d61 6 a66 4 db_read_bytes((db_addr_t)&ci->ci_index, sizeof(idx), (char *)&idx); if ((idx + 1) >= (u_int)db_ncpu) return NULL; return db_cpu_by_index(idx + 1); @ 1.3 log @include if not _KERNEL, and don't include kauth.h if _KERNEL. now crash builds on i386. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.2 2009/03/08 11:40:00 mrg Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.2 2009/03/08 11:40:00 mrg Exp $"); d46 1 d53 1 d63 1 a63 1 if (ci == head) { @ 1.3.12.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $"); a45 1 static void *head_addr; a51 1 (void) db_value_of_name("cpu_queue", (db_expr_t *)&head_addr); d61 1 a61 1 if (ci == head_addr) { @ 1.3.10.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD$ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD$"); a45 1 static void *head_addr; a51 1 (void) db_value_of_name("cpu_queue", (db_expr_t *)&head_addr); d61 1 a61 1 if (ci == head_addr) { @ 1.3.14.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d33 1 a33 1 __KERNEL_RCSID(0, "$NetBSD$"); a45 1 static void *head_addr; a51 1 (void) db_value_of_name("cpu_queue", (db_expr_t *)&head_addr); d61 1 a61 1 if (ci == head_addr) { @ 1.3.6.1 log @file db_cpu.c was added on branch jym-xensuspend on 2009-05-13 17:19:04 +0000 @ text @d1 65 @ 1.3.6.2 log @Sync with HEAD. Commit is split, to avoid a "too many arguments" protocol error. @ text @a0 65 /* $NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Andrew Doran. * * 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. */ #include __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $"); #ifndef _KERNEL #include #endif #include #include #include #include static struct cpu_info *head; struct cpu_info * db_cpu_first(void) { head = db_read_ptr("cpu_queue"); return head; } struct cpu_info * db_cpu_next(struct cpu_info *ci) { db_read_bytes((db_addr_t)&ci->ci_data.cpu_qchain.cqe_next, sizeof(ci), (char *)&ci); if (ci == head) { ci = NULL; } return ci; } @ 1.3.4.1 log @file db_cpu.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:32 +0000 @ text @d1 65 @ 1.3.4.2 log @sync with head. @ text @a0 65 /* $NetBSD$ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Andrew Doran. * * 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. */ #include __KERNEL_RCSID(0, "$NetBSD$"); #ifndef _KERNEL #include #endif #include #include #include #include static struct cpu_info *head; struct cpu_info * db_cpu_first(void) { head = db_read_ptr("cpu_queue"); return head; } struct cpu_info * db_cpu_next(struct cpu_info *ci) { db_read_bytes((db_addr_t)&ci->ci_data.cpu_qchain.cqe_next, sizeof(ci), (char *)&ci); if (ci == head) { ci = NULL; } return ci; } @ 1.3.2.1 log @file db_cpu.c was added on branch nick-hppapmap on 2009-04-28 07:35:12 +0000 @ text @d1 65 @ 1.3.2.2 log @Sync with HEAD. @ text @a0 65 /* $NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Andrew Doran. * * 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. */ #include __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $"); #ifndef _KERNEL #include #endif #include #include #include #include static struct cpu_info *head; struct cpu_info * db_cpu_first(void) { head = db_read_ptr("cpu_queue"); return head; } struct cpu_info * db_cpu_next(struct cpu_info *ci) { db_read_bytes((db_addr_t)&ci->ci_data.cpu_qchain.cqe_next, sizeof(ci), (char *)&ci); if (ci == head) { ci = NULL; } return ci; } @ 1.2 log @include ddb headers *after* sys/types.h or sys/param.h. @ text @d1 1 a1 1 /* $NetBSD: db_cpu.c,v 1.1 2009/03/07 22:02:17 ad Exp $ */ d33 5 a37 1 __KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.1 2009/03/07 22:02:17 ad Exp $"); @ 1.1 log @Make ddb compile and work in userspace. Mostly this is comprised of three types of changes: - Add a few new methods to replace stuff like p_find(), CPU_INFO_FOREACH. - Use db_read_bytes() instead of accessing kernel structures directly, and similar changes. - Add ifdef _KERNEL where the above hasn't been done, and an XXX comment. @ text @d1 1 a1 1 /* $NetBSD$ */ d33 1 a33 3 __KERNEL_RCSID(0, "$NetBSD$"); #include d39 2 @