Fixes that allow the modules to be built into the kernel

main
Jeff Hartmann 2001-07-23 20:25:38 +00:00
parent 5e8ba79eb6
commit 84a5e71087
15 changed files with 239 additions and 46 deletions

View File

@ -201,21 +201,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_PARM( drm_opts, "s" );
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
static int __init DRM(options)( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", DRM(options) );
#endif
static int DRM(setup)( drm_device_t *dev )
{
int i;

View File

@ -32,25 +32,25 @@
#define __NO_VERSION__
#include "drmP.h"
struct vm_operations_struct drm_vm_ops = {
struct vm_operations_struct DRM(vm_ops) = {
nopage: DRM(vm_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
};
struct vm_operations_struct drm_vm_shm_ops = {
struct vm_operations_struct DRM(vm_shm_ops) = {
nopage: DRM(vm_shm_nopage),
open: DRM(vm_open),
close: DRM(vm_shm_close),
};
struct vm_operations_struct drm_vm_dma_ops = {
struct vm_operations_struct DRM(vm_dma_ops) = {
nopage: DRM(vm_dma_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
};
struct vm_operations_struct drm_vm_sg_ops = {
struct vm_operations_struct DRM(vm_sg_ops) = {
nopage: DRM(vm_sg_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
@ -352,7 +352,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
}
unlock_kernel();
vma->vm_ops = &drm_vm_dma_ops;
vma->vm_ops = &DRM(vm_dma_ops);
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */
@ -446,10 +446,10 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
" offset = 0x%lx\n",
map->type,
vma->vm_start, vma->vm_end, VM_OFFSET(vma) + offset);
vma->vm_ops = &drm_vm_ops;
vma->vm_ops = &DRM(vm_ops);
break;
case _DRM_SHM:
vma->vm_ops = &drm_vm_shm_ops;
vma->vm_ops = &DRM(vm_shm_ops);
#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
#else
@ -460,7 +460,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_flags |= VM_LOCKED;
break;
case _DRM_SCATTER_GATHER:
vma->vm_ops = &drm_vm_sg_ops;
vma->vm_ops = &DRM(vm_sg_ops);
#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
#else

View File

@ -71,6 +71,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init i810_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", i810_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -70,6 +70,27 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init mga_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", mga_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -81,6 +81,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init r128_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", r128_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -78,6 +78,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init radeon_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", radeon_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -51,6 +51,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init tdfx_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", tdfx_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -201,21 +201,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_PARM( drm_opts, "s" );
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
static int __init DRM(options)( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", DRM(options) );
#endif
static int DRM(setup)( drm_device_t *dev )
{
int i;

View File

@ -32,25 +32,25 @@
#define __NO_VERSION__
#include "drmP.h"
struct vm_operations_struct drm_vm_ops = {
struct vm_operations_struct DRM(vm_ops) = {
nopage: DRM(vm_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
};
struct vm_operations_struct drm_vm_shm_ops = {
struct vm_operations_struct DRM(vm_shm_ops) = {
nopage: DRM(vm_shm_nopage),
open: DRM(vm_open),
close: DRM(vm_shm_close),
};
struct vm_operations_struct drm_vm_dma_ops = {
struct vm_operations_struct DRM(vm_dma_ops) = {
nopage: DRM(vm_dma_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
};
struct vm_operations_struct drm_vm_sg_ops = {
struct vm_operations_struct DRM(vm_sg_ops) = {
nopage: DRM(vm_sg_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
@ -352,7 +352,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
}
unlock_kernel();
vma->vm_ops = &drm_vm_dma_ops;
vma->vm_ops = &DRM(vm_dma_ops);
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */
@ -446,10 +446,10 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
" offset = 0x%lx\n",
map->type,
vma->vm_start, vma->vm_end, VM_OFFSET(vma) + offset);
vma->vm_ops = &drm_vm_ops;
vma->vm_ops = &DRM(vm_ops);
break;
case _DRM_SHM:
vma->vm_ops = &drm_vm_shm_ops;
vma->vm_ops = &DRM(vm_shm_ops);
#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
#else
@ -460,7 +460,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_flags |= VM_LOCKED;
break;
case _DRM_SCATTER_GATHER:
vma->vm_ops = &drm_vm_sg_ops;
vma->vm_ops = &DRM(vm_sg_ops);
#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
#else

View File

@ -62,6 +62,27 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init gamma_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", gamma_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -71,6 +71,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init i810_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", i810_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -70,6 +70,27 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init mga_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", mga_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -81,6 +81,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init r128_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", r128_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -78,6 +78,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init radeon_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", radeon_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"

View File

@ -51,6 +51,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
#ifndef MODULE
/* DRM(options) is called by the kernel to parse command-line options
* passed via the boot-loader (e.g., LILO). It calls the insmod option
* routine, drm_parse_drm.
*/
/* JH- We have to hand expand the string ourselves because of the cpp. If
* anyone can think of a way that we can fit into the __setup macro without
* changing it, then please send the solution my way.
*/
static int __init tdfx_options( char *str )
{
DRM(parse_options)( str );
return 1;
}
__setup( DRIVER_NAME "=", tdfx_options );
#endif
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"