]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/commitdiff
Updated the hplib build infrastructure to align for yocto
authorTinku Mannan <tmannan@ti.com>
Fri, 19 Apr 2013 12:56:35 +0000 (08:56 -0400)
committerTinku Mannan <tmannan@ti.com>
Wed, 24 Apr 2013 14:53:23 +0000 (10:53 -0400)
ti/runtime/hplib/build/Makefile
ti/runtime/hplib/makefile_armv7
ti/runtime/hplib/module/COPYING.txt [new file with mode: 0755]
ti/runtime/hplib/module/Makefile
ti/runtime/hplib/src/COPYING.txt [moved from COPYING.txt with 100% similarity]
ti/runtime/hplib/src/hplib_util.c
ti/runtime/hplib/src/hplib_vm.c
ti/runtime/hplib/src/osal.c
ti/runtime/hplib/test/build/Makefile

index 469a377d0233061d3facd35a99ad99741445cf0c..be7e3e36926047d6b6116a53bb3f08cae9f13183 100755 (executable)
@@ -1,3 +1,7 @@
+# Macro definitions referenced below
+#
+empty =
+space =$(empty) $(empty)
 
 export PDK_VER ?= v2
 
@@ -19,27 +23,54 @@ endif
 CPPI_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi
 NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
 
-INCDIR := $(PDK_INSTALL_PATH); $(CPPI_INC_DIR); $(NETAPI_INC_DIR); $(SA_INSTALL_PATH);
+
+ifeq ($(strip $(SA_INSTALL_PATH)),)
+INCDIR := ../../..;$(PDK_INSTALL_PATH);$(ROOTDIR)
+else
+INCDIR := ../../..;$(PDK_INSTALL_PATH);$(ROOTDIR);$(SA_INSTALL_PATH)
+endif
+
+
+
 # Output for prebuilt generated libraries
-export ARMV7LIBDIR ?= ../lib
-export ARMV7OBJDIR ?= ../obj
+#export ARMV7LIBDIR ?= ../lib
+#export ARMV7OBJDIR ?= ../obj
+ARMV7LIBDIR ?= ./lib
+ARMV7OBJDIR ?= ./obj
+ARMV7OBJDIR := $(ARMV7OBJDIR)/hplib/lib
+ARMV7BINDIR ?= ./bin
 
 # Set High Perf LiB INSTALL PATH to Transport SDK for default
 export HPLIB_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
 
+INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
+
+CFLAGS+= $(DEBUG_FLAG) -I$(HPLIB_INC_DIR) -I $(SRCDIR)  -I$(TRANS_SDK_INSTALL_PATH) -I$(CPPI_INC_DIR) -I$(NETAPI_INC_DIR) $(CSL_DEVICE) -D__LINUX_USER_SPACE  -DNWAL_ENABLE_SA -pthread -D _GNU_SOURCE -DPDK_VERSION=$(PDK_VERSION)
+
+#INTERNALDEFS = -D__ARMv7 -D_LITTLE_ENDIAN=1 -D_VIRTUAL_ADDR_SUPPORT -DMAKEFILE_BUILD $(CFLAGS) $(LDFLAGS)
+INTERNALDEFS = -D__ARMv7 -D_LITTLE_ENDIAN=1 -D_VIRTUAL_ADDR_SUPPORT -DMAKEFILE_BUILD 
+
 #HPLIB dirs
 OBJEXT = o 
 INTERNALLINKDEFS =
-HPLIB_INC_DIR = $(HPLIB_INSTALL_PATH)/ti/runtime/hplib
+#HPLIB_INC_DIR = $(HPLIB_INSTALL_PATH)/ti/runtime/hplib
+HPLIB_INC_DIR = $(PDK_INSTALL_PATH)/ti/runtime/hplib
 HPLIB_DOCS_DIR = $(HPLIB_INSTALL_PATH)/ti/runtime/hplib/docs
-SRCDIR = $(HPLIB_INC_DIR)/src
+SRCDIR = ./src
 
 VPATH=$(SRCDIR)
 
-
+ifdef CROSS_TOOL_INSTALL_PATH
+## Support backwards compatibility with KeyStone1 approach
+ CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+ AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
+ AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
+ LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+endif
 #Cross tools
-CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
-AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
+
+#CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
+#AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
 
 
 #List the COMMONSRC Files
@@ -53,28 +84,29 @@ COMMONSRCC = \
 CSL_DEVICE ?= -DDEVICE_K2H
 
 
-CFLAGS+= $(DEBUG_FLAG) -I$(HPLIB_INC_DIR) -I.  -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(NWAL_INSTALL_PATH) -I$(PKTLIB_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(CPPI_INC_DIR) -I$(NETAPI_INC_DIR) $(CSL_DEVICE) -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -DNWAL_ENABLE_SA -pthread -D _GNU_SOURCE -DPDK_VERSION=$(PDK_VERSION)
-INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
-all: lib
+CFLAGS+= $(DEBUG_FLAG) -I$(HPLIB_INC_DIR) -I. -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(NWAL_INSTALL_PATH) -I$(PKTLIB_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(CPPI_INC_DIR) -I$(NETAPI_INC_DIR) $(CSL_DEVICE) -D__LINUX_USER_SPACE  -DNWAL_ENABLE_SA -pthread -D _GNU_SOURCE -DPDK_VERSION=$(PDK_VERSION)
+
+#all: lib
 
-lib: $(ARMV7LIBDIR)/libhplib.a
+#lib: $(ARMV7LIBDIR)/libhplib.a
 
 
 # Make Rule for the COMMONSRC Files
-COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/hplib/lib/%.$(OBJEXT), $(COMMONSRCC))
+COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(COMMONSRCC))
 
-$(COMMONSRCCOBJS): $(ARMV7OBJDIR)/hplib/lib/%.$(OBJEXT): %.c
-       -@echo compiling $< ...
-       @mkdir -p $(ARMV7OBJDIR)/hplib/lib/
-       $(CC) $(CFLAGS) $(INCS)  $< -o $@
+$(COMMONSRCCOBJS): $(ARMV7OBJDIR)/%.$(OBJEXT): %.c $(ARMV7OBJDIR)/.created
+       -@echo compiling $< ... $(CC)
+       -@echo HPLIB_INC_DIR $(HPLIBINC_DIR)
+       $(CC) -c $(CFLAGS) $(INTERNALDEFS) $(INCS) $< -o $@
 
-$(ARMV7LIBDIR)/libhplib.a: $(COMMONSRCCOBJS)
+#$(ARMV7LIBDIR)/libhplib.a: $(COMMONSRCCOBJS)
+$(ARMV7LIBDIR)/libhplib.a: $(COMMONSRCCOBJS) $(ARMV7LIBDIR)/.created
        @mkdir -p $(ARMV7LIBDIR)
        @echo archiving $? into $@ ...
-       @$(AR) $@ $?
+       @$(AR) -r $@ $?
 
