From owner-freebsd-current Fri May 29 20:09:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA04310 for freebsd-current-outgoing; Fri, 29 May 1998 20:09:42 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA04275; Fri, 29 May 1998 20:09:32 -0700 (PDT) (envelope-from toor@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.8/8.8.8) id WAA05164; Fri, 29 May 1998 22:09:08 -0500 (EST) (envelope-from toor) From: "John S. Dyson" Message-Id: <199805300309.WAA05164@dyson.iquest.net> Subject: Re: Fastvid.. In-Reply-To: <19980527232341.65268@bleep.ishiboo.com> from Danny Dulai at "May 27, 98 11:23:41 pm" To: nirva@ishiboo.com (Danny Dulai) Date: Fri, 29 May 1998 22:09:08 -0500 (EST) Cc: doconnor@gsoft.com.au, freebsd-multimedia@FreeBSD.ORG, freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Quoting Daniel O'Connor (doconnor@gsoft.com.au): > > > > The speedup factor is 1.89, mmm :) > > > The vm_map.h problems are solved by #including , but the > MOD_SYSCALL on line 103 and the problem at line 234 I do not understand. > > Does anyone have copy of this module for -current? > This is a copy of the original code that I submitted to someone who cleaned it up (I am sorry that I forgot who actually took ownership.) This code works on my display adaptor, and compiles under -current. #include #include #include #include #include #include #include #include #include #include #include #include #include #define I586_CPU /* XXX for i586_ctr_freq */ #include static int load(struct lkm_table *lkmtp, int cmd); static int mycall(struct proc *p, void *uap, int *retval); extern int newsyscall_mod(struct lkm_table *lkmtp, int cmd, int ver); static int unload(struct lkm_table *lkmtp, int cmd); vm_offset_t contigaddr; struct proc *curproc; static struct sysent newent = { 0, mycall /* # of args, function pointer*/ }; MOD_SYSCALL(newsyscall_mod, -1, &newent); static struct { int address; char *name; } ranges[] = { {0x250, "MTRRfix64K_00000"}, {0x258, "MTRRfix16K_80000"}, {0x259, "MTRRfix16K_A0000"}, {0x268, "MTRRfix4K_C0000"}, {0x269, "MTRRfix4K_C8000"}, {0x26a, "MTRRfix4K_D0000"}, {0x26b, "MTRRfix4K_D8000"}, {0x26c, "MTRRfix4K_E0000"}, {0x26d, "MTRRfix4K_E8000"}, {0x26e, "MTRRfix4K_F0000"}, {0x26f, "MTRRfix4K_F8000"}, {0x0, NULL} }; static int load(struct lkm_table *lkmtp, int cmd) { int i; long long base; long long mask; vm_offset_t kernaddr; struct proc *otherp; int tbase, tmask, type; unsigned long long newval; pmap_t pmap; base = rdmsr(0x2ff); tbase = base & 0xfff; printf("default: type: 0x%x\n", tbase); wrmsr(0x259, 0x0101010101010101ULL); /* * Add in an Memory type register entry here, after * reviewing the output of your X server. * My video ram is at phys addr 0xfe000000, size 8MB */ #define VIDPHYSADDR (0xfe000000) #define VIDPHYSSIZE (0x800000) #define MSRINDEX 5 base = VIDPHYSADDR | 0x1; mask = (long long) (0xfffffffffLL - ((long) VIDPHYSSIZE - 1)) | (long long) 0x800; wrmsr(0x200 + MSRINDEX * 2, base); wrmsr(0x201 + MSRINDEX * 2, mask); for(i=0;i<8;i++) { int basehi, baselo; int maskhi, masklo; base = rdmsr(0x200 + i * 2); basehi = (unsigned long long) base >> 32; baselo = (unsigned long long) base & 0xffffffffL; type = base & 0xff; base >>= 12; tbase = base; mask = rdmsr(0x201 + i * 2); if ((mask & 0x800) == 0) continue; maskhi = (unsigned long long) mask >> 32; masklo = (unsigned long long) mask & 0xffffffffL; mask >>= 12; tmask = mask; printf("%d: type: %d, addr: 0x%x000, mask: 0x%x000\n basehi: 0x%8.8x, baselo: 0x%8.8x\n maskhi: 0x%8.8x, masklo: 0x%8.8x\n", i, type, tbase, tmask, basehi, baselo, maskhi, masklo); } for(i=0;ranges[i].address;i++) { int maskhi, masklo; mask = rdmsr(ranges[i].address); maskhi = (unsigned long long) mask >> 32; masklo = (unsigned long long) mask & 0xffffffffL; printf("%s: 0x%8.8x 0x%8.8x\n", ranges[i].name, maskhi, masklo); } tbase = rdmsr(0x1e0); printf("BKUPTMPDR6: %x\n", tbase); tbase = rdmsr(0x2a); printf("BKUPTMPDR6: %x\n", tbase); pmap = &curproc->p_vmspace->vm_pmap; for(i=0;i<1024;i++) { unsigned entry; entry = (unsigned) curproc->p_vmspace->vm_pmap.pm_pdir[i]; if (entry & PG_PS) { printf("4MB page: 0x%x(%x)\n", entry, i << 22); } } otherp = pfind(153); if (otherp) { for(i=0;i<1024;i++) { unsigned entry; entry = (unsigned) otherp->p_vmspace->vm_pmap.pm_pdir[i]; if (entry & PG_PS) { printf("4MB page: 0x%x(%x)\n", entry, i << 22); } } } return 0; } static int mycall(struct proc *p, void *uap, int *retval) { return ENODEV; } int newsyscall_mod(struct lkm_table *lkmtp, int cmd, int ver) { #if 0 DISPATCH(lkmtp, cmd, ver, load, unload, lkm_nullcmd) #endif MOD_DISPATCH(newsyscall_mod, lkmtp, cmd, ver, load, unload, lkm_nullcmd) #if 0 MOD_DISPATCH(newsyscall_mod, lkmtp, cmd, ver, newsyscall_load, lkm_nullcmd, lkm_nullcmd) #endif } static int unload(struct lkm_table *lkmtp, int cmd) { return 0; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message