From d4c7c8f24d85399a67e907099ef0f6b336e35a5e Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Tue, 14 Sep 2004 22:27:05 +0000 Subject: allocate ext-cfg memory if was requestd in dd_stimemreq --- sys/dev/ic/sti.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/dev/ic') 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; -- cgit v1.2.3