Commit bc758b0a authored by Jeff Dike's avatar Jeff Dike

Added mode.h, mk_constants_kern.c, mk_constants_user.c, and um_mmu.h

parent 9641b8e6
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#ifndef __MODE_H__
#define __MODE_H__
#include "uml-config.h"
#ifdef CONFIG_MODE_TT
#include "../kernel/tt/include/mode.h"
#endif
#ifdef CONFIG_MODE_SKAS
#include "../kernel/skas/include/mode.h"
#endif
#endif
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#ifndef __ARCH_UM_MMU_H
#define __ARCH_UM_MMU_H
#include "linux/config.h"
#include "choose-mode.h"
#ifdef CONFIG_MODE_TT
#include "../kernel/tt/include/mmu.h"
#endif
#ifdef CONFIG_MODE_SKAS
#include "../kernel/skas/include/mmu.h"
#endif
typedef union {
#ifdef CONFIG_MODE_TT
struct mmu_context_tt tt;
#endif
#ifdef CONFIG_MODE_SKAS
struct mmu_context_skas skas;
#endif
} mm_context_t;
#endif
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
#include "linux/kernel.h"
#include "linux/stringify.h"
#include "asm/page.h"
extern void print_head(void);
extern void print_constant_str(char *name, char *value);
extern void print_constant_int(char *name, int value);
extern void print_tail(void);
int main(int argc, char **argv)
{
print_head();
print_constant_int("UM_KERN_PAGE_SIZE", PAGE_SIZE);
print_constant_str("UM_KERN_EMERG", KERN_EMERG);
print_constant_str("UM_KERN_ALERT", KERN_ALERT);
print_constant_str("UM_KERN_CRIT", KERN_CRIT);
print_constant_str("UM_KERN_ERR", KERN_ERR);
print_constant_str("UM_KERN_WARNING", KERN_WARNING);
print_constant_str("UM_KERN_NOTICE", KERN_NOTICE);
print_constant_str("UM_KERN_INFO", KERN_INFO);
print_constant_str("UM_KERN_DEBUG", KERN_DEBUG);
print_tail();
return(0);
}
#include <stdio.h>
void print_head(void)
{
printf("/*\n");
printf(" * Generated by mk_constants\n");
printf(" */\n");
printf("\n");
printf("#ifndef __UM_CONSTANTS_H\n");
printf("#define __UM_CONSTANTS_H\n");
printf("\n");
}
void print_constant_str(char *name, char *value)
{
printf("#define %s \"%s\"\n", name, value);
}
void print_constant_int(char *name, int value)
{
printf("#define %s %d\n", name, value);
}
void print_tail(void)
{
printf("\n");
printf("#endif\n");
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment