Changeset b8e72fd1 in mainline for uspace/lib
- Timestamp:
- 2013-05-30T17:13:02Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 98abd40
- Parents:
- be2bb4f (diff), 94dfb92 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib
- Files:
-
- 5 added
- 23 edited
-
bithenge/src/blob.c (modified) (1 diff)
-
c/Makefile (modified) (3 diffs)
-
c/arch/amd64/Makefile.common (modified) (1 diff)
-
c/arch/ia32/Makefile.common (modified) (2 diffs)
-
c/generic/device/hw_res_parsed.c (modified) (1 diff)
-
c/generic/dnsr.c (added)
-
c/generic/inet/addr.c (added)
-
c/generic/mem.c (modified) (1 diff)
-
c/generic/net/inet.c (modified) (2 diffs)
-
c/generic/net/socket_client.c (modified) (2 diffs)
-
c/include/device/hw_res_parsed.h (modified) (2 diffs)
-
c/include/inet/addr.h (added)
-
c/include/inet/dnsr.h (added)
-
c/include/inet/inet.h (modified) (1 diff)
-
c/include/inet/inetcfg.h (modified) (1 diff)
-
c/include/io/verify.h (modified) (1 diff)
-
c/include/ipc/dnsr.h (added)
-
c/include/ipc/services.h (modified) (1 diff)
-
c/include/mem.h (modified) (2 diffs)
-
drv/generic/remote_nic.c (modified) (10 diffs)
-
ext4/libext4_directory.c (modified) (1 diff)
-
nic/src/nic_addr_db.c (modified) (1 diff)
-
nic/src/nic_driver.c (modified) (1 diff)
-
nic/src/nic_impl.c (modified) (2 diffs)
-
nic/src/nic_rx_control.c (modified) (1 diff)
-
nic/src/nic_wol_virtues.c (modified) (1 diff)
-
posix/source/strings.c (modified) (2 diffs)
-
usb/src/debug.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/src/blob.c
rbe2bb4f rb8e72fd1 477 477 if (rc != EOK) 478 478 return rc; 479 if (size_a != size_b || bcmp(buffer_a, buffer_b, size_a)) {479 if (size_a != size_b || memcmp(buffer_a, buffer_b, size_a) != 0) { 480 480 *out = false; 481 481 return EOK; -
uspace/lib/c/Makefile
rbe2bb4f rb8e72fd1 75 75 generic/device/pci.c \ 76 76 generic/device/ahci.c \ 77 generic/dnsr.c \ 77 78 generic/dlfcn.c \ 78 79 generic/elf/elf_load.c \ … … 92 93 generic/task.c \ 93 94 generic/futex.c \ 95 generic/inet/addr.c \ 94 96 generic/inet.c \ 95 97 generic/inetcfg.c \ … … 162 164 163 165 $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 164 $( GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@166 $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@ 165 167 166 168 $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 167 $( GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DLOADER -E -x c $< | grep -v "^\#" > $@169 $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DLOADER -E -x c $< | grep -v "^\#" > $@ 168 170 169 171 $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 170 $( GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@172 $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@ 171 173 172 174 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 173 $( GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@175 $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@ 174 176 175 177 $(COMMON_HEADER_ARCH): $(COMMON_HEADER) -
uspace/lib/c/arch/amd64/Makefile.common
rbe2bb4f rb8e72fd1 28 28 29 29 CLANG_ARCH = x86_64 30 CLANG_TARGET = x86_64-unknown-linux 30 31 GCC_CFLAGS += -fno-omit-frame-pointer 32 CLANG_CFLAGS += -fno-omit-frame-pointer 31 33 32 34 ENDIANESS = LE -
uspace/lib/c/arch/ia32/Makefile.common
rbe2bb4f rb8e72fd1 28 28 29 29 CLANG_ARCH = i386 30 CLANG_TARGET = i386-unknown-linux 30 31 31 32 ifeq ($(PROCESSOR),i486) … … 34 35 GCC_CFLAGS += -march=pentium -fno-omit-frame-pointer 35 36 endif 37 CLANG_CFLAGS += -fno-omit-frame-pointer 36 38 37 39 ENDIANESS = LE -
uspace/lib/c/generic/device/hw_res_parsed.c
rbe2bb4f rb8e72fd1 188 188 hw_resource_list_t hw_resources; 189 189 hw_res_list_parsed_clean(hw_res_parsed); 190 bzero(&hw_resources, sizeof(hw_resource_list_t));190 memset(&hw_resources, 0, sizeof(hw_resource_list_t)); 191 191 192 192 int rc = hw_res_get_resource_list(sess, &hw_resources); -
uspace/lib/c/generic/mem.c
rbe2bb4f rb8e72fd1 224 224 * @param s1 Pointer to the first area to compare. 225 225 * @param s2 Pointer to the second area to compare. 226 * @param len Size of the first area in bytes. Both areas must have227 * the same length.228 * 229 * @return If len is 0, return zero. If the areas match, return230 * zero. Otherwise return non-zero.231 * 232 */ 233 int bcmp(const void *s1, const void *s2, size_t len)226 * @param len Size of the areas in bytes. 227 * 228 * @return Zero if areas have the same contents. If they differ, 229 * the sign of the result is the same as the sign of the 230 * difference of the first pair of different bytes. 231 * 232 */ 233 int memcmp(const void *s1, const void *s2, size_t len) 234 234 { 235 235 uint8_t *u1 = (uint8_t *) s1; 236 236 uint8_t *u2 = (uint8_t *) s2; 237 238 for (; (len != 0) && (*u1++ == *u2++); len--); 239 240 return len; 237 size_t i; 238 239 for (i = 0; i < len; i++) { 240 if (*u1 != *u2) 241 return (int)(*u1) - (int)(*u2); 242 ++u1; 243 ++u2; 244 } 245 246 return 0; 241 247 } 242 248 -
uspace/lib/c/generic/net/inet.c
rbe2bb4f rb8e72fd1 144 144 /* Erase if no address */ 145 145 if (!address) { 146 bzero(data, count);146 memset(data, 0, count); 147 147 return ENOENT; 148 148 } … … 181 181 } else { 182 182 /* Erase the rest of the address */ 183 bzero(data + index, count - index);183 memset(data + index, 0, count - index); 184 184 return EOK; 185 185 } -
uspace/lib/c/generic/net/socket_client.c
rbe2bb4f rb8e72fd1 446 446 return ENOMEM; 447 447 448 bzero(socket, sizeof(*socket));448 memset(socket, 0, sizeof(*socket)); 449 449 fibril_rwlock_write_lock(&socket_globals.lock); 450 450 … … 657 657 return ENOMEM; 658 658 } 659 bzero(new_socket, sizeof(*new_socket));659 memset(new_socket, 0, sizeof(*new_socket)); 660 660 socket_id = socket_generate_new_id(); 661 661 if (socket_id <= 0) { -
uspace/lib/c/include/device/hw_res_parsed.h
rbe2bb4f rb8e72fd1 127 127 free(list->dma_channels.channels); 128 128 129 bzero(list, sizeof(hw_res_list_parsed_t));129 memset(list, 0, sizeof(hw_res_list_parsed_t)); 130 130 } 131 131 … … 136 136 static inline void hw_res_list_parsed_init(hw_res_list_parsed_t *list) 137 137 { 138 bzero(list, sizeof(hw_res_list_parsed_t));138 memset(list, 0, sizeof(hw_res_list_parsed_t)); 139 139 } 140 140 -
uspace/lib/c/include/inet/inet.h
rbe2bb4f rb8e72fd1 36 36 #define LIBC_INET_INET_H_ 37 37 38 #include <inet/addr.h> 38 39 #include <sys/types.h> 39 40 40 41 #define INET_TTL_MAX 255 41 42 typedef struct {43 uint32_t ipv4;44 } inet_addr_t;45 42 46 43 typedef struct { -
uspace/lib/c/include/inet/inetcfg.h
rbe2bb4f rb8e72fd1 38 38 #include <inet/inet.h> 39 39 #include <sys/types.h> 40 41 /** Network address */42 typedef struct {43 /** Address */44 uint32_t ipv4;45 /** Number of valid bits in @c ipv4 */46 int bits;47 } inet_naddr_t;48 40 49 41 /** Address object info */ -
uspace/lib/c/include/io/verify.h
rbe2bb4f rb8e72fd1 38 38 #ifndef NVERIFY_PRINTF 39 39 40 #ifdef __clang__ 41 #define PRINTF_ATTRIBUTE(start, end) \ 42 __attribute__((format(__printf__, start, end))) 43 #else 40 44 #define PRINTF_ATTRIBUTE(start, end) \ 41 45 __attribute__((format(gnu_printf, start, end))) 46 #endif 42 47 43 48 #else /* NVERIFY_PRINTF */ -
uspace/lib/c/include/ipc/services.h
rbe2bb4f rb8e72fd1 53 53 } services_t; 54 54 55 #define SERVICE_NAME_DNSR "net/dnsr" 55 56 #define SERVICE_NAME_INET "net/inet" 56 57 #define SERVICE_NAME_INETCFG "net/inetcfg" -
uspace/lib/c/include/mem.h
rbe2bb4f rb8e72fd1 38 38 #include <sys/types.h> 39 39 40 #define bzero(ptr, len) memset((ptr), 0, (len))41 42 40 extern void *memset(void *, int, size_t) 43 41 __attribute__ ((optimize("-fno-tree-loop-distribute-patterns"))); … … 45 43 __attribute__ ((optimize("-fno-tree-loop-distribute-patterns"))); 46 44 extern void *memmove(void *, const void *, size_t); 47 48 extern int bcmp(const void *, const void *, size_t); 45 extern int memcmp(const void *, const void *, size_t); 49 46 50 47 #endif -
uspace/lib/drv/generic/remote_nic.c
rbe2bb4f rb8e72fd1 104 104 105 105 nic_address_t address; 106 bzero(&address, sizeof(nic_address_t));106 memset(&address, 0, sizeof(nic_address_t)); 107 107 108 108 int rc = nic_iface->get_address(dev, &address); … … 173 173 174 174 nic_device_stats_t stats; 175 bzero(&stats, sizeof(nic_device_stats_t));175 memset(&stats, 0, sizeof(nic_device_stats_t)); 176 176 177 177 int rc = nic_iface->get_stats(dev, &stats); … … 208 208 209 209 nic_device_info_t info; 210 bzero(&info, sizeof(nic_device_info_t));210 memset(&info, 0, sizeof(nic_device_info_t)); 211 211 212 212 int rc = nic_iface->get_device_info(dev, &info); … … 399 399 } 400 400 401 bzero(address_list, max_count * sizeof(nic_address_t));401 memset(address_list, 0, max_count * sizeof(nic_address_t)); 402 402 nic_unicast_mode_t mode = NIC_UNICAST_DEFAULT; 403 403 size_t address_count = 0; … … 503 503 } 504 504 505 bzero(address_list, max_count * sizeof(nic_address_t));505 memset(address_list, 0, max_count * sizeof(nic_address_t)); 506 506 nic_multicast_mode_t mode = NIC_MULTICAST_BLOCKED; 507 507 size_t address_count = 0; … … 667 667 } 668 668 669 bzero(address_list, max_count * sizeof(nic_address_t));669 memset(address_list, 0, max_count * sizeof(nic_address_t)); 670 670 size_t address_count = 0; 671 671 … … 759 759 760 760 nic_vlan_mask_t vlan_mask; 761 bzero(&vlan_mask, sizeof(nic_vlan_mask_t));761 memset(&vlan_mask, 0, sizeof(nic_vlan_mask_t)); 762 762 763 763 int rc = nic_iface->vlan_get_mask(dev, &vlan_mask); … … 932 932 } 933 933 934 bzero(data, max_length);934 memset(data, 0, max_length); 935 935 936 936 int rc = nic_iface->wol_virtue_probe(dev, id, &type, max_length, … … 982 982 } 983 983 984 bzero(id_list, max_count * sizeof (nic_wv_id_t));984 memset(id_list, 0, max_count * sizeof (nic_wv_id_t)); 985 985 986 986 int rc = nic_iface->wol_virtue_list(dev, type, max_count, id_list, … … 1047 1047 } 1048 1048 1049 bzero(data, max_length);1049 memset(data, 0, max_length); 1050 1050 1051 1051 int rc = nic_iface->wol_load_info(dev, &type, max_length, data, -
uspace/lib/ext4/libext4_directory.c
rbe2bb4f rb8e72fd1 725 725 name_len) { 726 726 /* Compare names */ 727 if ( bcmp((uint8_t *) name, dentry->name, name_len) == 0) {727 if (memcmp((uint8_t *) name, dentry->name, name_len) == 0) { 728 728 *res_entry = dentry; 729 729 return EOK; -
uspace/lib/nic/src/nic_addr_db.c
rbe2bb4f rb8e72fd1 70 70 nic_addr_entry_t *entry = member_to_inst(item, nic_addr_entry_t, link); 71 71 72 return 0 == bcmp(entry->addr, key->addr, entry->len);72 return memcmp(entry->addr, key->addr, entry->len) == 0; 73 73 } 74 74 -
uspace/lib/nic/src/nic_driver.c
rbe2bb4f rb8e72fd1 682 682 fibril_rwlock_initialize(&nic_data->wv_lock); 683 683 684 bzero(&nic_data->mac, sizeof(nic_address_t));685 bzero(&nic_data->default_mac, sizeof(nic_address_t));686 bzero(&nic_data->stats, sizeof(nic_device_stats_t));684 memset(&nic_data->mac, 0, sizeof(nic_address_t)); 685 memset(&nic_data->default_mac, 0, sizeof(nic_address_t)); 686 memset(&nic_data->stats, 0, sizeof(nic_device_stats_t)); 687 687 688 688 return nic_data; -
uspace/lib/nic/src/nic_impl.c
rbe2bb4f rb8e72fd1 129 129 130 130 fibril_rwlock_write_lock(&nic_data->stats_lock); 131 bzero(&nic_data->stats, sizeof(nic_device_stats_t));131 memset(&nic_data->stats, 0, sizeof(nic_device_stats_t)); 132 132 fibril_rwlock_write_unlock(&nic_data->stats_lock); 133 133 … … 535 535 return ENOMEM; 536 536 } 537 bzero(virtue, sizeof(nic_wol_virtue_t));537 memset(virtue, 0, sizeof(nic_wol_virtue_t)); 538 538 if (length != 0) { 539 539 virtue->data = malloc(length); -
uspace/lib/nic/src/nic_rx_control.c
rbe2bb4f rb8e72fd1 55 55 int nic_rxc_init(nic_rxc_t *rxc) 56 56 { 57 bzero(rxc, sizeof(nic_rxc_t));57 memset(rxc, 0, sizeof(nic_rxc_t)); 58 58 int rc; 59 59 rc = nic_addr_db_init(&rxc->blocked_sources, ETH_ADDR); -
uspace/lib/nic/src/nic_wol_virtues.c
rbe2bb4f rb8e72fd1 73 73 int nic_wol_virtues_init(nic_wol_virtues_t *wvs) 74 74 { 75 bzero(wvs, sizeof(nic_wol_virtues_t));75 memset(wvs, 0, sizeof(nic_wol_virtues_t)); 76 76 wvs->table_operations.hash = nic_wv_hash; 77 77 wvs->table_operations.key_hash = nic_wv_key_hash; -
uspace/lib/posix/source/strings.c
rbe2bb4f rb8e72fd1 132 132 int posix_bcmp(const void *mem1, const void *mem2, size_t n) 133 133 { 134 return bcmp(mem1, mem2, n);134 return memcmp(mem1, mem2, n); 135 135 } 136 136 … … 156 156 void posix_bzero(void *mem, size_t n) 157 157 { 158 bzero(mem, n);158 memset(mem, 0, n); 159 159 } 160 160 -
uspace/lib/usb/src/debug.c
rbe2bb4f rb8e72fd1 84 84 * Remove previous string. 85 85 */ 86 bzero(buffer_dump[buffer_dump_index], BUFFER_DUMP_LEN);86 memset(buffer_dump[buffer_dump_index], 0, BUFFER_DUMP_LEN); 87 87 88 88 /* Do the actual dump. */
Note:
See TracChangeset
for help on using the changeset viewer.
