PERFORCE change 119971 for review
Rui Paulo
rpaulo at FreeBSD.org
Thu May 17 14:29:57 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119971
Change 119971 by rpaulo at rpaulo_epsilon on 2007/05/17 14:29:48
IFC
Affected files ...
.. //depot/projects/soc2007/rpaulo-macbook/amd64/linux32/linux32_sysvec.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/cam_periph.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/cam_xpt.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/cam_xpt.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_cd.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_ch.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_da.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_pass.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_pt.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_sa.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_ses.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_sg.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_targ_bh.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/compat/ia32/ia32_sysvec.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.amd64#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.arm#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.i386#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.ia64#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.pc98#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.powerpc#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.sparc64#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/Makefile.sun4v#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/NOTES#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/files#9 integrate
.. //depot/projects/soc2007/rpaulo-macbook/conf/options#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/acpica/acpi.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/acpica/acpi_hpet.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/acpica/acpivar.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bce.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bcefw.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bcereg.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/cardbus/cardbus.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/cardbus/cardbus_cis.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/ciss/ciss.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_80003es2lan.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_80003es2lan.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82540.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82541.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82541.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82542.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82543.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82543.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82571.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82571.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82575.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82575.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_api.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_api.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_defines.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_hw.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_ich8lan.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_ich8lan.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_mac.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_mac.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_manage.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_manage.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_nvm.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_nvm.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_osdep.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_phy.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_phy.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_regs.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/if_em.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/em/if_em.h#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp_freebsd.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/mfi/mfi.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/mfi/mfi_cam.c#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/dev/mfi/mfireg.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/mfi/mfivar.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/mmc/mmc.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/mmc/mmcsd.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/mmc/mmcvar.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/pccbb/pccbb.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/pci/pci.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/pci/pci_private.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/pci/pcireg.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/uart/uart_bus_pci.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_axe.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_cue.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_cuereg.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_kue.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_kuereg.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_rue.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_ruereg.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_udav.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/uhid.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/ukbd.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/ums.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/usb.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/usb_mem.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/geom/part/g_part.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/i386/Makefile#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/Make.tags.inc#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/imgact_elf.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/kern_exec.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/kern_exit.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/kern_mib.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/kern_resource.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/kern_timeout.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_domain.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_mbuf.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_sockbuf.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_socket.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_syscalls.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/modules/mfi/Makefile#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/modules/mfi/mfip/Makefile#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/modules/netgraph/Makefile#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/modules/netgraph/car/Makefile#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/net/ethernet.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/ieee8023ad_lacp.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/ieee8023ad_lacp.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/if.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/if.h#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/if_lagg.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/if_lagg.h#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/net/if_var.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netgraph/ng_car.c#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/netgraph/ng_car.h#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/netinet/ip_input.c#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp.h#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_asconf.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_auth.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_constants.h#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_indata.c#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_input.c#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_output.c#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_pcb.c#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_sysctl.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_timer.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_uio.h#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_usrreq.c#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/sctputil.c#6 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_input.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_reass.c#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_subr.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_timer.c#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_timer.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_timewait.c#1 branch
.. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_var.h#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet/udp_usrreq.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet6/ip6_input.c#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/netinet6/sctp6_usrreq.c#5 integrate
.. //depot/projects/soc2007/rpaulo-macbook/pc98/conf/GENERIC#3 integrate
.. //depot/projects/soc2007/rpaulo-macbook/sparc64/include/profile.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/sun4v/include/profile.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/sys/callout.h#2 integrate
.. //depot/projects/soc2007/rpaulo-macbook/sys/param.h#4 integrate
.. //depot/projects/soc2007/rpaulo-macbook/sys/sysent.h#2 integrate
Differences ...
==== //depot/projects/soc2007/rpaulo-macbook/amd64/linux32/linux32_sysvec.c#2 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.28 2007/04/02 18:38:12 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.29 2007/05/14 22:40:04 jhb Exp $");
#include "opt_compat.h"
#ifndef COMPAT_IA32
@@ -121,7 +121,7 @@
static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
static void exec_linux_setregs(struct thread *td, u_long entry,
u_long stack, u_long ps_strings);
-static void linux32_fixlimits(struct proc *p);
+static void linux32_fixlimit(struct rlimit *rl, int which);
extern LIST_HEAD(futex_list, futex) futex_list;
extern struct sx futex_sx;
@@ -965,42 +965,36 @@
SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFLAG_RW,
&linux32_maxvmem, 0, "");
-/*
- * XXX copied from ia32_sysvec.c.
- */
static void
-linux32_fixlimits(struct proc *p)
+linux32_fixlimit(struct rlimit *rl, int which)
{
- struct plimit *oldlim, *newlim;
- if (linux32_maxdsiz == 0 && linux32_maxssiz == 0 &&
- linux32_maxvmem == 0)
- return;
- newlim = lim_alloc();
- PROC_LOCK(p);
- oldlim = p->p_limit;
- lim_copy(newlim, oldlim);
- if (linux32_maxdsiz != 0) {
- if (newlim->pl_rlimit[RLIMIT_DATA].rlim_cur > linux32_maxdsiz)
- newlim->pl_rlimit[RLIMIT_DATA].rlim_cur = linux32_maxdsiz;
- if (newlim->pl_rlimit[RLIMIT_DATA].rlim_max > linux32_maxdsiz)
- newlim->pl_rlimit[RLIMIT_DATA].rlim_max = linux32_maxdsiz;
- }
- if (linux32_maxssiz != 0) {
- if (newlim->pl_rlimit[RLIMIT_STACK].rlim_cur > linux32_maxssiz)
- newlim->pl_rlimit[RLIMIT_STACK].rlim_cur = linux32_maxssiz;
- if (newlim->pl_rlimit[RLIMIT_STACK].rlim_max > linux32_maxssiz)
- newlim->pl_rlimit[RLIMIT_STACK].rlim_max = linux32_maxssiz;
- }
- if (linux32_maxvmem != 0) {
- if (newlim->pl_rlimit[RLIMIT_VMEM].rlim_cur > linux32_maxvmem)
- newlim->pl_rlimit[RLIMIT_VMEM].rlim_cur = linux32_maxvmem;
- if (newlim->pl_rlimit[RLIMIT_VMEM].rlim_max > linux32_maxvmem)
- newlim->pl_rlimit[RLIMIT_VMEM].rlim_max = linux32_maxvmem;
+ switch (which) {
+ case RLIMIT_DATA:
+ if (linux32_maxdsiz != 0) {
+ if (rl->rlim_cur > linux32_maxdsiz)
+ rl->rlim_cur = linux32_maxdsiz;
+ if (rl->rlim_max > linux32_maxdsiz)
+ rl->rlim_max = linux32_maxdsiz;
+ }
+ break;
+ case RLIMIT_STACK:
+ if (linux32_maxssiz != 0) {
+ if (rl->rlim_cur > linux32_maxssiz)
+ rl->rlim_cur = linux32_maxssiz;
+ if (rl->rlim_max > linux32_maxssiz)
+ rl->rlim_max = linux32_maxssiz;
+ }
+ break;
+ case RLIMIT_VMEM:
+ if (linux32_maxvmem != 0) {
+ if (rl->rlim_cur > linux32_maxvmem)
+ rl->rlim_cur = linux32_maxvmem;
+ if (rl->rlim_max > linux32_maxvmem)
+ rl->rlim_max = linux32_maxvmem;
+ }
+ break;
}
- p->p_limit = newlim;
- PROC_UNLOCK(p);
- lim_free(oldlim);
}
struct sysentvec elf_linux_sysvec = {
@@ -1029,7 +1023,7 @@
VM_PROT_ALL,
linux_copyout_strings,
exec_linux_setregs,
- linux32_fixlimits
+ linux32_fixlimit
};
static Elf32_Brandinfo linux_brand = {
==== //depot/projects/soc2007/rpaulo-macbook/cam/cam_periph.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.68 2007/04/19 23:34:51 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.69 2007/05/14 21:48:52 scottl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,7 +102,8 @@
int ndrivers;
ndrivers = nperiph_drivers + 2;
- newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_TEMP, M_WAITOK);
+ newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_CAMPERIPH,
+ M_WAITOK);
if (periph_drivers)
bcopy(periph_drivers, newdrivers,
sizeof(*newdrivers) * nperiph_drivers);
@@ -111,7 +112,7 @@
old = periph_drivers;
periph_drivers = newdrivers;
if (old)
- free(old, M_TEMP);
+ free(old, M_CAMPERIPH);
nperiph_drivers++;
}
==== //depot/projects/soc2007/rpaulo-macbook/cam/cam_xpt.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.183 2007/04/27 14:23:05 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.187 2007/05/16 16:57:21 scottl Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -1197,6 +1197,7 @@
error = ENOTSUP;
break;
}
+ xpt_release_bus(bus);
break;
}
/*
@@ -1533,7 +1534,7 @@
*/
xsoftc.xpt_config_hook =
(struct intr_config_hook *)malloc(sizeof(struct intr_config_hook),
- M_TEMP, M_NOWAIT | M_ZERO);
+ M_CAMXPT, M_NOWAIT | M_ZERO);
if (xsoftc.xpt_config_hook == NULL) {
printf("xpt_init: Cannot malloc config hook "
"- failing attach\n");
@@ -1542,7 +1543,7 @@
xsoftc.xpt_config_hook->ich_func = xpt_config;
if (config_intrhook_establish(xsoftc.xpt_config_hook) != 0) {
- free (xsoftc.xpt_config_hook, M_TEMP);
+ free (xsoftc.xpt_config_hook, M_CAMXPT);
printf("xpt_init: config_intrhook_establish failed "
"- failing attach\n");
}
@@ -4139,7 +4140,6 @@
void
xpt_print_path(struct cam_path *path)
{
- mtx_assert(path->bus->sim->mtx, MA_OWNED);
if (path == NULL)
printf("(nopath): ");
@@ -5243,7 +5243,7 @@
/* Save some state for use while we probe for devices */
scan_info = (xpt_scan_bus_info *)
- malloc(sizeof(xpt_scan_bus_info), M_TEMP, M_NOWAIT);
+ malloc(sizeof(xpt_scan_bus_info), M_CAMXPT, M_NOWAIT);
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;
@@ -5277,7 +5277,7 @@
printf("xpt_scan_bus: xpt_create_path failed"
" with status %#x, bus scan halted\n",
status);
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_free_ccb(work_ccb);
xpt_done(request_ccb);
@@ -5285,7 +5285,7 @@
}
work_ccb = xpt_alloc_ccb_nowait();
if (work_ccb == NULL) {
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
xpt_free_path(path);
request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
xpt_done(request_ccb);
@@ -5398,7 +5398,7 @@
xpt_free_ccb(request_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(request_ccb);
break;
@@ -5417,7 +5417,7 @@
xpt_free_ccb(request_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_done(request_ccb);
break;
@@ -5518,17 +5518,17 @@
}
if (request_ccb == NULL) {
- request_ccb = malloc(sizeof(union ccb), M_TEMP, M_NOWAIT);
+ request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_NOWAIT);
if (request_ccb == NULL) {
xpt_print(path, "xpt_scan_lun: can't allocate CCB, "
"can't continue\n");
return;
}
- new_path = malloc(sizeof(*new_path), M_TEMP, M_NOWAIT);
+ new_path = malloc(sizeof(*new_path), M_CAMXPT, M_NOWAIT);
if (new_path == NULL) {
xpt_print(path, "xpt_scan_lun: can't allocate path, "
"can't continue\n");
- free(request_ccb, M_TEMP);
+ free(request_ccb, M_CAMXPT);
return;
}
status = xpt_compile_path(new_path, xpt_periph,
@@ -5539,8 +5539,8 @@
if (status != CAM_REQ_CMP) {
xpt_print(path, "xpt_scan_lun: can't compile path, "
"can't continue\n");
- free(request_ccb, M_TEMP);
- free(new_path, M_TEMP);
+ free(request_ccb, M_CAMXPT);
+ free(new_path, M_CAMXPT);
return;
}
xpt_setup_ccb(&request_ccb->ccb_h, new_path, /*priority*/ 1);
@@ -5575,8 +5575,8 @@
xptscandone(struct cam_periph *periph, union ccb *done_ccb)
{
xpt_release_path(done_ccb->ccb_h.path);
- free(done_ccb->ccb_h.path, M_TEMP);
- free(done_ccb, M_TEMP);
+ free(done_ccb->ccb_h.path, M_CAMXPT);
+ free(done_ccb, M_CAMXPT);
}
static cam_status
@@ -5598,7 +5598,7 @@
return(CAM_REQ_CMP_ERR);
}
- softc = (probe_softc *)malloc(sizeof(*softc), M_TEMP, M_NOWAIT);
+ softc = (probe_softc *)malloc(sizeof(*softc), M_CAMXPT, M_NOWAIT);
if (softc == NULL) {
printf("proberegister: Unable to probe new device. "
@@ -5751,7 +5751,7 @@
if (softc->action == PROBE_INQUIRY_BASIC_DV1
|| softc->action == PROBE_INQUIRY_BASIC_DV2) {
- inq_buf = malloc(inquiry_len, M_TEMP, M_NOWAIT);
+ inq_buf = malloc(inquiry_len, M_CAMXPT, M_NOWAIT);
}
if (inq_buf == NULL) {
xpt_print(periph->path, "malloc failure- skipping Basic"
@@ -5785,7 +5785,7 @@
mode_buf_len = sizeof(struct scsi_mode_header_6)
+ sizeof(struct scsi_mode_blk_desc)
+ sizeof(struct scsi_control_page);
- mode_buf = malloc(mode_buf_len, M_TEMP, M_NOWAIT);
+ mode_buf = malloc(mode_buf_len, M_CAMXPT, M_NOWAIT);
if (mode_buf != NULL) {
scsi_mode_sense(csio,
/*retries*/4,
@@ -5817,7 +5817,7 @@
if ((device->quirk->quirks & CAM_QUIRK_NOSERIAL) == 0)
serial_buf = (struct scsi_vpd_unit_serial_number *)
- malloc(sizeof(*serial_buf), M_TEMP,
+ malloc(sizeof(*serial_buf), M_CAMXPT,
M_NOWAIT | M_ZERO);
if (serial_buf != NULL) {
@@ -6107,7 +6107,7 @@
/*count*/1, /*run_queue*/TRUE);
}
xpt_release_ccb(done_ccb);
- free(mode_hdr, M_TEMP);
+ free(mode_hdr, M_CAMXPT);
softc->action = PROBE_SERIAL_NUM;
xpt_schedule(periph, priority);
return;
@@ -6194,7 +6194,7 @@
xpt_async(AC_LOST_DEVICE, path, NULL);
}
if (serial_buf != NULL)
- free(serial_buf, M_TEMP);
+ free(serial_buf, M_CAMXPT);
if (changed != 0) {
/*
@@ -6283,12 +6283,12 @@
/* give up */
softc->action = PROBE_DV_EXIT;
}
- free(nbuf, M_TEMP);
+ free(nbuf, M_CAMXPT);
xpt_release_ccb(done_ccb);
xpt_schedule(periph, priority);
return;
}
- free(nbuf, M_TEMP);
+ free(nbuf, M_CAMXPT);
if (softc->action == PROBE_INQUIRY_BASIC_DV1) {
softc->action = PROBE_INQUIRY_BASIC_DV2;
xpt_release_ccb(done_ccb);
@@ -6327,7 +6327,7 @@
static void
probecleanup(struct cam_periph *periph)
{
- free(periph->softc, M_TEMP);
+ free(periph->softc, M_CAMXPT);
}
static void
@@ -6984,7 +6984,7 @@
/* Release our hook so that the boot can continue. */
config_intrhook_disestablish(xsoftc.xpt_config_hook);
- free(xsoftc.xpt_config_hook, M_TEMP);
+ free(xsoftc.xpt_config_hook, M_CAMXPT);
xsoftc.xpt_config_hook = NULL;
}
@@ -7029,6 +7029,39 @@
xpt_free_ccb(done_ccb);
}
+cam_status
+xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg,
+ struct cam_path *path)
+{
+ struct ccb_setasync csa;
+ cam_status status;
+ int xptpath = 0;
+
+ if (path == NULL) {
+ mtx_lock(&xsoftc.xpt_lock);
+ status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID,
+ CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
+ if (status != CAM_REQ_CMP) {
+ mtx_unlock(&xsoftc.xpt_lock);
+ return (status);
+ }
+ xptpath = 1;
+ }
+
+ xpt_setup_ccb(&csa.ccb_h, path, /*priority*/5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = event;
+ csa.callback = cbfunc;
+ csa.callback_arg = cbarg;
+ xpt_action((union ccb *)&csa);
+ status = csa.ccb_h.status;
+ if (xptpath) {
+ xpt_free_path(path);
+ mtx_unlock(&xsoftc.xpt_lock);
+ }
+ return (status);
+}
+
static void
xptaction(struct cam_sim *sim, union ccb *work_ccb)
{
==== //depot/projects/soc2007/rpaulo-macbook/cam/cam_xpt.h#2 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/cam/cam_xpt.h,v 1.8 2007/04/15 08:49:09 scottl Exp $
+ * $FreeBSD: src/sys/cam/cam_xpt.h,v 1.9 2007/05/16 16:54:23 scottl Exp $
*/
#ifndef _CAM_CAM_XPT_H
@@ -79,6 +79,8 @@
void xpt_rescan(union ccb *ccb);
void xpt_lock_buses(void);
void xpt_unlock_buses(void);
+cam_status xpt_register_async(int event, ac_callback_t *cbfunc,
+ void *cbarg, struct cam_path *path);
#endif /* _KERNEL */
#endif /* _CAM_CAM_XPT_H */
==== //depot/projects/soc2007/rpaulo-macbook/cam/scsi/scsi_cd.c#2 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.99 2007/04/16 19:41:14 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.101 2007/05/16 16:54:23 scottl Exp $");
#include "opt_cd.h"
@@ -329,11 +329,12 @@
static STAILQ_HEAD(changerlist, cdchanger) changerq;
static int num_changers;
+MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers");
+
static void
cdinit(void)
{
cam_status status;
- struct cam_path *path;
mtx_init(&changerq_mtx, "cdchangerq", "SCSI CD Changer List", MTX_DEF);
STAILQ_INIT(&changerq);
@@ -342,22 +343,8 @@
* Install a global async callback. This callback will
* receive async callbacks like "new device found".
*/
- status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID,
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
-
- if (status == CAM_REQ_CMP) {
- struct ccb_setasync csa;
+ status = xpt_register_async(AC_FOUND_DEVICE, cdasync, NULL, NULL);
- xpt_setup_ccb(&csa.ccb_h, path, /*priority*/5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = AC_FOUND_DEVICE;
- csa.callback = cdasync;
- csa.callback_arg = NULL;
- xpt_action((union ccb *)&csa);
- status = csa.ccb_h.status;
- xpt_free_path(path);
- }
-
if (status != CAM_REQ_CMP) {
printf("cd: Failed to attach master async callback "
"due to status 0x%x!\n", status);
@@ -368,20 +355,13 @@
cdoninvalidate(struct cam_periph *periph)
{
struct cd_softc *softc;
- struct ccb_setasync csa;
softc = (struct cd_softc *)periph->softc;
/*
* De-register any async callbacks.
*/
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = cdasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
+ xpt_register_async(0, cdasync, periph, periph->path);
softc->flags |= CD_FLAG_INVALID;
@@ -637,7 +617,6 @@
cdregister(struct cam_periph *periph, void *arg)
{
struct cd_softc *softc;
- struct ccb_setasync csa;
struct ccb_pathinq cpi;
struct ccb_getdev *cgd;
char tmpstr[80];
@@ -749,13 +728,8 @@
* Add an async callback so that we get
* notified if this device goes away.
*/
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE;
- csa.callback = cdasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
+ xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE,
+ cdasync, periph, periph->path);
/*
* If the target lun is greater than 0, we most likely have a CD
@@ -1519,7 +1493,7 @@
{
rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcap),
- M_TEMP,
+ M_SCSICD,
M_NOWAIT);
if (rcap == NULL) {
xpt_print(periph->path,
@@ -1778,7 +1752,7 @@
}
}
}
- free(rdcap, M_TEMP);
+ free(rdcap, M_SCSICD);
if (announce_buf[0] != '\0') {
xpt_announce_periph(periph, announce_buf);
if (softc->flags & CD_FLAG_CHANGER)
@@ -1906,7 +1880,7 @@
union cd_pages *page;
params.alloc_len = sizeof(union cd_mode_data_6_10);
- params.mode_buf = malloc(params.alloc_len, M_TEMP,
+ params.mode_buf = malloc(params.alloc_len, M_SCSICD,
M_WAITOK | M_ZERO);
cam_periph_lock(periph);
@@ -1915,7 +1889,7 @@
error = cdgetmode(periph, ¶ms, AUDIO_PAGE);
if (error) {
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -1924,7 +1898,7 @@
page->audio.flags &= ~CD_PA_SOTC;
page->audio.flags |= CD_PA_IMMED;
error = cdsetmode(periph, ¶ms);
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
if (error) {
cam_periph_unlock(periph);
break;
@@ -2001,7 +1975,7 @@
union cd_pages *page;
params.alloc_len = sizeof(union cd_mode_data_6_10);
- params.mode_buf = malloc(params.alloc_len, M_TEMP,
+ params.mode_buf = malloc(params.alloc_len, M_SCSICD,
M_WAITOK | M_ZERO);
cam_periph_lock(periph);
@@ -2010,7 +1984,7 @@
error = cdgetmode(periph, ¶ms, AUDIO_PAGE);
if (error) {
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2019,7 +1993,7 @@
page->audio.flags &= ~CD_PA_SOTC;
page->audio.flags |= CD_PA_IMMED;
error = cdsetmode(periph, ¶ms);
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
if (error) {
cam_periph_unlock(periph);
break;
@@ -2042,7 +2016,7 @@
union cd_pages *page;
params.alloc_len = sizeof(union cd_mode_data_6_10);
- params.mode_buf = malloc(params.alloc_len, M_TEMP,
+ params.mode_buf = malloc(params.alloc_len, M_SCSICD,
M_WAITOK | M_ZERO);
cam_periph_lock(periph);
@@ -2052,7 +2026,7 @@
error = cdgetmode(periph, ¶ms, AUDIO_PAGE);
if (error) {
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2061,7 +2035,7 @@
page->audio.flags &= ~CD_PA_SOTC;
page->audio.flags |= CD_PA_IMMED;
error = cdsetmode(periph, ¶ms);
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
if (error) {
cam_periph_unlock(periph);
break;
@@ -2081,7 +2055,7 @@
u_int32_t len = args->data_len;
data = malloc(sizeof(struct cd_sub_channel_info),
- M_TEMP, M_WAITOK);
+ M_SCSICD, M_WAITOK);
cam_periph_lock(periph);
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
@@ -2094,7 +2068,7 @@
"cdioreadsubchannel: error, len=%d\n",
len);
error = EINVAL;
- free(data, M_TEMP);
+ free(data, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2106,7 +2080,7 @@
args->data_format, args->track, data, len);
if (error) {
- free(data, M_TEMP);
+ free(data, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2124,7 +2098,7 @@
} else {
bcopy(data, args->data, len);
}
- free(data, M_TEMP);
+ free(data, M_SCSICD);
}
break;
@@ -2132,7 +2106,7 @@
{
struct ioc_toc_header *th;
- th = malloc(sizeof(struct ioc_toc_header), M_TEMP,
+ th = malloc(sizeof(struct ioc_toc_header), M_SCSICD,
M_WAITOK);
cam_periph_lock(periph);
@@ -2142,7 +2116,7 @@
error = cdreadtoc(periph, 0, 0, (u_int8_t *)th,
sizeof (*th), /*sense_flags*/0);
if (error) {
- free(th, M_TEMP);
+ free(th, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2156,7 +2130,7 @@
}
th->len = ntohs(th->len);
bcopy(th, addr, sizeof(*th));
- free(th, M_TEMP);
+ free(th, M_SCSICD);
cam_periph_unlock(periph);
}
break;
@@ -2170,8 +2144,8 @@
u_int32_t len, readlen, idx, num;
u_int32_t starting_track = te->starting_track;
- data = malloc(sizeof(*data), M_TEMP, M_WAITOK);
- lead = malloc(sizeof(*lead), M_TEMP, M_WAITOK);
+ data = malloc(sizeof(*data), M_SCSICD, M_WAITOK);
+ lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK);
cam_periph_lock(periph);
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
@@ -2184,8 +2158,8 @@
error = EINVAL;
printf("scsi_cd: error in readtocentries, "
"returning EINVAL\n");
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2194,8 +2168,8 @@
error = cdreadtoc(periph, 0, 0, (u_int8_t *)th,
sizeof (*th), /*sense_flags*/0);
if (error) {
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2217,8 +2191,8 @@
starting_track > th->ending_track + 1) {
printf("scsi_cd: error in readtocentries, "
"returning EINVAL\n");
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
cam_periph_unlock(periph);
error = EINVAL;
break;
@@ -2239,8 +2213,8 @@
printf("scsi_cd: error in readtocentries, "
"returning EINVAL\n");
error = EINVAL;
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2253,8 +2227,8 @@
readlen + sizeof (*th),
/*sense_flags*/0);
if (error) {
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2270,8 +2244,8 @@
sizeof(*lead),
/*sense_flags*/0);
if (error) {
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2287,8 +2261,8 @@
cam_periph_unlock(periph);
error = copyout(data->entries, te->data, len);
- free(data, M_TEMP);
- free(lead, M_TEMP);
+ free(data, M_SCSICD);
+ free(lead, M_SCSICD);
}
break;
case CDIOREADTOCENTRY:
@@ -2299,7 +2273,7 @@
struct ioc_toc_header *th;
u_int32_t track;
- data = malloc(sizeof(*data), M_TEMP, M_WAITOK);
+ data = malloc(sizeof(*data), M_SCSICD, M_WAITOK);
cam_periph_lock(periph);
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
@@ -2309,7 +2283,7 @@
&& te->address_format != CD_LBA_FORMAT) {
printf("error in readtocentry, "
" returning EINVAL\n");
- free(data, M_TEMP);
+ free(data, M_SCSICD);
error = EINVAL;
cam_periph_unlock(periph);
break;
@@ -2319,7 +2293,7 @@
error = cdreadtoc(periph, 0, 0, (u_int8_t *)th,
sizeof (*th), /*sense_flags*/0);
if (error) {
- free(data, M_TEMP);
+ free(data, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2341,7 +2315,7 @@
track > th->ending_track + 1) {
printf("error in readtocentry, "
" returning EINVAL\n");
- free(data, M_TEMP);
+ free(data, M_SCSICD);
error = EINVAL;
cam_periph_unlock(periph);
break;
@@ -2351,7 +2325,7 @@
(u_int8_t *)data, sizeof(*data),
/*sense_flags*/0);
if (error) {
- free(data, M_TEMP);
+ free(data, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2360,7 +2334,7 @@
data->entry.track = bcd2bin(data->entry.track);
bcopy(&data->entry, &te->entry,
sizeof(struct cd_toc_entry));
- free(data, M_TEMP);
+ free(data, M_SCSICD);
cam_periph_unlock(periph);
}
break;
@@ -2371,7 +2345,7 @@
union cd_pages *page;
params.alloc_len = sizeof(union cd_mode_data_6_10);
- params.mode_buf = malloc(params.alloc_len, M_TEMP,
+ params.mode_buf = malloc(params.alloc_len, M_SCSICD,
M_WAITOK | M_ZERO);
cam_periph_lock(periph);
@@ -2380,7 +2354,7 @@
error = cdgetmode(periph, ¶ms, AUDIO_PAGE);
if (error) {
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
cam_periph_unlock(periph);
break;
}
@@ -2393,7 +2367,7 @@
page->audio.port[2].channels = arg->patch[2];
page->audio.port[3].channels = arg->patch[3];
error = cdsetmode(periph, ¶ms);
- free(params.mode_buf, M_TEMP);
+ free(params.mode_buf, M_SCSICD);
cam_periph_unlock(periph);
}
break;
@@ -2404,7 +2378,7 @@
union cd_pages *page;
params.alloc_len = sizeof(union cd_mode_data_6_10);
- params.mode_buf = malloc(params.alloc_len, M_TEMP,
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list