Commit 00274a13 authored by Rob Pike's avatar Rob Pike

rename libmach_amd64 libmach

R=rsc
OCL=33273
CL=33276
parent ce1dd6cc
...@@ -29,15 +29,7 @@ ...@@ -29,15 +29,7 @@
/* /*
* Architecture-dependent application data * Architecture-dependent application data
* This is just Plan 9's mach.h, tweaked to support only amd64 for now.
*/ */
/*
* Start of Plan 9 a.out.h
* Don't use system a.out; instead just lay in the Plan 9 one for now.
*/
/*
#include "a.out.h"
*/
typedef struct Exec Exec; typedef struct Exec Exec;
struct Exec struct Exec
...@@ -87,10 +79,6 @@ struct Sym ...@@ -87,10 +79,6 @@ struct Sym
vlong gotype; vlong gotype;
int sequence; // order in file int sequence; // order in file
}; };
/*
* End of Plan 9 a.out.h
* Don't use system a.out; instead just lay in the Plan 9 one for now.
*/
/* /*
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
rm -rf $GOROOT/pkg/[0-9a-zA-Z_]* rm -rf $GOROOT/pkg/[0-9a-zA-Z_]*
rm -f $GOROOT/lib/*.[6a] rm -f $GOROOT/lib/*.[6a]
for i in lib9 libbio libmach_amd64 libregexp cmd pkg for i in lib9 libbio libmach libregexp cmd pkg
do do
cd $i cd $i
case $i in case $i in
......
...@@ -13,7 +13,7 @@ OFILES=\ ...@@ -13,7 +13,7 @@ OFILES=\
ar.$O\ ar.$O\
$(TARG): $(OFILES) $(TARG): $(OFILES)
$(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lbio -l9 $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lbio -l9
clean: clean:
rm -f $(OFILES) $(TARG) rm -f $(OFILES) $(TARG)
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#include <ar.h> #include <ar.h>
#undef select #undef select
......
...@@ -17,7 +17,7 @@ HFILES=\ ...@@ -17,7 +17,7 @@ HFILES=\
tree.h\ tree.h\
$(TARG): $(OFILES) $(TARG): $(OFILES)
$(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lregexp9 -lbio -l9 $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lregexp9 -lbio -l9
clean: clean:
rm -f $(OFILES) $(TARG) rm -f $(OFILES) $(TARG)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "tree.h" #include "tree.h"
#include <ureg_amd64.h> #include <ureg_amd64.h>
#include <mach_amd64.h> #include <mach.h>
typedef struct Ureg Ureg; typedef struct Ureg Ureg;
void void
......
...@@ -13,7 +13,7 @@ OFILES=\ ...@@ -13,7 +13,7 @@ OFILES=\
nm.$O\ nm.$O\
$(TARG): $(OFILES) $(TARG): $(OFILES)
$(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lbio -l9 $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lbio -l9
clean: clean:
rm -f $(OFILES) $(TARG) rm -f $(OFILES) $(TARG)
......
// Inferno utils/nm/nm.c // Inferno utils/nm/nm.c
// http://code.google.com/p/inferno-os/source/browse/utils/nm/nm.c // http://code.google.com/p/inferno-os/source/browse/utils/nm/nm.c
// //
// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2004,2006 Bruce Ellis // Portions Copyright © 2004,2006 Bruce Ellis
// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
// Portions Copyright © 2009 The Go Authors. All rights reserved. // Portions Copyright © 2009 The Go Authors. All rights reserved.
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights // in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is // copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: // furnished to do so, subject to the following conditions:
// //
// The above copyright notice and this permission notice shall be included in // The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software. // all copies or substantial portions of the Software.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <libc.h> #include <libc.h>
#include <ar.h> #include <ar.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
enum{ enum{
CHUNK = 256 /* must be power of 2 */ CHUNK = 256 /* must be power of 2 */
......
...@@ -17,7 +17,7 @@ OFILES=\ ...@@ -17,7 +17,7 @@ OFILES=\
# fns.h\ # fns.h\
$(TARG): $(OFILES) $(TARG): $(OFILES)
$(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lbio -l9 $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lbio -l9
clean: clean:
rm -f $(OFILES) $(TARG) rm -f $(OFILES) $(TARG)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <ctype.h> #include <ctype.h>
#include <ureg_amd64.h> #include <ureg_amd64.h>
#include <mach_amd64.h> #include <mach.h>
char* file = "6.out"; char* file = "6.out";
static Fhdr fhdr; static Fhdr fhdr;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#include "../cmd/5l/5.out.h" #include "../cmd/5l/5.out.h"
#include "obj.h" #include "obj.h"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include "ureg_amd64.h" #include "ureg_amd64.h"
#include <mach_amd64.h> #include <mach.h>
#define REGOFF(x) offsetof(struct Ureg, x) #define REGOFF(x) offsetof(struct Ureg, x)
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#include "../cmd/6l/6.out.h" #include "../cmd/6l/6.out.h"
#include "obj.h" #include "obj.h"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <u.h> #include <u.h>
#include <bio.h> #include <bio.h>
#include <ureg_x86.h> #include <ureg_x86.h>
#include <mach_amd64.h> #include <mach.h>
#define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x) #define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x)
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#define Ureg UregAmd64 #define Ureg UregAmd64
#include <ureg_amd64.h> #include <ureg_amd64.h>
#undef Ureg #undef Ureg
...@@ -226,7 +226,7 @@ i386trace(Map *map, uvlong pc, uvlong sp, uvlong link, Tracer trace) ...@@ -226,7 +226,7 @@ i386trace(Map *map, uvlong pc, uvlong sp, uvlong link, Tracer trace)
findsym(pc, CTEXT, &s); findsym(pc, CTEXT, &s);
(*trace)(map, pc, sp, &s1); // morestack's caller; caller's caller's PC/SP (*trace)(map, pc, sp, &s1); // morestack's caller; caller's caller's PC/SP
continue; continue;
} }
if(pc == lessstack) { if(pc == lessstack) {
// ../pkg/runtime/runtime.h // ../pkg/runtime/runtime.h
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#include "../cmd/8l/8.out.h" #include "../cmd/8l/8.out.h"
#include "obj.h" #include "obj.h"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
include ../Make.conf include ../Make.conf
LIB=libmach_amd64.a LIB=libmach.a
OFILES=\ OFILES=\
executable.$O\ executable.$O\
fakeobj.$O\ fakeobj.$O\
...@@ -46,32 +46,8 @@ OFILES=\ ...@@ -46,32 +46,8 @@ OFILES=\
6obj.$O\ 6obj.$O\
8obj.$O\ 8obj.$O\
$(GOOS).$O\ $(GOOS).$O\
# v.$O\
# k.$O\
# u.$O\
# q.$O\
# 0.$O\
# 2.$O\
# 5.$O\
# 7.$O\
# 9.$O\
# vdb.$O\
# kdb.$O\
# udb.$O\
# qdb.$O\
# 2db.$O\
# 5db.$O\
# 7db.$O\
# vobj.$O\
# kobj.$O\
# uobj.$O\
# 2obj.$O\
# 7obj.$O\
# 9obj.$O\
# qobj.$O\
# vcodas.$O\
HFILES=$(GOROOT)/include/mach_amd64.h elf.h macho.h obj.h HFILES=$(GOROOT)/include/mach.h elf.h macho.h obj.h
install: $(LIB) install: $(LIB)
cp $(LIB) $(GOROOT)/lib cp $(LIB) $(GOROOT)/lib
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
static int mget(Map*, uvlong, void*, int); static int mget(Map*, uvlong, void*, int);
static int mput(Map*, uvlong, void*, int); static int mput(Map*, uvlong, void*, int);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <errno.h> #include <errno.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#define Ureg Ureg32 #define Ureg Ureg32
#include <ureg_x86.h> #include <ureg_x86.h>
#undef Ureg #undef Ureg
......
// Inferno libmach/executable.c // Inferno libmach/executable.c
// http://code.google.com/p/inferno-os/source/browse/utils/libmach/executable.c // http://code.google.com/p/inferno-os/source/browse/utils/libmach/executable.c
// //
// Copyright © 1994-1999 Lucent Technologies Inc. // Copyright © 1994-1999 Lucent Technologies Inc.
// Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net). // Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net).
// Portions Copyright © 1997-1999 Vita Nuova Limited. // Portions Copyright © 1997-1999 Vita Nuova Limited.
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).
// Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others. // Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others.
// Portions Copyright © 2009 The Go Authors. All rights reserved. // Portions Copyright © 2009 The Go Authors. All rights reserved.
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <bootexec.h> #include <bootexec.h>
#include <mach_amd64.h> #include <mach.h>
#include "elf.h" #include "elf.h"
#include "macho.h" #include "macho.h"
...@@ -268,7 +268,7 @@ ExecTable exectab[] = ...@@ -268,7 +268,7 @@ ExecTable exectab[] =
sizeof(Machhdr), sizeof(Machhdr),
nil, nil,
machdotout }, machdotout },
{ MACH32_MAG, /* 64-bit MACH (apple mac) */ { MACH32_MAG, /* 32-bit MACH (apple mac) */
"mach executable", "mach executable",
nil, nil,
FI386, FI386,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <ar.h> #include <ar.h>
#include <mach_amd64.h> #include <mach.h>
#include "obj.h" #include "obj.h"
int _is2(char* x) { return 0; } int _is2(char* x) { return 0; }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <errno.h> #include <errno.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#define Ureg Ureg32 #define Ureg Ureg32
#include <ureg_x86.h> #include <ureg_x86.h>
#undef Ureg #undef Ureg
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#define STARTSYM "_main" #define STARTSYM "_main"
#define PROFSYM "_mainp" #define PROFSYM "_mainp"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
Map * Map *
newmap(Map *map, int n) newmap(Map *map, int n)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <ar.h> #include <ar.h>
#include <mach_amd64.h> #include <mach.h>
#include "obj.h" #include "obj.h"
#define islocal(t) ((t)=='a' || (t)=='p') #define islocal(t) ((t)=='a' || (t)=='p')
...@@ -333,7 +333,7 @@ _offset(int id, vlong off) ...@@ -333,7 +333,7 @@ _offset(int id, vlong off)
/* /*
* update the type of a global text or data symbol * update the type of a global text or data symbol
*/ */
static void static void
objupdate(int id, int type) objupdate(int id, int type)
{ {
Sym *s; Sym *s;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
/* table for selecting machine-dependent parameters */ /* table for selecting machine-dependent parameters */
typedef struct machtab Machtab; typedef struct machtab Machtab;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
#include <mach_amd64.h> #include <mach.h>
#define HUGEINT 0x7fffffff #define HUGEINT 0x7fffffff
#define NNAME 20 /* a relic of the past */ #define NNAME 20 /* a relic of the past */
......
...@@ -19,7 +19,7 @@ rm -f $GOBIN/quietgcc ...@@ -19,7 +19,7 @@ rm -f $GOBIN/quietgcc
cp quietgcc.bash $GOBIN/quietgcc cp quietgcc.bash $GOBIN/quietgcc
chmod +x $GOBIN/quietgcc chmod +x $GOBIN/quietgcc
for i in lib9 libbio libmach_amd64 libregexp cmd pkg cmd/ebnflint cmd/godoc cmd/gofmt for i in lib9 libbio libmach libregexp cmd pkg cmd/ebnflint cmd/godoc cmd/gofmt
do do
# The ( ) here are to preserve the current directory # The ( ) here are to preserve the current directory
# for the next round despite the cd $i below. # for the next round despite the cd $i below.
......
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