PERFORCE change 94323 for review
Marcel Moolenaar
marcel at FreeBSD.org
Thu Mar 30 20:39:21 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94323
Change 94323 by marcel at marcel_nfs on 2006/03/30 20:38:33
IFC @94319
Affected files ...
.. //depot/projects/uart/compat/freebsd32/freebsd32_misc.c#14 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_proto.h#14 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_syscall.h#14 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_syscalls.c#14 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_sysent.c#14 integrate
.. //depot/projects/uart/compat/freebsd32/syscalls.master#13 integrate
.. //depot/projects/uart/conf/NOTES#32 integrate
.. //depot/projects/uart/conf/files#54 integrate
.. //depot/projects/uart/dev/acpica/Osd/OsdSchedule.c#10 integrate
.. //depot/projects/uart/dev/ata/atapi-fd.c#11 integrate
.. //depot/projects/uart/dev/pccbb/pccbb.c#16 integrate
.. //depot/projects/uart/dev/pccbb/pccbbreg.h#7 integrate
.. //depot/projects/uart/dev/puc/puc_ebus.c#12 integrate
.. //depot/projects/uart/dev/puc/puc_sbus.c#13 integrate
.. //depot/projects/uart/dev/scc/scc_bfe.h#14 integrate
.. //depot/projects/uart/dev/scc/scc_bfe_ebus.c#5 integrate
.. //depot/projects/uart/dev/scc/scc_bfe_sbus.c#4 integrate
.. //depot/projects/uart/dev/scc/scc_bus.h#8 integrate
.. //depot/projects/uart/dev/scc/scc_core.c#18 integrate
.. //depot/projects/uart/dev/scc/scc_dev_sab82532.c#7 integrate
.. //depot/projects/uart/dev/scc/scc_dev_z8530.c#9 integrate
.. //depot/projects/uart/dev/scc/scc_if.m#7 integrate
.. //depot/projects/uart/dev/sound/pcm/dsp.c#13 integrate
.. //depot/projects/uart/dev/uart/uart_bus.h#44 integrate
.. //depot/projects/uart/dev/uart/uart_bus_scc.c#8 integrate
.. //depot/projects/uart/dev/uart/uart_core.c#52 integrate
.. //depot/projects/uart/dev/uart/uart_cpu.h#18 integrate
.. //depot/projects/uart/dev/uart/uart_dev_ns8250.c#38 integrate
.. //depot/projects/uart/dev/uart/uart_dev_sab82532.c#40 integrate
.. //depot/projects/uart/dev/uart/uart_dev_z8530.c#28 integrate
.. //depot/projects/uart/dev/uart/uart_tty.c#28 integrate
.. //depot/projects/uart/geom/eli/g_eli.h#3 integrate
.. //depot/projects/uart/geom/mirror/g_mirror.c#13 integrate
.. //depot/projects/uart/geom/vinum/geom_vinum.c#7 integrate
.. //depot/projects/uart/geom/vinum/geom_vinum.h#6 integrate
.. //depot/projects/uart/geom/vinum/geom_vinum_rm.c#6 integrate
.. //depot/projects/uart/geom/vinum/geom_vinum_state.c#4 integrate
.. //depot/projects/uart/geom/vinum/geom_vinum_subr.c#5 integrate
.. //depot/projects/uart/kern/md5c.c#6 integrate
.. //depot/projects/uart/kern/serdev_if.m#4 integrate
.. //depot/projects/uart/kern/subr_turnstile.c#6 integrate
.. //depot/projects/uart/kern/sysv_shm.c#11 integrate
.. //depot/projects/uart/modules/Makefile#30 integrate
.. //depot/projects/uart/modules/scc/Makefile#2 integrate
.. //depot/projects/uart/modules/uart/Makefile#15 integrate
.. //depot/projects/uart/net/if_ppp.c#8 integrate
.. //depot/projects/uart/netipsec/xform.h#3 integrate
.. //depot/projects/uart/netipsec/xform_ipip.c#5 integrate
.. //depot/projects/uart/sparc64/conf/GENERIC#17 integrate
.. //depot/projects/uart/sys/serial.h#6 integrate
.. //depot/projects/uart/sys/sx.h#5 integrate
Differences ...
==== //depot/projects/uart/compat/freebsd32/freebsd32_misc.c#14 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.53 2006/03/08 20:21:53 ups Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.54 2006/03/30 07:42:32 ps Exp $");
#include "opt_compat.h"
@@ -69,6 +69,8 @@
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/wait.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@@ -1365,10 +1367,170 @@
int
freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap)
{
- /*
- * Vector through to shmsys if it is loaded.
- */
- return sysent[SYS_shmsys].sy_call(td, uap);
+
+ switch (uap->which) {
+ case 0: { /* shmat */
+ struct shmat_args ap;
+
+ ap.shmid = uap->a2;
+ ap.shmaddr = PTRIN(uap->a3);
+ ap.shmflg = uap->a4;
+ return (sysent[SYS_shmat].sy_call(td, &ap));
+ }
+ case 2: { /* shmdt */
+ struct shmdt_args ap;
+
+ ap.shmaddr = PTRIN(uap->a2);
+ return (sysent[SYS_shmdt].sy_call(td, &ap));
+ }
+ case 3: { /* shmget */
+ struct shmget_args ap;
+
+ ap.key = uap->a2;
+ ap.size = uap->a3;
+ ap.shmflg = uap->a4;
+ return (sysent[SYS_shmget].sy_call(td, &ap));
+ }
+ case 4: { /* shmctl */
+ struct freebsd32_shmctl_args ap;
+
+ ap.shmid = uap->a2;
+ ap.cmd = uap->a3;
+ ap.buf = PTRIN(uap->a4);
+ return (freebsd32_shmctl(td, &ap));
+ }
+ case 1: /* oshmctl */
+ default:
+ return (EINVAL);
+ }
+}
+
+struct ipc_perm32 {
+ uint16_t cuid;
+ uint16_t cgid;
+ uint16_t uid;
+ uint16_t gid;
+ uint16_t mode;
+ uint16_t seq;
+ uint32_t key;
+};
+struct shmid_ds32 {
+ struct ipc_perm32 shm_perm;
+ int32_t shm_segsz;
+ int32_t shm_lpid;
+ int32_t shm_cpid;
+ int16_t shm_nattch;
+ int32_t shm_atime;
+ int32_t shm_dtime;
+ int32_t shm_ctime;
+ uint32_t shm_internal;
+};
+struct shm_info32 {
+ int32_t used_ids;
+ uint32_t shm_tot;
+ uint32_t shm_rss;
+ uint32_t shm_swp;
+ uint32_t swap_attempts;
+ uint32_t swap_successes;
+};
+struct shminfo32 {
+ uint32_t shmmax;
+ uint32_t shmmin;
+ uint32_t shmmni;
+ uint32_t shmseg;
+ uint32_t shmall;
+};
+
+int
+freebsd32_shmctl(struct thread *td, struct freebsd32_shmctl_args *uap)
+{
+ int error = 0;
+ union {
+ struct shmid_ds shmid_ds;
+ struct shm_info shm_info;
+ struct shminfo shminfo;
+ } u;
+ union {
+ struct shmid_ds32 shmid_ds32;
+ struct shm_info32 shm_info32;
+ struct shminfo32 shminfo32;
+ } u32;
+ size_t sz;
+
+ if (uap->cmd == IPC_SET) {
+ if ((error = copyin(uap->buf, &u32.shmid_ds32,
+ sizeof(u32.shmid_ds32))))
+ goto done;
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.cuid);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.cgid);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.uid);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.gid);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.mode);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.seq);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_perm.key);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_segsz);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_lpid);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_cpid);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_nattch);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_atime);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_dtime);
+ CP(u32.shmid_ds32, u.shmid_ds, shm_ctime);
+ PTRIN_CP(u32.shmid_ds32, u.shmid_ds, shm_internal);
+ }
+
+ error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz);
+ if (error)
+ goto done;
+
+ /* Cases in which we need to copyout */
+ switch (uap->cmd) {
+ case IPC_INFO:
+ CP(u.shminfo, u32.shminfo32, shmmax);
+ CP(u.shminfo, u32.shminfo32, shmmin);
+ CP(u.shminfo, u32.shminfo32, shmmni);
+ CP(u.shminfo, u32.shminfo32, shmseg);
+ CP(u.shminfo, u32.shminfo32, shmall);
+ error = copyout(&u32.shminfo32, uap->buf,
+ sizeof(u32.shminfo32));
+ break;
+ case SHM_INFO:
+ CP(u.shm_info, u32.shm_info32, used_ids);
+ CP(u.shm_info, u32.shm_info32, shm_rss);
+ CP(u.shm_info, u32.shm_info32, shm_tot);
+ CP(u.shm_info, u32.shm_info32, shm_swp);
+ CP(u.shm_info, u32.shm_info32, swap_attempts);
+ CP(u.shm_info, u32.shm_info32, swap_successes);
+ error = copyout(&u32.shm_info32, uap->buf,
+ sizeof(u32.shm_info32));
+ break;
+ case SHM_STAT:
+ case IPC_STAT:
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.cuid);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.cgid);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.uid);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.gid);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.mode);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.seq);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_perm.key);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_segsz);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_lpid);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_cpid);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_nattch);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_atime);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_dtime);
+ CP(u.shmid_ds, u32.shmid_ds32, shm_ctime);
+ PTROUT_CP(u.shmid_ds, u32.shmid_ds32, shm_internal);
+ error = copyout(&u32.shmid_ds32, uap->buf,
+ sizeof(u32.shmid_ds32));
+ break;
+ }
+
+done:
+ if (error) {
+ /* Invalidate the return value */
+ td->td_retval[0] = -1;
+ }
+ return (error);
}
int
==== //depot/projects/uart/compat/freebsd32/freebsd32_proto.h#14 (text+ko) ====
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.53 2006/02/28 19:39:52 ps Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.54 2006/03/30 07:43:01 ps Exp $
* created from FreeBSD
*/
@@ -130,10 +130,10 @@
char a6_l_[PADL_(int)]; int a6; char a6_r_[PADR_(int)];
};
struct freebsd32_shmsys_args {
- char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
- char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
- char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
- char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
+ char which_l_[PADL_(uint32_t)]; uint32_t which; char which_r_[PADR_(uint32_t)];
+ char a2_l_[PADL_(uint32_t)]; uint32_t a2; char a2_r_[PADR_(uint32_t)];
+ char a3_l_[PADL_(uint32_t)]; uint32_t a3; char a3_r_[PADR_(uint32_t)];
+ char a4_l_[PADL_(uint32_t)]; uint32_t a4; char a4_r_[PADR_(uint32_t)];
};
struct freebsd32_pread_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
@@ -204,6 +204,11 @@
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)];
};
+struct freebsd32_shmctl_args {
+ char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)];
+ char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
+ char buf_l_[PADL_(struct shmid_ds *)]; struct shmid_ds * buf; char buf_r_[PADR_(struct shmid_ds *)];
+};
struct freebsd32_clock_gettime_args {
char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)];
char tp_l_[PADL_(struct timespec32 *)]; struct timespec32 * tp; char tp_r_[PADR_(struct timespec32 *)];
@@ -306,6 +311,7 @@
int freebsd32_ftruncate(struct thread *, struct freebsd32_ftruncate_args *);
int freebsd32_sysctl(struct thread *, struct freebsd32_sysctl_args *);
int freebsd32_futimes(struct thread *, struct freebsd32_futimes_args *);
+int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *);
int freebsd32_clock_gettime(struct thread *, struct freebsd32_clock_gettime_args *);
int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *);
int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *);
==== //depot/projects/uart/compat/freebsd32/freebsd32_syscall.h#14 (text+ko) ====
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.51 2006/02/28 19:39:52 ps Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.52 2006/03/30 07:43:01 ps Exp $
* created from FreeBSD
*/
@@ -198,7 +198,7 @@
#define FREEBSD32_SYS_msgsnd 226
#define FREEBSD32_SYS_msgrcv 227
#define FREEBSD32_SYS_shmat 228
-#define FREEBSD32_SYS_shmctl 229
+#define FREEBSD32_SYS_freebsd32_shmctl 229
#define FREEBSD32_SYS_shmdt 230
#define FREEBSD32_SYS_shmget 231
#define FREEBSD32_SYS_freebsd32_clock_gettime 232
==== //depot/projects/uart/compat/freebsd32/freebsd32_syscalls.c#14 (text+ko) ====
@@ -2,7 +2,7 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.42 2006/02/28 19:39:52 ps Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.43 2006/03/30 07:43:01 ps Exp $
* created from FreeBSD
*/
@@ -236,7 +236,7 @@
"msgsnd", /* 226 = msgsnd */
"msgrcv", /* 227 = msgrcv */
"shmat", /* 228 = shmat */
- "shmctl", /* 229 = shmctl */
+ "freebsd32_shmctl", /* 229 = freebsd32_shmctl */
"shmdt", /* 230 = shmdt */
"shmget", /* 231 = shmget */
"freebsd32_clock_gettime", /* 232 = freebsd32_clock_gettime */
==== //depot/projects/uart/compat/freebsd32/freebsd32_sysent.c#14 (text+ko) ====
@@ -2,7 +2,7 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.52 2006/02/28 19:39:52 ps Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.53 2006/03/30 07:43:01 ps Exp $
* created from FreeBSD
*/
@@ -261,7 +261,7 @@
{ SYF_MPSAFE | AS(msgsnd_args), (sy_call_t *)msgsnd, AUE_MSGSND }, /* 226 = msgsnd */
{ SYF_MPSAFE | AS(msgrcv_args), (sy_call_t *)msgrcv, AUE_MSGRCV }, /* 227 = msgrcv */
{ SYF_MPSAFE | AS(shmat_args), (sy_call_t *)shmat, AUE_SHMAT }, /* 228 = shmat */
- { SYF_MPSAFE | AS(shmctl_args), (sy_call_t *)shmctl, AUE_SHMCTL }, /* 229 = shmctl */
+ { SYF_MPSAFE | AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL }, /* 229 = freebsd32_shmctl */
{ SYF_MPSAFE | AS(shmdt_args), (sy_call_t *)shmdt, AUE_SHMDT }, /* 230 = shmdt */
{ SYF_MPSAFE | AS(shmget_args), (sy_call_t *)shmget, AUE_SHMGET }, /* 231 = shmget */
{ SYF_MPSAFE | AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL }, /* 232 = freebsd32_clock_gettime */
==== //depot/projects/uart/compat/freebsd32/syscalls.master#13 (text+ko) ====
@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.64 2006/02/28 19:39:17 ps Exp $
+ $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.65 2006/03/30 07:42:32 ps Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
; from: src/sys/kern/syscalls.master 1.107
;
@@ -305,8 +305,8 @@
int a3, int a4, int a5); }
170 AUE_MSGSYS MSTD { int freebsd32_msgsys(int which, int a2, \
int a3, int a4, int a5, int a6); }
-171 AUE_SHMSYS MSTD { int freebsd32_shmsys(int which, int a2, \
- int a3, int a4); }
+171 AUE_SHMSYS MSTD { int freebsd32_shmsys(uint32_t which, uint32_t a2, \
+ uint32_t a3, uint32_t a4); }
172 AUE_NULL UNIMPL nosys
173 AUE_PREAD MSTD { ssize_t freebsd32_pread(int fd, void *buf, \
size_t nbyte, int pad, \
@@ -415,7 +415,7 @@
size_t msgsz, long msgtyp, int msgflg); }
228 AUE_SHMAT MNOPROTO { int shmat(int shmid, void *shmaddr, \
int shmflg); }
-229 AUE_SHMCTL MNOPROTO { int shmctl(int shmid, int cmd, \
+229 AUE_SHMCTL MSTD { int freebsd32_shmctl(int shmid, int cmd, \
struct shmid_ds *buf); }
230 AUE_SHMDT MNOPROTO { int shmdt(void *shmaddr); }
231 AUE_SHMGET MNOPROTO { int shmget(key_t key, int size, \
==== //depot/projects/uart/conf/NOTES#32 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1355 2006/03/29 09:57:22 scottl Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1356 2006/03/30 18:39:24 marcel Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -1678,6 +1678,11 @@
# Sun servers by the Remote Console.
options ALT_BREAK_TO_DEBUGGER
+# Serial Communications Controller
+# Supports the Siemens SAB 82532 and Zilog Z8530 multi-channel
+# communications controllers.
+device scc
+
# PCI Universal Communications driver
# Supports various single and multi port PCI serial cards. Maybe later
# also the parallel ports on combination serial/parallel cards. New cards
==== //depot/projects/uart/conf/files#54 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1105 2006/03/29 09:57:22 scottl Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1106 2006/03/30 18:39:24 marcel Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
==== //depot/projects/uart/dev/acpica/Osd/OsdSchedule.c#10 (text+ko) ====
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.35 2006/01/14 01:55:23 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.36 2006/03/30 19:22:45 scottl Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -66,7 +66,8 @@
};
TASKQUEUE_DEFINE(acpi, taskqueue_thread_enqueue, &taskqueue_acpi,
- taskqueue_start_threads(&taskqueue_acpi, 3, PWAIT, "acpi_task"));
+ taskqueue_start_threads(&taskqueue_acpi, acpi_max_threads, PWAIT,
+ "acpi_task"));
/*
* Bounce through this wrapper function since ACPI-CA doesn't understand
==== //depot/projects/uart/dev/ata/atapi-fd.c#11 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.108 2006/03/18 13:14:38 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.109 2006/03/30 05:29:57 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -398,7 +398,7 @@
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
struct ata_device *atadev = device_get_softc(dev);
struct afd_softc *fdp = device_get_ivars(dev);
- char sizestring[16] = "";
+ char sizestring[16];
if (fdp->mediasize > 1048576 * 5)
sprintf(sizestring, "%juMB", fdp->mediasize / 1048576);
==== //depot/projects/uart/dev/pccbb/pccbb.c#16 (text+ko) ====
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.140 2006/03/24 07:52:00 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.141 2006/03/30 04:25:45 imp Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -650,8 +650,19 @@
struct cbb_softc *sc = arg;
uint32_t sockevent;
+ /*
+ * Read the socket event. Sometimes, the theory goes, the PCI
+ * bus is so loaded that it cannot satisfy the read request, so
+ * we get garbage back from the following read. We have to filter
+ * out the garbage so that we don't spontaneously reset the card
+ * under high load. PCI isn't supposed to act like this. No doubt
+ * this is a bug in the PCI bridge chipset (or cbb brige) that's being
+ * used in certain amd64 laptops today. Work around the issue by
+ * assuming that any bits we don't know about being set means that
+ * we got garbage.
+ */
sockevent = cbb_get(sc, CBB_SOCKET_EVENT);
- if (sockevent != 0) {
+ if (sockevent != 0 && (sockevent & CBB_SOCKET_EVENT_VALID_MASK) == 0) {
/* ack the interrupt */
cbb_set(sc, CBB_SOCKET_EVENT, sockevent);
@@ -697,7 +708,7 @@
* indication above.
*
* We have to call this unconditionally because some bridges deliver
- * the even independent of the CBB_SOCKET_EVENT_CD above.
+ * the event independent of the CBB_SOCKET_EVENT_CD above.
*/
exca_getb(&sc->exca[0], EXCA_CSC);
}
==== //depot/projects/uart/dev/pccbb/pccbbreg.h#7 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pccbb/pccbbreg.h,v 1.18 2005/12/27 18:55:21 imp Exp $
+ * $FreeBSD: src/sys/dev/pccbb/pccbbreg.h,v 1.19 2006/03/30 04:12:28 imp Exp $
*/
/*
@@ -177,6 +177,7 @@
#define CBB_SOCKET_EVENT_CD2 0x04 /* Card Detect 2 */
#define CBB_SOCKET_EVENT_CD 0x06 /* Card Detect all */
#define CBB_SOCKET_EVENT_POWER 0x08 /* Power Cycle */
+#define CBB_SOCKET_EVENT_VALID_MASK 0x0f /* All socket events */
#define CBB_SOCKET_MASK_CSTS 0x01 /* Card Status Change */
#define CBB_SOCKET_MASK_CD 0x06 /* Card Detect */
@@ -220,26 +221,26 @@
#define CBB_SOCKET_CTRL_STOPCLK 0x80
-#define CBB_FORCE_CV_TEST (1UL << 14)
-#define CBB_FORCE_3VCARD (1UL << 11)
-#define CBB_FORCE_5VCARD (1UL << 10)
-#define CBB_FORCE_BAD_VCC_REQ (1UL << 9)
-#define CBB_FORCE_DATA_LOST (1UL << 8)
-#define CBB_FORCE_NOT_A_CARD (1UL << 7)
-#define CBB_FORCE_CB_CARD (1UL << 5)
-#define CBB_FORCE_R2_CARD (1UL << 4)
-#define CBB_FORCE_POWER_CYCLE (1UL << 3)
-#define CBB_FORCE_CD2_CHANGE (1UL << 2)
-#define CBB_FORCE_CD1_CHANGE (1UL << 1)
-#define CBB_FORCE_CSTCHG (1UL << 0)
+#define CBB_FORCE_CV_TEST (1UL << 14)
+#define CBB_FORCE_3VCARD (1UL << 11)
+#define CBB_FORCE_5VCARD (1UL << 10)
+#define CBB_FORCE_BAD_VCC_REQ (1UL << 9)
+#define CBB_FORCE_DATA_LOST (1UL << 8)
+#define CBB_FORCE_NOT_A_CARD (1UL << 7)
+#define CBB_FORCE_CB_CARD (1UL << 5)
+#define CBB_FORCE_R2_CARD (1UL << 4)
+#define CBB_FORCE_POWER_CYCLE (1UL << 3)
+#define CBB_FORCE_CD2_CHANGE (1UL << 2)
+#define CBB_FORCE_CD1_CHANGE (1UL << 1)
+#define CBB_FORCE_CSTCHG (1UL << 0)
#include <dev/pccbb/pccbbdevid.h>
-#define CBB_SOCKET_EVENT 0x00
-#define CBB_SOCKET_MASK 0x04
-#define CBB_SOCKET_STATE 0x08
-#define CBB_SOCKET_FORCE 0x0c
-#define CBB_SOCKET_CONTROL 0x10
-#define CBB_SOCKET_POWER 0x14
+#define CBB_SOCKET_EVENT 0x00
+#define CBB_SOCKET_MASK 0x04
+#define CBB_SOCKET_STATE 0x08
+#define CBB_SOCKET_FORCE 0x0c
+#define CBB_SOCKET_CONTROL 0x10
+#define CBB_SOCKET_POWER 0x14
-#define CBB_EXCA_OFFSET 0x800 /* offset for exca regs */
+#define CBB_EXCA_OFFSET 0x800 /* offset for exca regs */
==== //depot/projects/uart/dev/puc/puc_ebus.c#12 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/puc/puc_ebus.c,v 1.7 2006/02/24 02:06:57 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/puc/puc_ebus.c,v 1.8 2006/03/30 18:43:03 marcel Exp $");
#include "opt_puc.h"
@@ -65,6 +65,8 @@
struct puc_device_description dd;
int i;
+ printf("NOTICE: Please configure device scc(1) into the kernel.\n");
+
bzero(&dd, sizeof(dd));
dd.name = device_get_desc(dev);
for (i = 0; i < 2; i++) {
==== //depot/projects/uart/dev/puc/puc_sbus.c#13 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/puc/puc_sbus.c,v 1.9 2006/02/24 02:06:57 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/puc/puc_sbus.c,v 1.10 2006/03/30 18:43:03 marcel Exp $");
#include "opt_puc.h"
@@ -64,6 +64,8 @@
struct puc_device_description dd;
int i;
+ printf("NOTICE: Please configure device scc(1) into the kernel.\n");
+
bzero(&dd, sizeof(dd));
dd.name = device_get_desc(dev);
for (i = 0; i < 2; i++) {
==== //depot/projects/uart/dev/scc/scc_bfe.h#14 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_bfe_ebus.c#5 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_bfe_sbus.c#4 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_bus.h#8 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_core.c#18 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_dev_sab82532.c#7 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_dev_z8530.c#9 (text+ko) ====
==== //depot/projects/uart/dev/scc/scc_if.m#7 (text+ko) ====
==== //depot/projects/uart/dev/sound/pcm/dsp.c#13 (text+ko) ====
@@ -29,7 +29,7 @@
#include <dev/sound/pcm/sound.h>
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.94 2006/03/21 06:35:48 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.95 2006/03/30 06:17:03 ariff Exp $");
#define OLDPCM_IOCTL
@@ -306,10 +306,6 @@
pcm_lock(d);
rdch = i_dev->si_drv1;
wrch = i_dev->si_drv2;
- if (rdch && td->td_proc->p_pid != rdch->pid)
- rdch = NULL;
- if (wrch && td->td_proc->p_pid != wrch->pid)
- wrch = NULL;
pcm_unlock(d);
if (rdch || wrch) {
@@ -431,11 +427,9 @@
getchns(i_dev, &rdch, &wrch, 0);
kill = 0;
- if (wrch && ((wrch->flags & CHN_F_DEAD) ||
- td->td_proc->p_pid != wrch->pid))
+ if (wrch && (wrch->flags & CHN_F_DEAD))
kill |= 1;
- if (rdch && ((rdch->flags & CHN_F_DEAD) ||
- td->td_proc->p_pid != rdch->pid))
+ if (rdch && (rdch->flags & CHN_F_DEAD))
kill |= 2;
if (kill == 3) {
relchns(i_dev, rdch, wrch, 0);
==== //depot/projects/uart/dev/uart/uart_bus.h#44 (text+ko) ====
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/uart/uart_bus.h,v 1.11 2006/02/24 05:40:17 marcel Exp $
+ * $FreeBSD: src/sys/dev/uart/uart_bus.h,v 1.12 2006/03/30 18:37:03 marcel Exp $
*/
#ifndef _DEV_UART_BUS_H_
==== //depot/projects/uart/dev/uart/uart_bus_scc.c#8 (text+ko) ====
==== //depot/projects/uart/dev/uart/uart_core.c#52 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.17 2006/02/24 05:40:17 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.18 2006/03/30 18:37:03 marcel Exp $");
#ifndef KLD_MODULE
#include "opt_comconsole.h"
==== //depot/projects/uart/dev/uart/uart_cpu.h#18 (text+ko) ====
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/uart/uart_cpu.h,v 1.8 2005/01/06 01:43:26 imp Exp $
+ * $FreeBSD: src/sys/dev/uart/uart_cpu.h,v 1.9 2006/03/30 18:37:03 marcel Exp $
*/
#ifndef _DEV_UART_CPU_H_
==== //depot/projects/uart/dev/uart/uart_dev_ns8250.c#38 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.16 2006/02/24 05:40:17 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.17 2006/03/30 18:37:03 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/uart/dev/uart/uart_dev_sab82532.c#40 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_sab82532.c,v 1.12 2006/02/24 05:40:17 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_sab82532.c,v 1.13 2006/03/30 18:37:03 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/uart/dev/uart/uart_dev_z8530.c#28 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.14 2006/02/24 05:40:17 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.15 2006/03/30 18:37:03 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/uart/dev/uart/uart_tty.c#28 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.26 2006/02/24 02:42:26 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.27 2006/03/30 03:26:52 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/uart/geom/eli/g_eli.h#3 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/geom/eli/g_eli.h,v 1.5 2006/02/01 12:05:59 pjd Exp $
+ * $FreeBSD: src/sys/geom/eli/g_eli.h,v 1.7 2006/03/30 18:50:00 pjd Exp $
*/
#ifndef _G_ELI_H_
==== //depot/projects/uart/geom/mirror/g_mirror.c#13 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/mirror/g_mirror.c,v 1.79 2006/03/19 12:55:50 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/mirror/g_mirror.c,v 1.80 2006/03/30 12:15:41 pjd Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2116,7 +2116,7 @@
* if we have any disks and 'force' is true.
*/
ndisks = g_mirror_ndisks(sc, -1);
- if ((force && ndisks) || sc->sc_ndisks == ndisks) {
+ if (sc->sc_ndisks == ndisks || (force && ndisks > 0)) {
;
} else if (ndisks == 0) {
/*
==== //depot/projects/uart/geom/vinum/geom_vinum.c#7 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum.c,v 1.20 2006/03/23 19:58:42 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum.c,v 1.21 2006/03/30 14:01:25 le Exp $");
#include <sys/param.h>
#include <sys/bio.h>
@@ -237,13 +237,16 @@
/* Find the volume this plex should be attached to. */
v = gv_find_vol(sc, p->volume);
- if (v != NULL) {
- if (v->plexcount)
- p->flags |= GV_PLEX_ADDED;
- p->vol_sc = v;
- v->plexcount++;
- LIST_INSERT_HEAD(&v->plexes, p, in_volume);
+ if (v == NULL) {
+ gctl_error(req, "volume '%s' not found", p->volume);
+ g_free(p);
+ continue;
}
+ if (v->plexcount)
+ p->flags |= GV_PLEX_ADDED;
+ p->vol_sc = v;
+ v->plexcount++;
+ LIST_INSERT_HEAD(&v->plexes, p, in_volume);
p->vinumconf = sc;
p->flags |= GV_PLEX_NEWBORN;
@@ -272,7 +275,7 @@
/* drive not found - XXX */
if (d == NULL) {
- printf("FOO: drive '%s' not found\n", s->drive);
+ gctl_error(req, "drive '%s' not found", s->drive);
g_free(s);
continue;
}
@@ -282,7 +285,7 @@
/* plex not found - XXX */
if (p == NULL) {
- printf("FOO: plex '%s' not found\n", s->plex);
+ gctl_error(req, "plex '%s' not found\n", s->plex);
g_free(s);
continue;
}
@@ -304,8 +307,34 @@
*/
error = gv_sd_to_plex(p, s, 1);
if (error) {
- printf("FOO: couldn't give sd '%s' to plex '%s'\n",
- s->name, p->name);
+ gctl_error(req, "GEOM_VINUM: couldn't give sd '%s' "
+ "to plex '%s'\n", s->name, p->name);
+ if (s->drive_sc)
+ LIST_REMOVE(s, from_drive);
+ gv_free_sd(s);
+ g_free(s);
+ /*
+ * If this subdisk can't be created, we won't create
+ * the attached plex either, if it is also a new one.
+ */
+ if (!(p->flags & GV_PLEX_NEWBORN))
+ continue;
+ LIST_FOREACH_SAFE(s, &p->subdisks, in_plex, s2) {
+ if (s->drive_sc)
+ LIST_REMOVE(s, from_drive);
+ p->sdcount--;
+ LIST_REMOVE(s, in_plex);
+ LIST_REMOVE(s, sd);
+ gv_free_sd(s);
+ g_free(s);
+ }
+ if (p->vol_sc != NULL) {
+ LIST_REMOVE(p, in_volume);
+ p->vol_sc->plexcount--;
+ }
+ LIST_REMOVE(p, plex);
+ g_free(p);
+ continue;
}
s->flags |= GV_SD_NEWBORN;
==== //depot/projects/uart/geom/vinum/geom_vinum.h#6 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/geom/vinum/geom_vinum.h,v 1.11 2006/03/23 19:58:42 le Exp $
+ * $FreeBSD: src/sys/geom/vinum/geom_vinum.h,v 1.12 2006/03/30 14:01:25 le Exp $
*/
#ifndef _GEOM_VINUM_H_
@@ -72,6 +72,7 @@
/* geom_vinum_subr.c */
void gv_adjust_freespace(struct gv_sd *, off_t);
+void gv_free_sd(struct gv_sd *);
struct g_geom *find_vinum_geom(void);
struct gv_drive *gv_find_drive(struct gv_softc *, char *);
struct gv_plex *gv_find_plex(struct gv_softc *, char *);
==== //depot/projects/uart/geom/vinum/geom_vinum_rm.c#6 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_rm.c,v 1.11 2006/03/23 20:01:13 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_rm.c,v 1.12 2006/03/30 14:01:25 le Exp $");
#include <sys/param.h>
#include <sys/libkern.h>
@@ -38,7 +38,6 @@
#include <geom/vinum/geom_vinum.h>
#include <geom/vinum/geom_vinum_share.h>
-static void gv_free_sd(struct gv_sd *);
static int gv_rm_drive(struct gv_softc *, struct gctl_req *,
struct gv_drive *, int);
static int gv_rm_plex(struct gv_softc *, struct gctl_req *,
@@ -381,60 +380,3 @@
return (err);
}
-
-static void
-gv_free_sd(struct gv_sd *s)
-{
- struct gv_drive *d;
- struct gv_freelist *fl, *fl2;
-
- KASSERT(s != NULL, ("gv_free_sd: NULL s"));
-
- d = s->drive_sc;
- if (d == NULL)
- return;
-
- /*
- * First, find the free slot that's immediately before or after this
- * subdisk.
- */
- fl = NULL;
- LIST_FOREACH(fl, &d->freelist, freelist) {
- if (fl->offset == s->drive_offset + s->size)
- break;
- if (fl->offset + fl->size == s->drive_offset)
- break;
- }
-
- /* If there is no free slot behind this subdisk, so create one. */
- if (fl == NULL) {
-
- fl = g_malloc(sizeof(*fl), M_WAITOK | M_ZERO);
- fl->size = s->size;
- fl->offset = s->drive_offset;
-
- if (d->freelist_entries == 0) {
- LIST_INSERT_HEAD(&d->freelist, fl, freelist);
- } else {
- LIST_FOREACH(fl2, &d->freelist, freelist) {
- if (fl->offset < fl2->offset) {
- LIST_INSERT_BEFORE(fl2, fl, freelist);
- break;
- } else if (LIST_NEXT(fl2, freelist) == NULL) {
- LIST_INSERT_AFTER(fl2, fl, freelist);
- break;
- }
- }
- }
-
- d->freelist_entries++;
-
- /* Expand the free slot we just found. */
- } else {
- fl->size += s->size;
- if (fl->offset > s->drive_offset)
- fl->offset = s->drive_offset;
- }
-
- d->avail += s->size;
-}
==== //depot/projects/uart/geom/vinum/geom_vinum_state.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_state.c,v 1.7 2005/01/21 18:27:23 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_state.c,v 1.8 2006/03/30 14:01:25 le Exp $");
#include <sys/param.h>
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list