-clean: 
-       rm -f $(ARMV7OBJDIR)/hplib/lib/*.o
+clean:
+       rm -f $(ARMV7OBJDIR)/*.o
        rm -f $(ARMV7LIBDIR)/libhplib.a
 
 module:
@@ -84,9 +116,17 @@ module:
 doxygen:
        doxygen hplib_doxygen.cfg
 
-clean_doxygen: 
-       rm -rf $(HPLIB_DOCS_DIR)/html
-       rm -rf $(HPLIB_DOCS_DIR)/latex
+$(ARMV7OBJDIR)/.created:
+       @mkdir -p $(ARMV7OBJDIR)
+       @touch $(ARMV7OBJDIR)/.created
+
+$(ARMV7LIBDIR)/.created:
+       @mkdir -p $(ARMV7LIBDIR)
+       @touch $(ARMV7LIBDIR)/.created
+
+#clean_doxygen:        
+#      rm -rf $(HPLIB_DOCS_DIR)/html
+#      rm -rf $(HPLIB_DOCS_DIR)/latex
 
 print:
        @echo  'cflags is $(CFLAGS)'
index 309cf3c8632260938437d0bc34dfad255e08b5ec..55993fa61c73cc194e8c6036af390a493e1f0854 100755 (executable)
 # Output for prebuilt generated libraries
 export ARMV7LIBDIR ?= ./lib
 export ARMV7OBJDIR ?= ./obj
+export ARMV7BINDIR ?= ./bin
+
+export DEVICE ?=k2h
+export CPU ?=cortex-a15
 
 # ROOT Directory
 export ROOTDIR := ../../..
 
+export HPLIB_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
 
 # INCLUDE Directory
 export INCDIR := ../;$(PDK_INSTALL_PATH);$(ROOTDIR)
@@ -47,30 +52,44 @@ export MAKE = make
 endif
 
 # PHONY Targets
-.PHONY: lib tests examples module all clean
+.PHONY: all clean lib tests examples install
 
 # all rule
-all: .executables
+all: .executables install
 .executables: lib tests examples
-lib:
+
+#Libraries
+lib: .libraries
 
 # Make rule to create $(ARMV7LIBDIR)/hplib.a library
-lib: $(ARMV7LIBDIR)/libhplib.a
+.libraries: $(ARMV7LIBDIR)/libhplib.a
 
 $(ARMV7LIBDIR)/libhplib.a:
-       -@echo Building library...
+       -@echo Calling make lib with $@
        @$(MAKE) -f ./build/Makefile $@
 
 # Rule to clean $(ARMV7LIBDIR)/hplib.a library
 clean:
-       -@echo Cleaning hp package...
+       -@echo Cleaning hplib package... $@
+       -@echo ARMV7OBJDIR = $(ARMV7OBJDIR)
+       -@echo PDK_INSTALL_PATH = $(PDK_INSTALL_PATH)
        @$(MAKE) -f ./build/Makefile $@
        @$(MAKE) -f ./test/build/Makefile $@
 
+install:
+       echo inc base dir $(INSTALL_INC_BASE_DIR)
+       install -d $(INSTALL_INC_BASE_DIR)/ti/runtime/hplib
+       install -d $(INSTALL_INC_BASE_DIR)/ti/runtime/hplib/src
+       install -d $(INSTALL_LIB_BASE_DIR)
+       $(CP) ./*.h                $(INSTALL_INC_BASE_DIR)/ti/runtime/hplib
+       @$(CP) -r $(ARMV7LIBDIR)/*.a         $(INSTALL_LIB_BASE_DIR)
+       $(CP) src/*.h                $(INSTALL_INC_BASE_DIR)/ti/runtime/hplib/src
+       @echo INSTALL BIN BASE DIR = $(INSTALL_BIN_BASE_DIR)
+       install -d $(INSTALL_BIN_BASE_DIR)
+       install -c -m 755 $(ARMV7BINDIR)/hplib/test/* $(INSTALL_BIN_BASE_DIR)
+
 # Make rule to create tests
 tests:
        -@echo compiling tests ...
        @$(MAKE) -f ./test/build/Makefile $@
 
-examples:
-
diff --git a/ti/runtime/hplib/module/COPYING.txt b/ti/runtime/hplib/module/COPYING.txt
new file mode 100755 (executable)
index 0000000..dd49b4e
--- /dev/null
@@ -0,0 +1,343 @@
+GPLv2\r
+\r
+                    GNU GENERAL PUBLIC LICENSE\r
+                       Version 2, June 1991\r
+\r
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\r
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+                            Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+License is intended to guarantee your freedom to share and change free\r
+software--to make sure the software is free for all its users.  This\r
+General Public License applies to most of the Free Software\r
+Foundation's software and to any other program whose authors commit to\r
+using it.  (Some other Free Software Foundation software is covered by\r
+the GNU Lesser General Public License instead.)  You can apply it to\r
+your programs, too.\r
+\r
+  When we speak of free software, we are referring to freedom, not\r
+price.  Our General Public Licenses are designed to make sure that you\r
+have the freedom to distribute copies of free software (and charge for\r
+this service if you wish), that you receive source code or can get it\r
+if you want it, that you can change the software or use pieces of it\r
+in new free programs; and that you know you can do these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+anyone to deny you these rights or to ask you to surrender the rights.\r
+These restrictions translate to certain responsibilities for you if you\r
+distribute copies of the software, or if you modify it.\r
+\r
+  For example, if you distribute copies of such a program, whether\r
+gratis or for a fee, you must give the recipients all the rights that\r
+you have.  You must make sure that they, too, receive or can get the\r
+source code.  And you must show them these terms so they know their\r
+rights.\r
+\r
+  We protect your rights with two steps: (1) copyright the software, and\r
+(2) offer you this license which gives you legal permission to copy,\r
+distribute and/or modify the software.\r
+\r
+  Also, for each author's protection and ours, we want to make certain\r
+that everyone understands that there is no warranty for this free\r
+software.  If the software is modified by someone else and passed on, we\r
+want its recipients to know that what they have is not the original, so\r
+that any problems introduced by others will not reflect on the original\r
+authors' reputations.\r
+\r
+  Finally, any free program is threatened constantly by software\r
+patents.  We wish to avoid the danger that redistributors of a free\r
+program will individually obtain patent licenses, in effect making the\r
+program proprietary.  To prevent this, we have made it clear that any\r
+patent must be licensed for everyone's free use or not licensed at all.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.\r
+\r
+                    GNU GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License applies to any program or other work which contains\r
+a notice placed by the copyright holder saying it may be distributed\r
+under the terms of this General Public License.  The "Program", below,\r
+refers to any such program or work, and a "work based on the Program"\r
+means either the Program or any derivative work under copyright law:\r
+that is to say, a work containing the Program or a portion of it,\r
+either verbatim or with modifications and/or translated into another\r
+language.  (Hereinafter, translation is included without limitation in\r
+the term "modification".)  Each licensee is addressed as "you".\r
+\r
+Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running the Program is not restricted, and the output from the Program\r
+is covered only if its contents constitute a work based on the\r
+Program (independent of having been made by running the Program).\r
+Whether that is true depends on what the Program does.\r
+\r
+  1. You may copy and distribute verbatim copies of the Program's\r
+source code as you receive it, in any medium, provided that you\r
+conspicuously and appropriately publish on each copy an appropriate\r
+copyright notice and disclaimer of warranty; keep intact all the\r
+notices that refer to this License and to the absence of any warranty;\r
+and give any other recipients of the Program a copy of this License\r
+along with the Program.\r
+\r
+You may charge a fee for the physical act of transferring a copy, and\r
+you may at your option offer warranty protection in exchange for a fee.\r
+\r
+  2. You may modify your copy or copies of the Program or any portion\r
+of it, thus forming a work based on the Program, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) You must cause the modified files to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    b) You must cause any work that you distribute or publish, that in\r
+    whole or in part contains or is derived from the Program or any\r
+    part thereof, to be licensed as a whole at no charge to all third\r
+    parties under the terms of this License.\r
+\r
+    c) If the modified program normally reads commands interactively\r
+    when run, you must cause it, when started running for such\r
+    interactive use in the most ordinary way, to print or display an\r
+    announcement including an appropriate copyright notice and a\r
+    notice that there is no warranty (or else, saying that you provide\r
+    a warranty) and that users may redistribute the program under\r
+    these conditions, and telling the user how to view a copy of this\r
+    License.  (Exception: if the Program itself is interactive but\r
+    does not normally print such an announcement, your work based on\r
+    the Program is not required to print an announcement.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Program,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Program, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Program.\r
+\r
+In addition, mere aggregation of another work not based on the Program\r
+with the Program (or with a work based on the Program) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may copy and distribute the Program (or a work based on it,\r
+under Section 2) in object code or executable form under the terms of\r
+Sections 1 and 2 above provided that you also do one of the following:\r
+\r
+    a) Accompany it with the complete corresponding machine-readable\r
+    source code, which must be distributed under the terms of Sections\r
+    1 and 2 above on a medium customarily used for software interchange; or,\r
+\r
+    b) Accompany it with a written offer, valid for at least three\r
+    years, to give any third party, for a charge no more than your\r
+    cost of physically performing source distribution, a complete\r
+    machine-readable copy of the corresponding source code, to be\r
+    distributed under the terms of Sections 1 and 2 above on a medium\r
+    customarily used for software interchange; or,\r
+\r
+    c) Accompany it with the information you received as to the offer\r
+    to distribute corresponding source code.  (This alternative is\r
+    allowed only for noncommercial distribution and only if you\r
+    received the program in object code or executable form with such\r
+    an offer, in accord with Subsection b above.)\r
+\r
+The source code for a work means the preferred form of the work for\r
+making modifications to it.  For an executable work, complete source\r
+code means all the source code for all modules it contains, plus any\r
+associated interface definition files, plus the scripts used to\r
+control compilation and installation of the executable.  However, as a\r
+special exception, the source code distributed need not include\r
+anything that is normally distributed (in either source or binary\r
+form) with the major components (compiler, kernel, and so on) of the\r
+operating system on which the executable runs, unless that component\r
+itself accompanies the executable.\r
+\r
+If distribution of executable or object code is made by offering\r
+access to copy from a designated place, then offering equivalent\r
+access to copy the source code from the same place counts as\r
+distribution of the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  4. You may not copy, modify, sublicense, or distribute the Program\r
+except as expressly provided under this License.  Any attempt\r
+otherwise to copy, modify, sublicense or distribute the Program is\r
+void, and will automatically terminate your rights under this License.\r
+However, parties who have received copies, or rights, from you under\r
+this License will not have their licenses terminated so long as such\r
+parties remain in full compliance.\r
+\r
+  5. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Program or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Program (or any work based on the\r
+Program), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Program or works based on it.\r
+\r
+  6. Each time you redistribute the Program (or any work based on the\r
+Program), the recipient automatically receives a license from the\r
+original licensor to copy, distribute or modify the Program subject to\r
+these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties to\r
+this License.\r
+\r
+  7. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Program at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Program by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Program.\r
+\r
+If any portion of this section is held invalid or unenforceable under\r
+any particular circumstance, the balance of the section is intended to\r
+apply and the section as a whole is intended to apply in other\r
+circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system, which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  8. If the distribution and/or use of the Program is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Program under this License\r
+may add an explicit geographical distribution limitation excluding\r
+those countries, so that distribution is permitted only in or among\r
+countries not thus excluded.  In such case, this License incorporates\r
+the limitation as if written in the body of this License.\r
+\r
+  9. The Free Software Foundation may publish revised and/or new versions\r
+of the General Public License from time to time.  Such new versions will\r
+be similar in spirit to the present version, but may differ in detail to\r
+address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Program\r
+specifies a version number of this License which applies to it and "any\r
+later version", you have the option of following the terms and conditions\r
+either of that version or of any later version published by the Free\r
+Software Foundation.  If the Program does not specify a version number of\r
+this License, you may choose any version ever published by the Free Software\r
+Foundation.\r
+\r
+  10. If you wish to incorporate parts of the Program into other free\r
+programs whose distribution conditions are different, write to the author\r
+to ask for permission.  For software which is copyrighted by the Free\r
+Software Foundation, write to the Free Software Foundation; we sometimes\r
+make exceptions for this.  Our decision will be guided by the two goals\r
+of preserving the free status of all derivatives of our free software and\r
+of promoting the sharing and reuse of software generally.\r
+\r
+                            NO WARRANTY\r
+\r
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
+REPAIR OR CORRECTION.\r
+\r
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGES.\r
+\r
+                     END OF TERMS AND CONDITIONS\r
+\r
+            How to Apply These Terms to Your New Programs\r
+\r
+  If you develop a new program, and you want it to be of the greatest\r
+possible use to the public, the best way to achieve this is to make it\r
+free software which everyone can redistribute and change under these terms.\r
+\r
+  To do so, attach the following notices to the program.  It is safest\r
+to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least\r
+the "copyright" line and a pointer to where the full notice is found.\r
+\r
+    <one line to give the program's name and a brief idea of what it does.>\r
+    Copyright (C) <year>  <name of author>\r
+\r
+    This program is free software; you can redistribute it and/or modify\r
+    it under the terms of the GNU General Public License as published by\r
+    the Free Software Foundation; either version 2 of the License, or\r
+    (at your option) any later version.\r
+\r
+    This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    GNU General Public License for more details.\r
+\r
+    You should have received a copy of the GNU General Public License along\r
+    with this program; if not, write to the Free Software Foundation, Inc.,\r
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+If the program is interactive, make it output a short notice like this\r
+when it starts in an interactive mode:\r
+\r
+    Gnomovision version 69, Copyright (C) year name of author\r
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
+    This is free software, and you are welcome to redistribute it\r
+    under certain conditions; type `show c' for details.\r
+\r
+The hypothetical commands `show w' and `show c' should show the appropriate\r
+parts of the General Public License.  Of course, the commands you use may\r
+be called something other than `show w' and `show c'; they could even be\r
+mouse-clicks or menu items--whatever suits your program.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the program, if\r
+necessary.  Here is a sample; alter the names:\r
+\r
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
+\r
+  <signature of Ty Coon>, 1 April 1989\r
+  Ty Coon, President of Vice\r
+\r
+This General Public License does not permit incorporating your program into\r
+proprietary programs.  If your program is a subroutine library, you may\r
+consider it more useful to permit linking proprietary applications with the\r
+library.  If this is what you want to do, use the GNU Lesser General\r
+Public License instead of this License.\r
+\r
+\r
index 2f7ca5f9dfce26b4c144b99fa8af39cd252c4e80..4cb0ce919742adbd50852cdbdd5fc8cf167eabc6 100755 (executable)
@@ -37,3 +37,6 @@ default all:
 clean:
        make -C $(KDIR) M=$$PWD clean
 
+install: 
+       make -C $(KDIR) M=$$PWD modules_install
+
similarity index 100%
rename from COPYING.txt
rename to ti/runtime/hplib/src/COPYING.txt
index a2b3e62ffc0bd5592ac1927a9f3ab596945c4002..ac70c37b5b49849e9eeaa0e8e03b013d7dde8bb9 100755 (executable)
@@ -60,7 +60,6 @@
 #include "hplibmod.h"
 #include "hplib.h"
 #include "hplib_loc.h"
-#include "ti/drv/nwal/nwal.h"
 #include <pthread.h>
 #include <sched.h>
 #include <linux/unistd.h>
index 39a98e46d56c6f8163ac12ab540fed468a340b53..8a652db5d6c38c5e7a4aba286409687e2c12116c 100755 (executable)
@@ -57,7 +57,6 @@
 #include <sys/mman.h>
 #include <errno.h>
 #include <unistd.h>
-#include <ti/drv/nwal/nwal.h> 
 #include <sys/ioctl.h>
 #include "hplibmod.h"
 #include "hplib.h"
index f05d4fc31d2a0840279c18bd51da1eb70c0aa260..f79ccd8807b62b874bbc110d59612b34f1785454 100755 (executable)
@@ -49,8 +49,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "netapi.h"
-//#include "netapi_tune.h"
 #include "hplib.h"
 #include <unistd.h>
 #include <sys/mman.h>
index b6c767e69efcf89b7b04e1cbf7e8e626a1f1aba3..6791d4af8db7928862d4d644e230588b504e4155 100755 (executable)
@@ -1,10 +1,16 @@
+empty =
+space =$(empty) $(empty)
+
 export ARMV7OBJDIR ?= ./obj
 export ARMV7BINDIR ?= ./bin
 export ARMV7LIBDIR ?= ./lib
+export ARMV7LIBDIRLOCAL ?= ../../lib
+WORKDIR ?= $(TRANS_SDK_INSTALL_PATH)
 
 # Set NETAPI INSTALL PATH to Transport SDK for default
 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
 
+CSL_DEVICE ?= -DDEVICE_K2H
 export CPUFLAGS ?= cortex-a15
 
 ifeq ($(CPUFLAGS), cortex-a8)
@@ -14,46 +20,35 @@ ifeq ($(CPUFLAGS), cortex-a15)
         CFLAGS += -DCORTEX_A15
 endif
 
-
 # INCLUDE Directories
 QMSS_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss
 CPPI_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi
 #
-HPLIB_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/hplib
-NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
+HPLIB_INC_DIR ?= $(WORKDIR)
+
+NETAPI_INC_DIR = $(PDK_INSTALL_PATH)/ti/runtime/netapi
 
-#HPLIB LIB Build directory
-HPLIB_BUILD_DIR = $(HPLIB_INC_DIR)/build
 
-# Support Libraries used by NETAPI 
+# Support Libraries used by HPLIB 
 QMSS_LIB = -lqmss
 CPPI_LIB = -lcppi
 PA_LIB   = -lpa
 HP_LIB = -lhplib
-#without security enabled
-#NWAL_LIB = -lnwal
 
-# commenting out the following begin
-#PKTLIB_LIB = -lpktlib
-#NETAPI_LIB = -lnetapi
-#
-#with security enabled..
-#NWAL_LIB = -lnwalsa
-#SA_LIB=$(SA_INSTALL_PATH)/ti/drv/sa/lib/salld_c.av7A
-#AES_LIB=$(SA_INSTALL_PATH)/ti/mas/aes/gcarmv7a/aes_c.av7A
-#SHA1_LIB=$(SA_INSTALL_PATH)/ti/mas/sha1/gcarmv7a/sha1_c.av7A
-#PKTUTL_LIB=$(SA_INSTALL_PATH)/ti/mas/pktutl/gcarmv7a/pktutl_c.av7A
-# commenting out the following end 
-
-#Cross tools
-CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
-AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
+
+ifdef CROSS_TOOL_INSTALL_PATH
+## Support backwards compatibility with KeyStone1 approach
+ CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+ AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
+ AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
+ LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+endif
+
 
 CFLAGS+= $(DEBUG_FLAG) -I../ -I. -I$(HPLIB_INC_DIR) -I$(NETAPI_INC_DIR)/src -I$(PDK_INSTALL_PATH)  -I$(NWAL_INSTALL_PATH) -I$(PKTLIB_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(QMSS_INC_DIR) -I$(CPPI_INC_DIR)  -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -pthread -D _GNU_SOURCE
 
 # Linker options, commenting out INTERNALLINKDEFS
-INTERNALLINKDEFS = --start-group -L$(ARMV7LIBDIR) -L$(PDK_ARMV7LIBDIR) $(HP_LIB) -lrt --end-group
-
+INTERNALLINKDEFS = -Wl,--start-group -L$(ARMV7LIBDIR) -L$(PDK_ARMV7LIBDIR) -L$(ARMV7LIBDIRLOCAL) $(HP_LIB) -Wl,--end-group -lrt
 
 all: tests 
 
@@ -68,9 +63,9 @@ clean:
        rm -f $(ARMV7BINDIR)/hplib/test/synchtest $(ARMV7BINDIR)/hplib/test/synchtest2 $(ARMV7BINDIR)/hplib/test/pmutest $(ARMV7BINDIR)/hplib/test/hplibmod_test 
 
 
-$(ARMV7OBJDIR)/hplib/test/%.o:$(HPLIB_INC_DIR)/test/%.c $(ARMV7OBJDIR)/hplib/test/.created
+$(ARMV7OBJDIR)/hplib/test/%.o: $(HPLIB_INC_DIR)/ti/runtime/hplib/test/%.c $(ARMV7OBJDIR)/hplib/test/.created
        @echo compiling $< ...
-       $(CC)  -c  $(CFLAGS)  $<  -o $@
+       $(CC) -c  $(CFLAGS)  $<  -o $@
 
 $(ARMV7OBJDIR)/hplib/test/.created:
        @mkdir -p $(ARMV7OBJDIR)/hplib/test/
@@ -78,14 +73,11 @@ $(ARMV7OBJDIR)/hplib/test/.created:
 $(ARMV7BINDIR)/hplib/test/.created:
        @mkdir -p $(ARMV7BINDIR)/hplib/test/
 
-$(ARMV7LIBDIR)/libhp.a:
-       make -C $(NETAPI_BUILD_DIR) 
-
 $(ARMV7BINDIR)/hplib/test/synchtest: $(ARMV7OBJDIR)/hplib/test/synchtest.o
        $(CC) $(LDFLAGS) $(ARMV7OBJDIR)/hplib/test/synchtest.o $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/hplib/test/synchtest -lpthread
 
 $(ARMV7BINDIR)/hplib/test/synchtest2: $(ARMV7OBJDIR)/hplib/test/synchtest2.o
-       $(CC) $(LDFLAGS) $(ARMV7OBJDIR)/hplib/test/synchtest2.o $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/hplib/test/synchtest2 -lpthread
+       $(CC) $(LDFLAGS) $(ARMV7OBJDIR)/hplib/test/synchtest2.o $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/hplib/test/synchtest2 -lpthread 
        
 $(ARMV7BINDIR)/hplib/test/hplibmod_test: $(ARMV7OBJDIR)/hplib/test/hplibmod_test.o
        $(CC) $(LDFLAGS) $(ARMV7OBJDIR)/hplib/test/hplibmod_test.o $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/hplib/test/hplibmod_test