FreeBSD Bugzilla – Attachment 15042 Details for
Bug 28026
Graphics mode suspend causes weird hang on laptop with Rage card
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.55 KB, created by
spadger
on 2001-06-11 03:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
spadger
Created:
2001-06-11 03:40:01 UTC
Size:
1.55 KB
patch
obsolete
>*** usr.sbin/apm/apm.c.orig Tue Apr 17 23:53:48 2001 >--- usr.sbin/apm/apm.c Mon Apr 30 23:55:31 2001 >*************** >*** 36,41 **** >--- 36,47 ---- > > #define APMDEV "/dev/apm" > >+ #ifdef WANT_TEXTMODE_SUSPEND >+ #define VGADEV "/dev/vga" >+ #include <sys/wait.h> >+ #include <machine/console.h> >+ #endif >+ > #define xh(a) (((a) & 0xff00) >> 8) > #define xl(a) ((a) & 0xff) > #define APMERR(a) xh(a) >*************** >*** 126,131 **** >--- 132,168 ---- > err(1, "ioctl(APMIO_STANDBY)"); > } > >+ #ifdef WANT_TEXTMODE_SUSPEND >+ void >+ apm_wrapper(int fd, void (*fptr)(int)) >+ { >+ int myfd, vt, status; >+ >+ myfd = open(VGADEV, O_RDONLY); >+ if(myfd < 0) >+ err(1, "open %s", VGADEV); >+ if(ioctl(myfd, VT_GETACTIVE, &vt) < 0) >+ err(1, "ioctl VT_GETACTIVE"); >+ if(ioctl(myfd, VT_ACTIVATE, 1) < 0) >+ err(1, "ioctl VT_ACTIVATE"); >+ >+ switch(fork()) { >+ case -1: >+ err(1, "fork"); >+ case 0: >+ fptr (fd); >+ break; >+ default: >+ wait(&status); >+ if(!WIFEXITED(status) || WEXITSTATUS(status)) >+ errx(1, "apm -z failed"); >+ } >+ sleep(2); >+ if(ioctl(myfd, VT_ACTIVATE, vt) < 0) >+ err(1, "ioctl VT_ACTIVATE"); >+ } >+ #endif >+ > void > apm_getinfo(int fd, apm_info_t aip) > { >*************** >*** 483,492 **** >--- 520,535 ---- > apm_haltcpu(fd, haltcpu); > if (delta) > apm_set_timer(fd, delta); >+ #ifdef WANT_TEXTMODE_SUSPEND >+ if (sleep || standby) { >+ apm_wrapper( fd, (sleep?apm_suspend:apm_standby) ); >+ } >+ #else > if (sleep) > apm_suspend(fd); > else if (standby) > apm_standby(fd); >+ #endif > else if (delta == 0) { > struct apm_info info; >
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 28026
: 15042 |
15043
|
15044