agp.c (a163d034fadcfb4a25ca34a2ba5f491c47b6ff69) | agp.c (07159f9c56de91cb7d7bd6b6a795eebfee78133e) |
---|---|
1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 708 unchanged lines hidden (view full) --- 717 return agp_unbind_user(dev, (agp_unbind *)data); 718 719 } 720 721 return EINVAL; 722} 723 724static int | 1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 708 unchanged lines hidden (view full) --- 717 return agp_unbind_user(dev, (agp_unbind *)data); 718 719 } 720 721 return EINVAL; 722} 723 724static int |
725agp_mmap(dev_t kdev, vm_offset_t offset, int prot) | 725agp_mmap(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, int prot) |
726{ 727 device_t dev = KDEV2DEV(kdev); 728 struct agp_softc *sc = device_get_softc(dev); 729 730 if (offset > AGP_GET_APERTURE(dev)) 731 return -1; | 726{ 727 device_t dev = KDEV2DEV(kdev); 728 struct agp_softc *sc = device_get_softc(dev); 729 730 if (offset > AGP_GET_APERTURE(dev)) 731 return -1; |
732 return atop(rman_get_start(sc->as_aperture) + offset); | 732 *paddr = rman_get_start(sc->as_aperture) + offset; 733 return 0; |
733} 734 735/* Implementation of the kernel api */ 736 737device_t 738agp_find_device() 739{ 740 if (!agp_devclass) --- 76 unchanged lines hidden --- | 734} 735 736/* Implementation of the kernel api */ 737 738device_t 739agp_find_device() 740{ 741 if (!agp_devclass) --- 76 unchanged lines hidden --- |