mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 08:22:44 +00:00
Get the pysical address for id_maddr when opening an -incore kernel.
This fixes the kernel panic when propagating userconfig changes to arbitrary kernels. Remove obsoleted `#include <tcl.h>' added a few <stdio.h> where necessary. Fix getting scsi bus information from an -incore kernel. Turned on SAVE_USERCONFIG by default.
This commit is contained in:
parent
8ba0c490a9
commit
b14765b3ed
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18894
@ -14,7 +14,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
|
||||
uc_scsi.c
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS #-DSAVE_USERCONFIG
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS -DSAVE_USERCONFIG
|
||||
|
||||
#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\"
|
||||
|
||||
|
@ -23,17 +23,15 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: uc_eisa.c,v 1.1 1996/10/03 06:01:37 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <nlist.h>
|
||||
#include <i386/eisa/eisaconf.h>
|
||||
#ifdef TCL
|
||||
#include <tcl.h>
|
||||
#endif
|
||||
|
||||
#include "uc_main.h"
|
||||
|
||||
|
@ -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.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: uc_isa.c,v 1.1 1996/10/03 06:01:38 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -74,7 +74,7 @@ get_isa_info(struct kernel *kp){
|
||||
idp->port=p->id_iobase;
|
||||
idp->irq=p->id_irq;
|
||||
idp->drq=p->id_drq;
|
||||
idp->iomem=p->id_maddr;
|
||||
idp->iomem=(u_int)p->id_maddr & 0xFFFFFF; /* kludge to get pa from kva */
|
||||
idp->iosize=p->id_msize;
|
||||
idp->flags=p->id_flags;
|
||||
idp->alive=p->id_alive;
|
||||
@ -174,7 +174,7 @@ isa_setdev(struct kernel *kp, struct list *list){
|
||||
irq=strtol(list->av[2], (char **)NULL, 0);
|
||||
ip->irq= irq > 0 ? 1 << (irq) : irq;
|
||||
ip->drq = strtol(list->av[3], (char **)NULL, 0);
|
||||
ip->iomem = (caddr_t)strtol(list->av[4], (char **)NULL, 0);
|
||||
ip->iomem = strtol(list->av[4], (char **)NULL, 0);
|
||||
ip->iosize = strtol(list->av[5], (char **)NULL, 0);
|
||||
ip->flags = strtol(list->av[6], (char **)NULL, 0);
|
||||
ip->enabled = strtol(list->av[8], (char **)NULL, 0);
|
||||
@ -194,7 +194,7 @@ isa_free(struct kernel *kp, int writeback){
|
||||
ip->idp->id_iobase=ip->port;
|
||||
ip->idp->id_irq = ip->irq;
|
||||
ip->idp->id_drq = ip->drq;
|
||||
ip->idp->id_maddr = ip->iomem;
|
||||
ip->idp->id_maddr = (caddr_t)ip->iomem;
|
||||
ip->idp->id_msize = ip->iosize;
|
||||
ip->idp->id_flags = ip->flags;
|
||||
ip->idp->id_enabled = ip->enabled;
|
||||
|
@ -24,10 +24,11 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* library functions for userconfig library
|
||||
*
|
||||
* $Id: uc_main.c,v 1.11 1996/10/06 02:56:22 jkh Exp $
|
||||
* $Id: uc_main.c,v 1.12 1996/10/06 16:04:49 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@ -36,7 +37,6 @@
|
||||
#include <nlist.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <tcl.h>
|
||||
|
||||
#include "uc_main.h"
|
||||
|
||||
|
@ -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.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: uc_main.h,v 1.1 1996/10/03 06:01:42 jkh Exp $
|
||||
*/
|
||||
|
||||
#define ISA_BIOTAB 0
|
||||
@ -65,7 +65,7 @@ struct uc_isa {
|
||||
u_short port;
|
||||
u_short irq;
|
||||
short drq;
|
||||
caddr_t iomem;
|
||||
u_int iomem;
|
||||
int iosize;
|
||||
int flags;
|
||||
int alive;
|
||||
|
@ -23,15 +23,15 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: uc_pci.c,v 1.1 1996/10/03 06:01:43 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <nlist.h>
|
||||
#include <pci/pcivar.h>
|
||||
#include <tcl.h>
|
||||
|
||||
#include "uc_main.h"
|
||||
|
||||
|
@ -23,15 +23,15 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: uc_scsi.c,v 1.1 1996/10/03 06:01:44 jkh Exp $
|
||||
* $Id: uc_scsi.c,v 1.2 1996/10/04 13:33:46 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <nlist.h>
|
||||
#include <scsi/scsiconf.h>
|
||||
#include <tcl.h>
|
||||
|
||||
#include "uc_main.h"
|
||||
|
||||
@ -105,6 +105,7 @@ get_scsi_info(struct kernel *kp){
|
||||
|
||||
sbpc=sbp+nscsibus;
|
||||
sbpc->bus_no=nscsibus;
|
||||
nscsibus++;
|
||||
sscanf(spc->device, "%[a-z]%d", name, &sbpc->unit);
|
||||
asprintf(&sbpc->driver, "%s", name);
|
||||
|
||||
@ -155,9 +156,16 @@ get_scsi_info(struct kernel *kp){
|
||||
t=(u_int)sdev->next;
|
||||
free(sdev);
|
||||
}
|
||||
/* slap on the terminators */
|
||||
sp=(struct uc_scsi*)realloc(sp, (sizeof(struct uc_scsi)*(total+1)));
|
||||
spc=sp+total;
|
||||
bzero(spc, sizeof(struct uc_scsi));
|
||||
|
||||
sbp=(struct uc_scsibus *)realloc(sbp, sizeof(struct uc_scsibus)*
|
||||
(nscsibus+1));
|
||||
sbpc=sbp+nscsibus+1;
|
||||
bzero(sbpc, sizeof(struct uc_scsibus));
|
||||
|
||||
kp->scsi_devp=sp;
|
||||
kp->scsibus_devp=sbp;
|
||||
} else { /* no symbol, and incore, no scsi */
|
||||
@ -453,16 +461,14 @@ scsi_free(struct kernel *kp, int writeback){
|
||||
}
|
||||
free(kp->scsi_devp);
|
||||
kp->scsi_devp=(struct uc_scsi *)0;
|
||||
#define WANT_TO_COREDUMP 1
|
||||
#if WANT_TO_COREDUMP /* ugly hack until scsi_getdev() gets -incore
|
||||
busses correctly */
|
||||
/* now free the bus info */
|
||||
if(kp->incore){
|
||||
for(sbp=kp->scsibus_devp;sbp->driver; sbp++){
|
||||
/* fprintf(stderr, "sbp: 0x%x free(0x%x)\n", sbp, sbp->driver);*/
|
||||
free(sbp->driver);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (kp->scsibus_devp)
|
||||
free(kp->scsibus_devp);
|
||||
kp->scsibus_devp=(struct uc_scsibus *)0;
|
||||
|
@ -14,7 +14,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
|
||||
uc_scsi.c
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS #-DSAVE_USERCONFIG
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS -DSAVE_USERCONFIG
|
||||
|
||||
#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\"
|
||||
|
||||
|
@ -14,7 +14,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
|
||||
uc_scsi.c
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS #-DSAVE_USERCONFIG
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS -DSAVE_USERCONFIG
|
||||
|
||||
#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user