From e407c527e1514e6fd27456153e205531cd17d60c Mon Sep 17 00:00:00 2001 From: Aurlien Larcher Date: Sun, 23 Oct 2016 03:57:20 +0200 Subject: Setup tree for mdb modules (import cmd/mdb Makefiles from illumos-gate) --- usr/src/cmd/Makefile | 16 +-- usr/src/cmd/mdb/Makefile | 59 ++++++++++ usr/src/cmd/mdb/Makefile.amd64 | 61 ++++++++++ usr/src/cmd/mdb/Makefile.ia32 | 52 +++++++++ usr/src/cmd/mdb/Makefile.module | 246 +++++++++++++++++++++++++++++++++++++++ usr/src/cmd/mdb/Makefile.sparcv7 | 50 ++++++++ usr/src/cmd/mdb/Makefile.sparcv9 | 71 +++++++++++ usr/src/cmd/mdb/Makefile.subdirs | 49 ++++++++ usr/src/cmd/mdb/Makefile.tools | 32 +++++ usr/src/cmd/mdb/README | 19 +++ usr/src/cmd/mdb/mapfile | 49 ++++++++ usr/src/cmd/mdb/mapfile-extern | 175 ++++++++++++++++++++++++++++ 12 files changed, 866 insertions(+), 13 deletions(-) create mode 100644 usr/src/cmd/mdb/Makefile create mode 100644 usr/src/cmd/mdb/Makefile.amd64 create mode 100644 usr/src/cmd/mdb/Makefile.ia32 create mode 100644 usr/src/cmd/mdb/Makefile.module create mode 100644 usr/src/cmd/mdb/Makefile.sparcv7 create mode 100644 usr/src/cmd/mdb/Makefile.sparcv9 create mode 100644 usr/src/cmd/mdb/Makefile.subdirs create mode 100644 usr/src/cmd/mdb/Makefile.tools create mode 100644 usr/src/cmd/mdb/README create mode 100644 usr/src/cmd/mdb/mapfile create mode 100644 usr/src/cmd/mdb/mapfile-extern diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile index f68975e..febdcb8 100644 --- a/usr/src/cmd/Makefile +++ b/usr/src/cmd/Makefile @@ -25,18 +25,7 @@ include ../Makefile.master # -# Note that the commands 'agents', 'lp', 'perl', and 'man' are first in -# the list, violating alphabetical order. This is because they are very -# long-running and should be given the most wall-clock time for a -# parallel build. -# -# Commands in the FIRST_SUBDIRS list are built before starting the build -# of other commands. Currently this includes only 'isaexec' and -# 'platexec'. This is necessary because $(ROOT)/usr/lib/isaexec or -# $(ROOT)/usr/lib/platexec must exist when some other commands are built -# because their 'make install' creates a hard link to one of them. -# -# Commands are listed one per line so that TeamWare can auto-merge most +# Commands are listed one per line so that SCM systems can auto-merge most # changes. # @@ -44,7 +33,8 @@ FIRST_SUBDIRS= COMMON_SUBDIRS= \ foo \ - fs.d + fs.d \ + mdb i386_SUBDIRS= diff --git a/usr/src/cmd/mdb/Makefile b/usr/src/cmd/mdb/Makefile new file mode 100644 index 0000000..cbb448a --- /dev/null +++ b/usr/src/cmd/mdb/Makefile @@ -0,0 +1,59 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +include $(SRC)/Makefile.master + +.KEEP_STATE: + +sparc_SUBDIRS = +i386_SUBDIRS = + +SUBDIRS = $($(MACH)_SUBDIRS) +TARGET = + +all := TARGET = all +clean.lint := TARGET = clean.lint +clean := TARGET = clean +clobber := TARGET = clobber +dmods := TARGET = dmods +install := TARGET = install +install_h := TARGET = install_h +lint := TARGET = lint + +all lint: $(SUBDIRS) + +dmods install: $(SUBDIRS) + +install_h: + +clean.lint clean: $(SUBDIRS) + +clobber: $(SUBDIRS) + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: diff --git a/usr/src/cmd/mdb/Makefile.amd64 b/usr/src/cmd/mdb/Makefile.amd64 new file mode 100644 index 0000000..c030a0f --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.amd64 @@ -0,0 +1,61 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +MACHDIR=amd64 +MACHMODDIR=/$(MACHDIR) + +ROOTMOD = $(ROOT)/usr/lib/mdb/$(MDBTGT)$(MACHMODDIR) +ROOTKMOD = $(ROOT)/kernel/kmdb$(MACHMODDIR) + +CFLAGS += $(CTF_FLAGS) $(XSTRCONST) +CFLAGS64 += $(CTF_FLAGS) $(XSTRCONST) +CPPFLAGS += -D_ELF64 +CTFSTABSCFLAGS = $(CFLAGS64) + +LINTTAGS = E_BAD_FORMAT_STR2,E_BAD_FORMAT_ARG_TYPE2 +LINTFLAGS64 += -u -erroff=$(LINTTAGS) +LINTFLAGS = $(LINTFLAGS64) + +LFLAGS = -t -v +YFLAGS = -d -v + +# +# Dummy `all' target to force `all' to be the first target, so that +# a `make' will `make all'. +# +all: + +$$(ROOTMOD)/%: dmod/% + $(INS.file) + +$$(ROOTKMOD)/%: kmod/% + $(INS.file) + +$(ROOTMOD): $(ROOT)/usr/lib/mdb/$(MDBTGT) + $(INS.dir) + +$(ROOTKMOD): $(ROOT)/kernel/kmdb + $(INS.dir) diff --git a/usr/src/cmd/mdb/Makefile.ia32 b/usr/src/cmd/mdb/Makefile.ia32 new file mode 100644 index 0000000..366ab15 --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.ia32 @@ -0,0 +1,52 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +MACHDIR=i386 + +ROOTMOD = $(ROOT)/usr/lib/mdb/$(MDBTGT) +ROOTKMOD = $(ROOT)/kernel/kmdb + +CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) +CTFSTABSCFLAGS = $(CFLAGS) +LINTTAGS = E_BAD_FORMAT_STR2,E_BAD_FORMAT_ARG_TYPE2 +LINTFLAGS += -u -erroff=$(LINTTAGS) + +LFLAGS = -t -v +YFLAGS = -d -v + +# +# Dummy `all' target to force `all' to be the first target, so that +# a `make' will `make all'. +# +all: + +$$(ROOTMOD)/%: dmod/% + $(INS.file) + +$$(ROOTKMOD)/%: kmod/% + $(INS.file) + +$(ROOTMOD): $(ROOT)/usr/lib/mdb diff --git a/usr/src/cmd/mdb/Makefile.module b/usr/src/cmd/mdb/Makefile.module new file mode 100644 index 0000000..01f3fd8 --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.module @@ -0,0 +1,246 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright 2015, Joyent, Inc. +# + +.KEEP_STATE: +.SUFFIXES: + +include $(SRC)/cmd/mdb/Makefile.tools + +$(KMOD_SOURCES_DIFFERENT)KMODSRCS = $(MODSRCS) +$(KMOD_SOURCES_DIFFERENT)KMODASMSRCS = $(MODASMSRCS) + +MODOBJS = $(MODSRCS:%.c=dmod/%.o) $(MODASMSRCS:%.s=dmod/%.o) +KMODOBJS = $(KMODSRCS:%.c=kmod/%.o) $(KMODASMSRCS:%.s=kmod/%.o) + +MODNAME = $(MODULE:%.so=%) +KMODULE = $(MODNAME) + +MODFILE = dmod/$(MODULE) +KMODFILE = kmod/$(KMODULE) + +# +# The mess below is designed to pick the right set of objects to build and/or +# lint. We have three flavors: +# +# 1. proc and raw modules. Only $(MODOBJS) are built. +# 2. kvm modules for systems without kmdb. Only $(MODOBJS) are built. +# 3. kvm modules for systems with kmdb. $(MODOBJS) and $(KMODOBJS) are built. +# +# Complicating matters, we'd like to make the distinction between 2 and 3 before +# this Makefile is loaded. By default, we'll assume that all kvm modules should +# be built for kmdb. If, however, the user sets $(MODULE_BUILD_TYPE) to `mdb', +# the kmdb variant of the module won't be built. +# + +# Which flavors are to be built? +TARGETS_kvm_type_ = both # Build both if $(MODULE_BUILD_TYPE) is unset +TARGETS_kvm_type_kmdb = both +TARGETS_kvm_type_mdb = mdb +TARGETS_kvm_type = $(TARGETS_kvm_type_$(MODULE_BUILD_TYPE)) + +# What should we build? +TARGETS_kvm_kmdb = $(KMODFILE) +TARGETS_kvm_mdb = $(MODFILE) +TARGETS_kvm_both = $(TARGETS_kvm_mdb) $(TARGETS_kvm_kmdb) +TARGETS_kvm = $(TARGETS_kvm_$(TARGETS_kvm_type)) +TARGETS_proc = $(MODFILE) +TARGETS_raw = $(MODFILE) +TARGETS = $(TARGETS_$(MDBTGT)) + +# Where should we install that which we've built? +ROOTTGTS_kvm_type = $(TARGETS_kvm_type) # overridden by mdb_ks +ROOTTGTS_kvm_kmdb = $(ROOTKMOD)/$(KMODULE) +ROOTTGTS_kvm_mdb = $(ROOTMOD)/$(MODULE) +ROOTTGTS_kvm_both = $(ROOTTGTS_kvm_mdb) $(ROOTTGTS_kvm_kmdb) +ROOTTGTS_kvm = $(ROOTTGTS_kvm_$(ROOTTGTS_kvm_type)) +ROOTTGTS_proc = $(ROOTMOD)/$(MODULE) +ROOTTGTS_raw = $(ROOTMOD)/$(MODULE) +ROOTTGTS = $(ROOTTGTS_$(MDBTGT)) + +# What should we lint? +KLINTOBJS = $(KMODOBJS:%.o=%.ln) +LINTOBJS = $(MODOBJS:%.o=%.ln) + +LINTFILES_kvm_type = $(TARGETS_kvm_type) +LINTFILES_kvm_both = $(KLINTOBJS) $(LINTOBJS) +LINTFILES_kvm_mdb = $(LINTOBJS) +LINTFILES_kvm = $(LINTFILES_kvm_$(LINTFILES_kvm_type)) +LINTFILES_proc = $(LINTOBJS) +LINTFILES_raw = $(LINTOBJS) +LINTFILES = $(LINTFILES_$(MDBTGT)) + +kvm_TGTFLAGS = -D_KERNEL +proc_TGTFLAGS = -D_USER + +C99MODE = $(C99_ENABLE) + +CFLAGS += $(CCVERBOSE) +CFLAGS64 += $(CCVERBOSE) +CPPFLAGS += $($(MDBTGT)_TGTFLAGS) -I../../../common +LDFLAGS += $(ZTEXT) +LDFLAGS64 += $(ZTEXT) +ASFLAGS += -P +AS_CPPFLAGS += -D_ASM + +# Module type-specific compiler flags +$(MODOBJS) := CFLAGS += $(C_BIGPICFLAGS) $(XREGSFLAG) +$(MODOBJS) := CFLAGS64 += $(C_BIGPICFLAGS) $(XREGSFLAG) +$(KMODOBJS) $(KLINTOBJS) := CPPFLAGS += -D_KMDB +$(KMODOBJS) := V9CODESIZE = $(CCABS32) +$(KMODOBJS) := DTS_ERRNO = + +# Modules aren't allowed to export symbols +MAPFILE = $(SRC)/cmd/mdb/mapfile + +# Modules typically make external references. To provide for -zdefs use +# and clean ldd(1) processing, explicitly define all external references. +MAPFILE-EXT = $(SRC)/cmd/mdb/mapfile-extern + +# +# kmdb is a kernel module, so we'll use the kernel's build flags. +$(KMODOBJS) := CFLAGS += $(STAND_FLAGS_32) +$(KMODOBJS) := CFLAGS64 += $(STAND_FLAGS_64) + +# +# Override this to pull source files from another directory +# + +all: $$(TARGETS) + +install: all $$(ROOTTGTS) + +dmods: install + +clean.lint: + $(RM) $(LINTFILES) $(MODSRCS:.c=.ln) + +clean: + $(RM) $(MODOBJS) $(KMODOBJS) $(CLEANFILES) + +clobber: clean clean.lint + $(RM) $(MODFILE) $(KMODFILE) $(CLOBBERFILES) + +lint: $$(LINTFILES) + +.NO_PARALLEL: +.PARALLEL: $(MODOBJS) $(KMODOBJS) mdb_tgt kmdb_tgt dmod kmod \ + $(TARGETS) $(LINTFILES) + +$(MODFILE): dmod .WAIT $(MODOBJS) $$(MAPFILE-EXT) + $(LINK.c) $(ZDEFS) $(ZIGNORE) $(MAPFILE-EXT:%=-M%) $(GSHARED) \ + $(MODOBJS) -o $@ $(LDLIBS) -lc + $(CTFMERGE) -L VERSION -o $@ $(MODOBJS) + $(POST_PROCESS_SO) + +# +# See LINKTEST in illumos-gate $SRC/cmd/mdb/Makefile.module +# Not implemented here. +# + +KMDB_LINKTEST = echo linktest not implemented + +KMDB_LINKTEST_ENABLE=$(POUND_SIGN) +$(KMDB_LINKTEST_ENABLE)KMDB_LINKTEST_CMD = $(KMDB_LINKTEST) + +# +# Ensure that dmods don't use floating point +# +KMDB_FPTEST_CMD = $(KMDB_FPTEST) + +$(KMODFILE): kmod .WAIT $(KMODOBJS) $(MAPFILE) + $(LD) -dy -r $(MAPFILE:%=-M%) -Nmisc/kmdbmod -o $@ $(KMODOBJS) \ + $(STANDOBJS) + $(KMDB_LINKTEST_CMD) + $(KMDB_FPTEST_CMD) + $(CTFMERGE) -f -L VERSION -o $@ $(KMODOBJS) + $(POST_PROCESS) + $(SETDYNFLAG) -f DF_1_NOKSYMS $@ + +linktest: linktest_check .WAIT kmod .WAIT $(KMODOBJS) + $(KMDB_LINKTEST) + +linktest_check: + @if [ "$(MDBTGT)" != "kvm" ] ; then \ + echo "ERROR: linktest is not supported non-kvm/disasm dmods" \ + >&2 ; \ + exit 1 ; \ + fi + +# +# Dynamic rules for object construction +# +dmod/%.o kmod/%.o: %.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + +dmod/%.o kmod%.o: %.s + $(COMPILE.s) -o $@ $< + $(CTFCONVERT_O) + +dmod/%.o kmod/%.o: ../%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + +dmod/%.o kmod%.o: ../%.s + $(COMPILE.s) -o $@ $< + $(CTFCONVERT_O) + +# +# Lint +# +dmod/%.ln kmod/%.ln: %.c + $(LINT.c) -dirout=$(@D) -c $< + +dmod/%.ln kmod/%.ln: %.s + $(LINT.s) -dirout=$(@D) -c $< + +dmod/%.ln kmod/%.ln: ../%.c + $(LINT.c) -dirout=$(@D) -c $< + +dmod/%.ln kmod/%.ln: ../%.s + $(LINT.s) -dirout=$(@D) -c $< + +# +# Installation targets +# + +$(ROOT)/usr/lib/mdb/$(MDBTGT): $(ROOT)/usr/lib/mdb + $(INS.dir) + +$(ROOT)/usr/lib/mdb: + $(INS.dir) + +$(ROOT)/kernel/kmdb: + $(INS.dir) + +$(ROOTMOD)/$(MODULE): $(ROOTMOD) + +$(ROOTKMOD)/$(KMODULE): $(ROOTKMOD) + +kmod dmod: + -@mkdir -p $@ diff --git a/usr/src/cmd/mdb/Makefile.sparcv7 b/usr/src/cmd/mdb/Makefile.sparcv7 new file mode 100644 index 0000000..37d0b39 --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.sparcv7 @@ -0,0 +1,50 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +MACHDIR=sparc +MACHMODDIR= + +ROOTMOD = $(ROOT)/usr/lib/mdb/$(MDBTGT) + +$$(ROOTMOD)/%: dmod/% + $(INS.file) + +CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) -xstrconst +CTFSTABSCFLAGS = $(CFLAGS) $(CALLSYMS) +LINTFLAGS += -u -erroff=E_BAD_FORMAT_STR2,E_BAD_FORMAT_ARG_TYPE2 + +LFLAGS = -t -v +YFLAGS = -d -v + +# +# We don't support kmdb on v7 sparc, so we don't need kmdb versions of the +# v7 modules +# +MODULE_BUILD_TYPE = mdb + +# +# `all' target to force `all' to be the first target, so that +# a `make' will `make all'. +# +all: diff --git a/usr/src/cmd/mdb/Makefile.sparcv9 b/usr/src/cmd/mdb/Makefile.sparcv9 new file mode 100644 index 0000000..5bc7404 --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.sparcv9 @@ -0,0 +1,71 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +include $(SRC)/cmd/mdb/Makefile.tools + +MACHDIR=sparcv9 +MACHMODDIR=/$(MACHDIR) + +ROOTMOD = $(ROOT)/usr/lib/mdb/$(MDBTGT)$(MACHMODDIR) +ROOTKMOD = $(ROOT)/kernel/kmdb$(MACHMODDIR) + +CFLAGS = $(CTF_FLAGS) $(XSTRCONST) +CFLAGS64 += $(CTF_FLAGS) $(XSTRCONST) +CPPFLAGS += -D_ELF64 +CTFSTABSCFLAGS = $(CFLAGS64) $(CALLSYMS) + +LINTTAGS1 = E_BAD_FORMAT_STR2,E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2 +LINTTAGS2 = E_BAD_FORMAT_ARG_TYPE2 +LINTFLAGS64 += -u -erroff=$(LINTTAGS1),$(LINTTAGS2) +LINTFLAGS = $(LINTFLAGS64) + +# Used to test objects ($@) for the presence of FP code +KMDB_FPTEST = \ + $(FINDFP) $@ + +PROMINCDIRS += $(SRC)/uts/sparc/v7 + +LFLAGS = -t -v +YFLAGS = -d -v + +MMU = sfmmu +ISADIR = sparc/v9 + +# +# Dummy `all' target to force `all' to be the first target, so that +# a `make' will `make all'. +# +all: + +$$(ROOTMOD)/%: dmod/% + $(INS.file) + +$$(ROOTKMOD)/%: kmod/% + $(INS.file) + +$(ROOTMOD): $(ROOT)/usr/lib/mdb/$(MDBTGT) + $(INS.dir) + +$(ROOTKMOD): $(ROOT)/kernel/kmdb + $(INS.dir) diff --git a/usr/src/cmd/mdb/Makefile.subdirs b/usr/src/cmd/mdb/Makefile.subdirs new file mode 100644 index 0000000..eaa754d --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.subdirs @@ -0,0 +1,49 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +.KEEP_STATE: + +all := TARGET = all +clean.lint := TARGET = clean.lint +clean := TARGET = clean +clobber := TARGET = clobber +dmods := TARGET = dmods +install := TARGET = install +install_h := TARGET = install_h +lint := TARGET = lint + +all clean.lint clean clobber dmods install lint: $(SUBDIRS) + +# +# VERSION is to keep ctfconvert/ctfmerge from complaining +MAKEVARS += \ + VERSION='$(VERSION)' + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKEVARS) $(MAKE) $(TARGET) + +FRC: diff --git a/usr/src/cmd/mdb/Makefile.tools b/usr/src/cmd/mdb/Makefile.tools new file mode 100644 index 0000000..acbbf7f --- /dev/null +++ b/usr/src/cmd/mdb/Makefile.tools @@ -0,0 +1,32 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +TOOLSDIR = $(SRC)/cmd/mdb/tools + +#SETDYNFLAG = $(TOOLSDIR)/setdynflag/$(MACH)/setdynflag +SETDYNFLAG = true TODO +#FINDFP = $(TOOLSDIR)/findfp/$(MACH)/findfp +FINDFP = true TODO diff --git a/usr/src/cmd/mdb/README b/usr/src/cmd/mdb/README new file mode 100644 index 0000000..532e17f --- /dev/null +++ b/usr/src/cmd/mdb/README @@ -0,0 +1,19 @@ + +This directory flattens some of what would be found under +$SRC/cmd/mdb in illumos-gate, where the Makefile.* here +are from a couple different levels in illumos gate: + cmd/mdb, cmd/mdb/intel, cmd/mdb/sparc + +The subdirectories under here are somewhat like: + cmd/mdb/intel/modules/* + cmd/mdb/intel/{ia32,amd64} + cmd/mdb/sparc/{v7,v9} + +Didn't want to replicate that whole hierarchy just to +build some mdb modules. + +To add a typical intel mdb/kmdb module, you would create: + mymod/Makefile + mymod/mymod.c + mymod/amd64/Makefile + mymod/ia32/Makefile diff --git a/usr/src/cmd/mdb/mapfile b/usr/src/cmd/mdb/mapfile new file mode 100644 index 0000000..aabdf38 --- /dev/null +++ b/usr/src/cmd/mdb/mapfile @@ -0,0 +1,49 @@ +# +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# MAPFILE HEADER START +# +# WARNING: STOP NOW. DO NOT MODIFY THIS FILE. +# Object versioning must comply with the rules detailed in +# +# usr/src/lib/README.mapfiles +# +# You should not be making modifications here until you've read the most current +# copy of that file. If you need help, contact a gatekeeper for guidance. +# +# MAPFILE HEADER END +# + +$mapfile_version 2 + +# +# Module mapfile +# +# Modules aren't allowed to export any symbols +# + +SYMBOL_SCOPE { + local: + *; +}; diff --git a/usr/src/cmd/mdb/mapfile-extern b/usr/src/cmd/mdb/mapfile-extern new file mode 100644 index 0000000..73de8f1 --- /dev/null +++ b/usr/src/cmd/mdb/mapfile-extern @@ -0,0 +1,175 @@ +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# MAPFILE HEADER START +# +# WARNING: STOP NOW. DO NOT MODIFY THIS FILE. +# Object versioning must comply with the rules detailed in +# +# usr/src/lib/README.mapfiles +# +# You should not be making modifications here until you've read the most current +# copy of that file. If you need help, contact a gatekeeper for guidance. +# +# MAPFILE HEADER END +# + +$mapfile_version 2 + +# External interface requirements +SYMBOL_SCOPE { + global: +# Plwp_iter { FLAGS = EXTERN }; +# Pmapping_iter { FLAGS = EXTERN }; + + _mdb_ks_ncpu { FLAGS = EXTERN }; + _mdb_ks_pagemask { FLAGS = EXTERN }; + _mdb_ks_pageoffset { FLAGS = EXTERN }; + _mdb_ks_pageshift { FLAGS = EXTERN }; + _mdb_ks_pagesize { FLAGS = EXTERN }; + + mdb { FLAGS = EXTERN }; + mdb_add_walker { FLAGS = EXTERN }; + mdb_alloc { FLAGS = EXTERN }; + mdb_aread { FLAGS = EXTERN }; + mdb_awrite { FLAGS = EXTERN }; + mdb_call_dcmd { FLAGS = EXTERN }; + mdb_callback_add { FLAGS = EXTERN }; + mdb_callback_remove { FLAGS = EXTERN }; + mdb_cpuset_find { FLAGS = EXTERN }; + mdb_ctf_array_info { FLAGS = EXTERN }; + mdb_ctf_enum_name { FLAGS = EXTERN }; + mdb_ctf_lookup_by_addr { FLAGS = EXTERN }; + mdb_ctf_lookup_by_name { FLAGS = EXTERN }; + mdb_ctf_member_iter { FLAGS = EXTERN }; + mdb_ctf_module_lookup { FLAGS = EXTERN }; + mdb_ctf_offsetof { FLAGS = EXTERN }; + mdb_ctf_offsetof_by_name { FLAGS = EXTERN }; + mdb_ctf_sizeof_by_name { FLAGS = EXTERN }; + mdb_ctf_readsym { FLAGS = EXTERN }; + mdb_ctf_type_cmp { FLAGS = EXTERN }; + mdb_ctf_type_invalidate { FLAGS = EXTERN }; + mdb_ctf_type_kind { FLAGS = EXTERN }; + mdb_ctf_type_name { FLAGS = EXTERN }; + mdb_ctf_type_reference { FLAGS = EXTERN }; + mdb_ctf_type_resolve { FLAGS = EXTERN }; + mdb_ctf_type_size { FLAGS = EXTERN }; + mdb_ctf_type_valid { FLAGS = EXTERN }; + mdb_ctf_vread { FLAGS = EXTERN }; + mdb_ddi_pathname { FLAGS = EXTERN }; + mdb_dec_indent { FLAGS = EXTERN }; + mdb_devinfo2driver { FLAGS = EXTERN }; + mdb_devinfo2statep { FLAGS = EXTERN }; + mdb_dlpi_prim { FLAGS = EXTERN }; + mdb_dump64 { FLAGS = EXTERN }; + mdb_dumpptr { FLAGS = EXTERN }; + mdb_eval { FLAGS = EXTERN }; + mdb_fdio_create_path { FLAGS = EXTERN }; + mdb_fdio_fileno { FLAGS = EXTERN }; + mdb_ffs { FLAGS = EXTERN }; + mdb_flush { FLAGS = EXTERN }; + mdb_fread { FLAGS = EXTERN }; + mdb_free { FLAGS = EXTERN }; + mdb_fwrite { FLAGS = EXTERN }; + mdb_gelf_create { FLAGS = EXTERN }; + mdb_gelf_destroy { FLAGS = EXTERN }; + mdb_gelf_sect_by_name { FLAGS = EXTERN }; + mdb_gelf_sect_load { FLAGS = EXTERN }; + mdb_getareg { FLAGS = EXTERN }; + mdb_get_dot { FLAGS = EXTERN }; + mdb_get_lbolt { FLAGS = EXTERN }; + mdb_get_pipe { FLAGS = EXTERN }; + mdb_get_soft_state_byaddr { FLAGS = EXTERN }; + mdb_get_state { FLAGS = EXTERN }; + mdb_get_xdata { FLAGS = EXTERN }; + mdb_gethrtime { FLAGS = EXTERN }; + mdb_getopts { FLAGS = EXTERN }; + mdb_inc_indent { FLAGS = EXTERN }; + mdb_inval_bits { FLAGS = EXTERN }; + mdb_io_destroy { FLAGS = EXTERN }; + mdb_iob_clrflags { FLAGS = EXTERN }; + mdb_iob_getflags { FLAGS = EXTERN }; + mdb_iob_resize { FLAGS = EXTERN }; + mdb_iob_setflags { FLAGS = EXTERN }; + mdb_layered_walk { FLAGS = EXTERN }; + mdb_lookup_by_addr { FLAGS = EXTERN }; + mdb_lookup_by_name { FLAGS = EXTERN }; + mdb_lookup_by_obj { FLAGS = EXTERN }; + mdb_mac_addr { FLAGS = EXTERN }; + mdb_major_to_name { FLAGS = EXTERN }; + mdb_mblk_count { FLAGS = EXTERN }; + mdb_memio_create { FLAGS = EXTERN }; + mdb_name_to_major { FLAGS = EXTERN }; + mdb_nhconvert { FLAGS = EXTERN }; + mdb_object_iter { FLAGS = EXTERN }; + mdb_one_bit { FLAGS = EXTERN }; + mdb_page2pfn { FLAGS = EXTERN }; + mdb_page_lookup { FLAGS = EXTERN }; + mdb_pfn2page { FLAGS = EXTERN }; + mdb_pid2proc { FLAGS = EXTERN }; + mdb_pread { FLAGS = EXTERN }; + mdb_printf { FLAGS = EXTERN }; + mdb_prop_kernel { FLAGS = EXTERN }; + mdb_prop_postmortem { FLAGS = EXTERN }; + mdb_pwalk { FLAGS = EXTERN }; + mdb_pwalk_dcmd { FLAGS = EXTERN }; + mdb_pwrite { FLAGS = EXTERN }; + mdb_qinfo { FLAGS = EXTERN }; + mdb_qname { FLAGS = EXTERN }; + mdb_qops_install { FLAGS = EXTERN }; + mdb_qops_remove { FLAGS = EXTERN }; + mdb_qrnext_default { FLAGS = EXTERN }; + mdb_qwnext { FLAGS = EXTERN }; + mdb_qwnext_default { FLAGS = EXTERN }; + mdb_read_refstr { FLAGS = EXTERN }; + mdb_readstr { FLAGS = EXTERN }; + mdb_readsym { FLAGS = EXTERN }; + mdb_readvar { FLAGS = EXTERN }; + mdb_remove_walker { FLAGS = EXTERN }; + mdb_set_dot { FLAGS = EXTERN }; + mdb_set_pipe { FLAGS = EXTERN }; + mdb_snprintf { FLAGS = EXTERN }; + mdb_strtoull { FLAGS = EXTERN }; + mdb_symbol_iter { FLAGS = EXTERN }; + mdb_tgt_notsup { FLAGS = EXTERN }; + mdb_vnode2path { FLAGS = EXTERN }; + mdb_vread { FLAGS = EXTERN }; + mdb_vtype2chr { FLAGS = EXTERN }; + mdb_vwrite { FLAGS = EXTERN }; + mdb_walk { FLAGS = EXTERN }; + mdb_walk_dcmd { FLAGS = EXTERN }; + mdb_warn { FLAGS = EXTERN }; + mdb_whatis_done { FLAGS = EXTERN }; + mdb_whatis_flags { FLAGS = EXTERN }; + mdb_whatis_match { FLAGS = EXTERN }; + mdb_whatis_overlaps { FLAGS = EXTERN }; + mdb_whatis_register { FLAGS = EXTERN }; + mdb_whatis_report_address { FLAGS = EXTERN }; + mdb_whatis_report_object { FLAGS = EXTERN }; + mdb_writestr { FLAGS = EXTERN }; + mdb_writesym { FLAGS = EXTERN }; + mdb_writevar { FLAGS = EXTERN }; + mdb_zalloc { FLAGS = EXTERN }; +}; -- cgit v1.2.3