FreeBSD Bugzilla – Attachment 199049 Details for
Bug 233057
emulators/rtc: Fix build with stable/12
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to allow emulators/rtc to be built on stable/12
rtc.patch (text/plain), 2.77 KB, created by
Oleg Sidorkin
on 2018-11-07 12:08:06 UTC
(
hide
)
Description:
patch to allow emulators/rtc to be built on stable/12
Filename:
MIME Type:
Creator:
Oleg Sidorkin
Created:
2018-11-07 12:08:06 UTC
Size:
2.77 KB
patch
obsolete
>Index: emulators/rtc/Makefile >=================================================================== >--- emulators/rtc/Makefile (revision 484283) >+++ emulators/rtc/Makefile (working copy) >@@ -11,9 +11,6 @@ > MAINTAINER= emulation@FreeBSD.org > COMMENT= Kernel module which provides /dev/rtc device support > >-BROKEN_FreeBSD_12= fails to compile: rtc.c:166:2: implicit declaration of function 'MALLOC' is invalid in C99 >-BROKEN_FreeBSD_13= fails to compile: rtc.c:166:2: implicit declaration of function 'MALLOC' is invalid in C99 >- > WRKSRC= ${WRKDIR}/files > > NO_FETCH= yes >Index: emulators/rtc/files/rtc.c >=================================================================== >--- emulators/rtc/files/rtc.c (revision 484283) >+++ emulators/rtc/files/rtc.c (working copy) >@@ -163,7 +163,7 @@ > return dev->si_drv1; > } > >- MALLOC(sc, struct rtc_softc*, sizeof(*sc), M_DEVBUF, M_WAITOK); >+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); > if (sc==NULL) > return NULL; > >@@ -196,7 +196,7 @@ > } > > callout_stop(&sc->var.rtc_handle); >- FREE(sc, M_DEVBUF); >+ free(sc, M_DEVBUF); > dev->si_drv1 = NULL; > return error; > } >@@ -433,22 +433,36 @@ > restart: > increment.tv_sec = 0; > increment.tv_nsec = 1000000000 / sc->var.freq; >- timespecadd(&sc->var.lasttime, &increment); >- nexttime.tv_sec = sc->var.lasttime.tv_sec; >- nexttime.tv_nsec = sc->var.lasttime.tv_nsec; >- timespecadd(&nexttime, &increment); >+#if P_OSREL_MAJOR(__FreeBSD_version) >= 12 >+ timespecadd(&sc->var.lasttime, &increment, &sc->var.lasttime); >+ timespecadd(&sc->var.lasttime, &increment, &nexttime); >+#else >+ timespecadd(&sc->var.lasttime, &increment); >+ nexttime.tv_sec = sc->var.lasttime.tv_sec; >+ nexttime.tv_nsec = sc->var.lasttime.tv_nsec; >+ timespecadd(&nexttime, &increment); >+#endif > if (timespeccmp(&nexttime, &curtime, <)) { > /* Catch up if we lag curtime */ >- sc->var.lasttime.tv_sec = curtime.tv_sec; >- sc->var.lasttime.tv_nsec = curtime.tv_nsec; >- timespecsub(&sc->var.lasttime, &increment); >- timespecsub(&nexttime, &curtime); >+#if P_OSREL_MAJOR(__FreeBSD_version) >= 12 >+ timespecsub(&curtime, &increment, &sc->var.lasttime); >+ timespecsub(&nexttime, &curtime, &nexttime); >+#else >+ sc->var.lasttime.tv_sec = curtime.tv_sec; >+ sc->var.lasttime.tv_nsec = curtime.tv_nsec; >+ timespecsub(&sc->var.lasttime, &increment); >+ timespecsub(&nexttime, &curtime); >+#endif > #if 0 > printf("lagging curtime by %d.%ld\n", nexttime.tv_sec, nexttime.tv_nsec); > #endif > goto restart; > } else { >+#if P_OSREL_MAJOR(__FreeBSD_version) >= 12 >+ timespecsub(&nexttime, &curtime, &nexttime); >+#else > timespecsub(&nexttime, &curtime); >+#endif > sleep = nexttime.tv_nsec / (1000000000 / hz); > } > callout_reset(&sc->var.rtc_handle, sleep, &rtc_callback, xtp);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233057
: 199049 |
216332