From 28d7013795bfe1957b8da7e8aee02d4f9dec8f29 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 25 Jul 2016 13:12:48 +0300 Subject: [PATCH] ficl: updates from review Changes suggested by Rich https://www.illumos.org/rb/r/92 --- usr/src/cmd/ficl/Makefile.com | 1 + usr/src/common/ficl/loader.c | 22 ++++++++--------- usr/src/common/ficl/softcore/lz4.c | 50 +++++++++++++++++++------------------- usr/src/lib/Makefile | 1 + usr/src/lib/libficl/Makefile | 4 +-- usr/src/lib/libficl/mapfile-vers | 1 - 6 files changed, 40 insertions(+), 39 deletions(-) diff --git a/usr/src/cmd/ficl/Makefile.com b/usr/src/cmd/ficl/Makefile.com index f0f9cd08d8..6be92a0115 100644 --- a/usr/src/cmd/ficl/Makefile.com +++ b/usr/src/cmd/ficl/Makefile.com @@ -18,6 +18,7 @@ OBJS= main.o SRCS= main.c include ../../Makefile.cmd +include ../../Makefile.ctf LDLIBS += -lficl-sys -ltecla -lumem CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I$(SRC)/common/ficl diff --git a/usr/src/common/ficl/loader.c b/usr/src/common/ficl/loader.c index 730ee9a498..4000e5aabc 100644 --- a/usr/src/common/ficl/loader.c +++ b/usr/src/common/ficl/loader.c @@ -61,17 +61,17 @@ extern uint32_t biospci_locator(uint8_t, uint8_t, uint8_t); /* * FreeBSD's loader interaction words and extras * - * setenv ( value n name n' -- ) - * setenv? ( value n name n' flag -- ) - * getenv ( addr n -- addr' n' | -1 ) - * unsetenv ( addr n -- ) - * copyin ( addr addr' len -- ) - * copyout ( addr addr' len -- ) - * findfile ( name len type len' -- addr ) - * pnpdevices ( -- addr ) - * pnphandlers ( -- addr ) - * ccall ( [[...[p10] p9] ... p1] n addr -- result ) - * .# ( value -- ) + * setenv ( value n name n' -- ) + * setenv? ( value n name n' flag -- ) + * getenv ( addr n -- addr' n' | -1 ) + * unsetenv ( addr n -- ) + * copyin ( addr addr' len -- ) + * copyout ( addr addr' len -- ) + * findfile ( name len type len' -- addr ) + * pnpdevices ( -- addr ) + * pnphandlers ( -- addr ) + * ccall ( [[...[p10] p9] ... p1] n addr -- result ) + * .# ( value -- ) */ void diff --git a/usr/src/common/ficl/softcore/lz4.c b/usr/src/common/ficl/softcore/lz4.c index 8c0be0d729..9a62d68208 100644 --- a/usr/src/common/ficl/softcore/lz4.c +++ b/usr/src/common/ficl/softcore/lz4.c @@ -100,42 +100,42 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) * * Simple Functions: * real_LZ4_compress() : - * isize : is the input size. Max supported value is ~1.9GB - * return : the number of bytes written in buffer dest + * isize : is the input size. Max supported value is ~1.9GB + * return : the number of bytes written in buffer dest * or 0 if the compression fails (if LZ4_COMPRESSMIN is set). - * note : destination buffer must be already allocated. - * destination buffer must be sized to handle worst cases - * situations (input data not compressible) + * note : destination buffer must be already allocated. + * destination buffer must be sized to handle worst cases + * situations (input data not compressible) * * Advanced Functions * * LZ4_uncompress_unknownOutputSize() : - * isize : is the input size, therefore the compressed size - * maxOutputSize : is the size of the destination buffer (which must be - * already allocated) - * return : the number of bytes decoded in the destination buffer - * (necessarily <= maxOutputSize). If the source stream is - * malformed, the function will stop decoding and return a - * negative result, indicating the byte position of the faulty - * instruction. This function never writes beyond dest + - * maxOutputSize, and is therefore protected against malicious - * data packets. - * note : Destination buffer must be already allocated. + * isize : is the input size, therefore the compressed size + * maxOutputSize : is the size of the destination buffer (which must be + * already allocated) + * return : the number of bytes decoded in the destination buffer + * (necessarily <= maxOutputSize). If the source stream is + * malformed, the function will stop decoding and return a + * negative result, indicating the byte position of the faulty + * instruction. This function never writes beyond dest + + * maxOutputSize, and is therefore protected against malicious + * data packets. + * note : Destination buffer must be already allocated. * * LZ4_compressCtx() : - * This function explicitly handles the CTX memory structure. + * This function explicitly handles the CTX memory structure. * - * ILLUMOS CHANGES: the CTX memory structure must be explicitly allocated - * by the caller (either on the stack or using kmem_zalloc). Passing NULL - * isn't valid. + * ILLUMOS CHANGES: the CTX memory structure must be explicitly allocated + * by the caller (either on the stack or using kmem_zalloc). Passing NULL + * isn't valid. * * LZ4_compress64kCtx() : - * Same as LZ4_compressCtx(), but specific to small inputs (<64KB). - * isize *Must* be <64KB, otherwise the output will be corrupted. + * Same as LZ4_compressCtx(), but specific to small inputs (<64KB). + * isize *Must* be <64KB, otherwise the output will be corrupted. * - * ILLUMOS CHANGES: the CTX memory structure must be explicitly allocated - * by the caller (either on the stack or using kmem_zalloc). Passing NULL - * isn't valid. + * ILLUMOS CHANGES: the CTX memory structure must be explicitly allocated + * by the caller (either on the stack or using kmem_zalloc). Passing NULL + * isn't valid. */ /* diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile index 792752c8b4..f611e249c7 100644 --- a/usr/src/lib/Makefile +++ b/usr/src/lib/Makefile @@ -607,6 +607,7 @@ libeti: libcurses libexacct/demo: libexacct libproject libfakekernel: libumem libcryptoutil libfcoe: libdladm +libficl: libumem libfru: libfruutils libfsmgt: libkstat libgrubmgmt: libdevinfo libzfs libfstyp libefi diff --git a/usr/src/lib/libficl/Makefile b/usr/src/lib/libficl/Makefile index be45a23e04..c29321843f 100644 --- a/usr/src/lib/libficl/Makefile +++ b/usr/src/lib/libficl/Makefile @@ -33,9 +33,9 @@ all install: install_h $(SUBDIRS) clean clobber: $(SUBDIRS) -install_h: $(PLATHDRDIR) $(ROOTHDRS) +install_h: $(PLATHDRDIR) $(ROOTHDRS) -check: $(CHECKHDRS) +check: $(CHECKHDRS) $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/libficl/mapfile-vers b/usr/src/lib/libficl/mapfile-vers index a241dce7ba..acb556e223 100644 --- a/usr/src/lib/libficl/mapfile-vers +++ b/usr/src/lib/libficl/mapfile-vers @@ -85,7 +85,6 @@ SYMBOL_VERSION ILLUMOSprivate { ficlDictionaryUnsmudge; ficlDictionaryWhere; ficlDigitToCharacter; -# ficlFileTruncate; ficlFree; ficlHashCode; ficlHashForget; -- 2.11.4.GIT