*: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
ssize_t archive_xread_all_eof(archive_handle_t *archive_handle,
|
||||
ssize_t FAST_FUNC archive_xread_all_eof(archive_handle_t *archive_handle,
|
||||
unsigned char *buf, size_t count)
|
||||
{
|
||||
ssize_t size;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void data_align(archive_handle_t *archive_handle, unsigned boundary)
|
||||
void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary)
|
||||
{
|
||||
unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void data_extract_all(archive_handle_t *archive_handle)
|
||||
void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
|
||||
{
|
||||
file_header_t *file_header = archive_handle->file_header;
|
||||
int dst_fd;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void data_extract_to_buffer(archive_handle_t *archive_handle)
|
||||
void FAST_FUNC data_extract_to_buffer(archive_handle_t *archive_handle)
|
||||
{
|
||||
unsigned int size = archive_handle->file_header->size;
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void data_extract_to_stdout(archive_handle_t *archive_handle)
|
||||
void FAST_FUNC data_extract_to_stdout(archive_handle_t *archive_handle)
|
||||
{
|
||||
bb_copyfd_exact_size(archive_handle->src_fd,
|
||||
STDOUT_FILENO,
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void data_skip(archive_handle_t *archive_handle)
|
||||
void FAST_FUNC data_skip(archive_handle_t *archive_handle)
|
||||
{
|
||||
archive_handle->seek(archive_handle, archive_handle->file_header->size);
|
||||
}
|
||||
|
@@ -526,7 +526,7 @@ static int get_next_block(bunzip_data *bd)
|
||||
are ignored, data is written to out_fd and return is RETVAL_OK or error.
|
||||
*/
|
||||
|
||||
int read_bunzip(bunzip_data *bd, char *outbuf, int len)
|
||||
int FAST_FUNC read_bunzip(bunzip_data *bd, char *outbuf, int len)
|
||||
{
|
||||
const unsigned *dbuf;
|
||||
int pos, current, previous, gotcount;
|
||||
@@ -643,7 +643,7 @@ int read_bunzip(bunzip_data *bd, char *outbuf, int len)
|
||||
should work for NOFORK applets too, we must be extremely careful to not leak
|
||||
any allocations! */
|
||||
|
||||
int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf,
|
||||
int FAST_FUNC start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf,
|
||||
int len)
|
||||
{
|
||||
bunzip_data *bd;
|
||||
@@ -699,7 +699,7 @@ int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf,
|
||||
return RETVAL_OK;
|
||||
}
|
||||
|
||||
void dealloc_bunzip(bunzip_data *bd)
|
||||
void FAST_FUNC dealloc_bunzip(bunzip_data *bd)
|
||||
{
|
||||
free(bd->dbuf);
|
||||
free(bd);
|
||||
@@ -708,7 +708,7 @@ void dealloc_bunzip(bunzip_data *bd)
|
||||
|
||||
/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */
|
||||
|
||||
USE_DESKTOP(long long) int
|
||||
USE_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_bz2_stream(int src_fd, int dst_fd)
|
||||
{
|
||||
USE_DESKTOP(long long total_written = 0;)
|
||||
|
@@ -70,7 +70,7 @@
|
||||
* be stored in the compressed file.
|
||||
*/
|
||||
|
||||
USE_DESKTOP(long long) int
|
||||
USE_DESKTOP(long long) int FAST_FUNC
|
||||
uncompress(int fd_in, int fd_out)
|
||||
{
|
||||
USE_DESKTOP(long long total_written = 0;)
|
||||
|
@@ -229,7 +229,7 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
USE_DESKTOP(long long) int
|
||||
USE_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_lzma_stream(int src_fd, int dst_fd)
|
||||
{
|
||||
USE_DESKTOP(long long total_written = 0;)
|
||||
|
@@ -1033,7 +1033,7 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
|
||||
|
||||
/* For unzip */
|
||||
|
||||
USE_DESKTOP(long long) int
|
||||
USE_DESKTOP(long long) int FAST_FUNC
|
||||
inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)
|
||||
{
|
||||
USE_DESKTOP(long long) int n;
|
||||
@@ -1176,7 +1176,7 @@ static int check_header_gzip(STATE_PARAM_ONLY)
|
||||
return 1;
|
||||
}
|
||||
|
||||
USE_DESKTOP(long long) int
|
||||
USE_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_gz_stream(int in, int out)
|
||||
{
|
||||
uint32_t v32;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#include "unarchive.h"
|
||||
|
||||
/* Accept any non-null name, its not really a filter at all */
|
||||
char filter_accept_all(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC filter_accept_all(archive_handle_t *archive_handle)
|
||||
{
|
||||
if (archive_handle->file_header->name)
|
||||
return EXIT_SUCCESS;
|
||||
|
@@ -11,7 +11,7 @@
|
||||
/*
|
||||
* Accept names that are in the accept list, ignoring reject list.
|
||||
*/
|
||||
char filter_accept_list(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC filter_accept_list(archive_handle_t *archive_handle)
|
||||
{
|
||||
if (find_list_entry(archive_handle->accept, archive_handle->file_header->name))
|
||||
return EXIT_SUCCESS;
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz
|
||||
* or if its a .tar.bz2 make archive_handle->sub_archive handle that
|
||||
*/
|
||||
char filter_accept_list_reassign(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC filter_accept_list_reassign(archive_handle_t *archive_handle)
|
||||
{
|
||||
/* Check the file entry is in the accept list */
|
||||
if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) {
|
||||
|
@@ -11,7 +11,7 @@
|
||||
/*
|
||||
* Accept names that are in the accept list and not in the reject list
|
||||
*/
|
||||
char filter_accept_reject_list(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC filter_accept_reject_list(archive_handle_t *archive_handle)
|
||||
{
|
||||
const char *key;
|
||||
const llist_t *reject_entry;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#include "unarchive.h"
|
||||
|
||||
/* Find a string in a shell pattern list */
|
||||
const llist_t *find_list_entry(const llist_t *list, const char *filename)
|
||||
const llist_t* FAST_FUNC find_list_entry(const llist_t *list, const char *filename)
|
||||
{
|
||||
while (list) {
|
||||
if (fnmatch(list->data, filename, 0) == 0) {
|
||||
@@ -24,7 +24,7 @@ const llist_t *find_list_entry(const llist_t *list, const char *filename)
|
||||
/* Same, but compares only path components present in pattern
|
||||
* (extra trailing path components in filename are assumed to match)
|
||||
*/
|
||||
const llist_t *find_list_entry2(const llist_t *list, const char *filename)
|
||||
const llist_t* FAST_FUNC find_list_entry2(const llist_t *list, const char *filename)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
int pattern_slash_cnt;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
char get_header_ar(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
|
||||
{
|
||||
int err;
|
||||
file_header_t *typed = archive_handle->file_header;
|
||||
|
@@ -17,7 +17,7 @@ typedef struct hardlinks_s {
|
||||
char name[1];
|
||||
} hardlinks_t;
|
||||
|
||||
char get_header_cpio(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
|
||||
{
|
||||
static hardlinks_t *saved_hardlinks = NULL;
|
||||
static hardlinks_t *saved_hardlinks_created = NULL;
|
||||
|
@@ -43,7 +43,7 @@ static unsigned long long getOctal(char *str, int len)
|
||||
#define GET_OCTAL(a) getOctal((a), sizeof(a))
|
||||
|
||||
void BUG_tar_header_size(void);
|
||||
char get_header_tar(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
{
|
||||
static smallint end;
|
||||
#if ENABLE_FEATURE_TAR_AUTODETECT
|
||||
@@ -133,7 +133,7 @@ char get_header_tar(archive_handle_t *archive_handle)
|
||||
|| memcmp(tar.magic, "\0\0\0\0", 5) != 0)
|
||||
) {
|
||||
#if ENABLE_FEATURE_TAR_AUTODETECT
|
||||
char (*get_header_ptr)(archive_handle_t *);
|
||||
char FAST_FUNC (*get_header_ptr)(archive_handle_t *);
|
||||
|
||||
/* tar gz/bz autodetect: check for gz/bz2 magic.
|
||||
* If it is the very first block, and we see the magic,
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
char get_header_tar_bz2(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC get_header_tar_bz2(archive_handle_t *archive_handle)
|
||||
{
|
||||
/* Can't lseek over pipes */
|
||||
archive_handle->seek = seek_by_read;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
char get_header_tar_gz(archive_handle_t *archive_handle)
|
||||
char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
|
||||
{
|
||||
#if BB_MMU
|
||||
unsigned char magic[2];
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
char get_header_tar_lzma(archive_handle_t * archive_handle)
|
||||
char FAST_FUNC get_header_tar_lzma(archive_handle_t * archive_handle)
|
||||
{
|
||||
/* Can't lseek over pipes */
|
||||
archive_handle->seek = seek_by_read;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void header_list(const file_header_t *file_header)
|
||||
void FAST_FUNC header_list(const file_header_t *file_header)
|
||||
{
|
||||
puts(file_header->name);
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED)
|
||||
void FAST_FUNC header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void header_verbose_list(const file_header_t *file_header)
|
||||
void FAST_FUNC header_verbose_list(const file_header_t *file_header)
|
||||
{
|
||||
struct tm *mtime = localtime(&(file_header->mtime));
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
archive_handle_t *init_handle(void)
|
||||
archive_handle_t* FAST_FUNC init_handle(void)
|
||||
{
|
||||
archive_handle_t *archive_handle;
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
* On MMU machine, the transform_prog is removed by macro magic
|
||||
* in include/unarchive.h. On NOMMU, transformer is removed.
|
||||
*/
|
||||
int open_transformer(int src_fd,
|
||||
USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd),
|
||||
int FAST_FUNC open_transformer(int src_fd,
|
||||
USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd),
|
||||
const char *transform_prog)
|
||||
{
|
||||
struct fd_pair fd_pipe;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount)
|
||||
void FAST_FUNC seek_by_jump(const archive_handle_t *archive_handle, unsigned amount)
|
||||
{
|
||||
if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) {
|
||||
if (errno == ESPIPE)
|
||||
|
@@ -9,7 +9,7 @@
|
||||
/* If we are reading through a pipe, or from stdin then we can't lseek,
|
||||
* we must read and discard the data to skip over it.
|
||||
*/
|
||||
void seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size)
|
||||
void FAST_FUNC seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size)
|
||||
{
|
||||
if (jump_size)
|
||||
bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
void unpack_ar_archive(archive_handle_t *ar_archive)
|
||||
void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive)
|
||||
{
|
||||
char magic[7];
|
||||
|
||||
|
Reference in New Issue
Block a user