Skip to content

Commit

Permalink
[PATCH] uml: cross-build support : mk_task and mk_constants
Browse files Browse the repository at this point in the history
helpers in arch/um/util (mk_task and mk_constants) converted.  That's it -
none of the helpers depends on build and target being the same architecture
anymore.

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed May 5, 2005
1 parent 2b8b611 commit da998a2
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 88 deletions.
2 changes: 1 addition & 1 deletion arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ $(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants: $(ARCH_DIR)/include/user

$(ARCH_DIR)/kernel/skas/util/mk_ptregs: $(ARCH_DIR)/kernel/skas/util FORCE ;

$(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h FORCE
$(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h $(ARCH_DIR)/kernel-offsets.h FORCE
$(Q)$(MAKE) $(build)=$@

$(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
Expand Down
7 changes: 2 additions & 5 deletions arch/um/util/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
hostprogs-y := mk_task mk_constants
always := $(hostprogs-y)

mk_task-objs := mk_task_user.o mk_task_kern.o
mk_constants-objs := mk_constants_user.o mk_constants_kern.o

HOSTCFLAGS_mk_task_kern.o := $(CFLAGS) $(CPPFLAGS)
HOSTCFLAGS_mk_constants_kern.o := $(CFLAGS) $(CPPFLAGS)
HOSTCFLAGS_mk_task.o := -I$(objtree)/arch/um
HOSTCFLAGS_mk_constants.o := -I$(objtree)/arch/um
32 changes: 32 additions & 0 deletions arch/um/util/mk_constants.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <stdio.h>
#include <kernel-offsets.h>

#define SHOW_INT(sym) printf("#define %s %d\n", #sym, sym)
#define SHOW_STR(sym) printf("#define %s %s\n", #sym, sym)

int main(int argc, char **argv)
{
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");

SHOW_INT(UM_KERN_PAGE_SIZE);

SHOW_STR(UM_KERN_EMERG);
SHOW_STR(UM_KERN_ALERT);
SHOW_STR(UM_KERN_CRIT);
SHOW_STR(UM_KERN_ERR);
SHOW_STR(UM_KERN_WARNING);
SHOW_STR(UM_KERN_NOTICE);
SHOW_STR(UM_KERN_INFO);
SHOW_STR(UM_KERN_DEBUG);

SHOW_INT(UM_NSEC_PER_SEC);
printf("\n");
printf("#endif\n");
return(0);
}
28 changes: 0 additions & 28 deletions arch/um/util/mk_constants_kern.c

This file was deleted.

28 changes: 0 additions & 28 deletions arch/um/util/mk_constants_user.c

This file was deleted.

18 changes: 9 additions & 9 deletions arch/um/util/mk_task_user.c → arch/um/util/mk_task.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#include <stdio.h>
#include <kernel-offsets.h>

void print(char *name, char *type, int offset)
void print_ptr(char *name, char *type, int offset)
{
printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
offset);
}

void print_ptr(char *name, char *type, int offset)
void print(char *name, char *type, int offset)
{
printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
offset);
}

void print_head(void)
int main(int argc, char **argv)
{
printf("/*\n");
printf(" * Generated by mk_task\n");
Expand All @@ -21,10 +22,9 @@ void print_head(void)
printf("#ifndef __TASK_H\n");
printf("#define __TASK_H\n");
printf("\n");
}

void print_tail(void)
{
print_ptr("TASK_REGS", "union uml_pt_regs", TASK_REGS);
print("TASK_PID", "int", TASK_PID);
printf("\n");
printf("#endif\n");
return(0);
}
17 changes: 0 additions & 17 deletions arch/um/util/mk_task_kern.c

This file was deleted.

0 comments on commit da998a2

Please sign in to comment.