Added support for building as modules or as part of monolithic kernel

main
Rik Faith 2000-07-20 00:48:12 +00:00
parent 1d3c4d2ed2
commit c459c9ead3
11 changed files with 122 additions and 261 deletions

View File

@ -127,6 +127,14 @@ typedef struct wait_queue *wait_queue_head_t;
#endif
#ifndef NOPAGE_OOM
#define NOPAGE_OOM 0
#endif
/* module_init/module_exit added in 2.3.13 */
#ifndef module_init
#define module_init(x) int init_module(void) { return x(); }
#endif
#ifndef module_exit
#define module_exit(x) void cleanup_module(void) { x(); }
#endif
/* Generic cmpxchg added in 2.3.x */

View File

@ -123,47 +123,29 @@ static drm_ioctl_desc_t i810_ioctls[] = {
#define I810_IOCTL_COUNT DRM_ARRAY_SIZE(i810_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *i810 = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("Intel I810");
MODULE_PARM(i810, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
DRM_DEBUG("doing i810_init()\n");
return i810_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
i810_cleanup();
}
#endif
module_init(i810_init);
module_exit(i810_cleanup);
#ifndef MODULE
/* i810_setup 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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* i810_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.
*/
void __init i810_setup(char *str, int *ints)
static int __init i810_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("i810=", i810_options);
#endif
static int i810_setup(drm_device_t *dev)

View File

@ -122,47 +122,29 @@ static drm_ioctl_desc_t mga_ioctls[] = {
#define MGA_IOCTL_COUNT DRM_ARRAY_SIZE(mga_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *mga = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("Matrox g200/g400");
MODULE_PARM(mga, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
DRM_DEBUG("doing mga_init()\n");
return mga_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
mga_cleanup();
}
#endif
module_init(mga_init);
module_exit(mga_cleanup);
#ifndef MODULE
/* mga_setup is called by the kernel to parse command-line options passed
/* mga_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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
*/
void __init mga_setup(char *str, int *ints)
static int __init mga_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("mga=", mga_options);
#endif
static int mga_setup(drm_device_t *dev)

View File

@ -118,46 +118,29 @@ static drm_ioctl_desc_t r128_ioctls[] = {
#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *r128 = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("r128");
MODULE_PARM(r128, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
return r128_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
r128_cleanup();
}
#endif
module_init(r128_init);
module_exit(r128_cleanup);
#ifndef MODULE
/* r128_setup 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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* r128_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.
*/
void __init r128_setup(char *str, int *ints)
static int __init r128_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("r128=", r128_options);
#endif
static int r128_setup(drm_device_t *dev)

View File

@ -106,46 +106,29 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *tdfx = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("tdfx");
MODULE_PARM(tdfx, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
return tdfx_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
tdfx_cleanup();
}
#endif
module_init(tdfx_init);
module_exit(tdfx_cleanup);
#ifndef MODULE
/* tdfx_setup 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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* tdfx_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.
*/
void __init tdfx_setup(char *str, int *ints)
static int __init tdfx_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("tdfx=", tdfx_options);
#endif
static int tdfx_setup(drm_device_t *dev)

View File

@ -127,6 +127,14 @@ typedef struct wait_queue *wait_queue_head_t;
#endif
#ifndef NOPAGE_OOM
#define NOPAGE_OOM 0
#endif
/* module_init/module_exit added in 2.3.13 */
#ifndef module_init
#define module_init(x) int init_module(void) { return x(); }
#endif
#ifndef module_exit
#define module_exit(x) void cleanup_module(void) { x(); }
#endif
/* Generic cmpxchg added in 2.3.x */

View File

@ -110,49 +110,34 @@ static drm_ioctl_desc_t gamma_ioctls[] = {
#define GAMMA_IOCTL_COUNT DRM_ARRAY_SIZE(gamma_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *gamma = NULL;
static int devices = 0;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("3dlabs GMX 2000");
MODULE_PARM(gamma, "s");
MODULE_PARM(devices, "i");
MODULE_PARM_DESC(devices, "devices=x, where x is the number of MX chips on your card\n");
MODULE_PARM_DESC(devices,
"devices=x, where x is the number of MX chips on card\n");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
return gamma_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
gamma_cleanup();
}
#endif
module_init(gamma_init);
module_exit(gamma_cleanup);
#ifndef MODULE
/* gamma_setup 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_options.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* gamma_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_options.
*/
void __init gamma_setup(char *str, int *ints)
static int __init gamma_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("gamma=", gamma_options);
#endif
static int gamma_setup(drm_device_t *dev)

View File

@ -123,47 +123,29 @@ static drm_ioctl_desc_t i810_ioctls[] = {
#define I810_IOCTL_COUNT DRM_ARRAY_SIZE(i810_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *i810 = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("Intel I810");
MODULE_PARM(i810, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
DRM_DEBUG("doing i810_init()\n");
return i810_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
i810_cleanup();
}
#endif
module_init(i810_init);
module_exit(i810_cleanup);
#ifndef MODULE
/* i810_setup 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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* i810_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.
*/
void __init i810_setup(char *str, int *ints)
static int __init i810_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("i810=", i810_options);
#endif
static int i810_setup(drm_device_t *dev)

View File

@ -122,47 +122,29 @@ static drm_ioctl_desc_t mga_ioctls[] = {
#define MGA_IOCTL_COUNT DRM_ARRAY_SIZE(mga_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *mga = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("Matrox g200/g400");
MODULE_PARM(mga, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
DRM_DEBUG("doing mga_init()\n");
return mga_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
mga_cleanup();
}
#endif
module_init(mga_init);
module_exit(mga_cleanup);
#ifndef MODULE
/* mga_setup is called by the kernel to parse command-line options passed
/* mga_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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
*/
void __init mga_setup(char *str, int *ints)
static int __init mga_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("mga=", mga_options);
#endif
static int mga_setup(drm_device_t *dev)

View File

@ -118,46 +118,29 @@ static drm_ioctl_desc_t r128_ioctls[] = {
#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *r128 = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("r128");
MODULE_PARM(r128, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
return r128_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
r128_cleanup();
}
#endif
module_init(r128_init);
module_exit(r128_cleanup);
#ifndef MODULE
/* r128_setup 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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* r128_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.
*/
void __init r128_setup(char *str, int *ints)
static int __init r128_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("r128=", r128_options);
#endif
static int r128_setup(drm_device_t *dev)

View File

@ -106,46 +106,29 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
#ifdef MODULE
int init_module(void);
void cleanup_module(void);
static char *tdfx = NULL;
#endif
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
MODULE_AUTHOR("VA Linux Systems, Inc.");
MODULE_DESCRIPTION("tdfx");
MODULE_PARM(tdfx, "s");
/* init_module is called when insmod is used to load the module */
int init_module(void)
{
return tdfx_init();
}
/* cleanup_module is called when rmmod is used to unload the module */
void cleanup_module(void)
{
tdfx_cleanup();
}
#endif
module_init(tdfx_init);
module_exit(tdfx_cleanup);
#ifndef MODULE
/* tdfx_setup 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.
*
* This is not currently supported, since it requires changes to
* linux/init/main.c. */
/* tdfx_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.
*/
void __init tdfx_setup(char *str, int *ints)
static int __init tdfx_options(char *str, int *ints)
{
if (ints[0] != 0) {
DRM_ERROR("Illegal command line format, ignored\n");
return;
}
drm_parse_options(str);
return 1;
}
__setup("tdfx=", tdfx_options);
#endif
static int tdfx_setup(drm_device_t *dev)