summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-09-14 22:27:05 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-09-14 22:27:05 +0000
commitd4c7c8f24d85399a67e907099ef0f6b336e35a5e (patch)
tree282a4f49c18b3f9234fd3ab8aea0008c55e61b44 /sys
parent3f667ab78650f11a555a38d5098b15050f1d9680 (diff)
allocate ext-cfg memory if was requestd in dd_stimemreq
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/sti.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c
index cbab532b910..c37821d849f 100644
--- a/sys/dev/ic/sti.c
+++ b/sys/dev/ic/sti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti.c,v 1.35 2003/12/16 06:07:13 mickey Exp $ */
+/* $OpenBSD: sti.c,v 1.36 2004/09/14 22:27:04 mickey Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -260,6 +260,17 @@ sti_attach_common(sc)
cc = &sc->sc_cfg;
bzero(cc, sizeof (*cc));
+ cc->ext_cfg = &sc->sc_ecfg;
+ bzero(&cc->ext_cfg, sizeof(*cc->ext_cfg));
+ if (dd->dd_stimemreq) {
+ sc->sc_ecfg.addr = malloc(dd->dd_stimemreq, M_DEVBUF, M_NOWAIT);
+ if (!sc->sc_ecfg.addr) {
+ printf("cannot allocate %d bytes for STI\n",
+ dd->dd_stimemreq);
+ uvm_km_free(kernel_map, sc->sc_code, round_page(size));
+ return;
+ }
+ }
{
int i = dd->dd_reglst;
u_int32_t *p;