type
stringclasses
5 values
content
stringlengths
9
163k
functions
int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, __be32 *psfsrc) { struct ip_sf_list *psf, *psf_prev; int rv = 0; psf_prev = NULL; for (psf = pmc->sources; psf; psf = psf->sf_next) { if (psf->sf_inaddr == *psfsrc) break; psf_prev = psf; }
functions
int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode, int sfcount, __be32 *psfsrc, int delta) { struct ip_mc_list *pmc; int changerec = 0; int i, err; if (!in_dev) return -ENODEV; rcu_read_lock(); for_each_pmc_rcu(in_dev, pmc) { if (*pmca == pmc->multiaddr) break; }
functions
endif if (!delta) { err = -EINVAL; if (!pmc->sfcount[sfmode]) goto out_unlock; pmc->sfcount[sfmode]--; }
functions
int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, __be32 *psfsrc) { struct ip_sf_list *psf, *psf_prev; psf_prev = NULL; for (psf = pmc->sources; psf; psf = psf->sf_next) { if (psf->sf_inaddr == *psfsrc) break; psf_prev = psf; }
functions
void sf_markstate(struct ip_mc_list *pmc) { struct ip_sf_list *psf; int mca_xcount = pmc->sfcount[MCAST_EXCLUDE]; for (psf = pmc->sources; psf; psf = psf->sf_next) if (pmc->sfcount[MCAST_EXCLUDE]) { psf->sf_oldin = mca_xcount == psf->sf_count[MCAST_EXCLUDE] && !psf->sf_count[MCAST_INCLUDE]; }
functions
int sf_setstate(struct ip_mc_list *pmc) { struct ip_sf_list *psf, *dpsf; int mca_xcount = pmc->sfcount[MCAST_EXCLUDE]; int qrv = pmc->interface->mr_qrv; int new_in, rv; rv = 0; for (psf = pmc->sources; psf; psf = psf->sf_next) { if (pmc->sfcount[MCAST_EXCLUDE]) { new_in = mca_xcount == psf->sf_count[MCAST_E...
functions
else if (psf->sf_oldin) { psf->sf_crcount = 0; /* * add or update "delete" records if an active filter * is now inactive */ for (dpsf = pmc->tomb; dpsf; dpsf = dpsf->sf_next) if (dpsf->sf_inaddr == psf->sf_inaddr) break; if (!dpsf) { dpsf = kmalloc(sizeof(*dpsf), GFP_ATOMIC); i...
functions
int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, int sfcount, __be32 *psfsrc, int delta) { struct ip_mc_list *pmc; int isexclude; int i, err; if (!in_dev) return -ENODEV; rcu_read_lock(); for_each_pmc_rcu(in_dev, pmc) { if (*pmca == pmc->multiaddr) break; }
functions
void ip_mc_clear_src(struct ip_mc_list *pmc) { struct ip_sf_list *psf, *nextpsf, *tomb, *sources; spin_lock_bh(&pmc->lock); tomb = pmc->tomb; pmc->tomb = NULL; sources = pmc->sources; pmc->sources = NULL; pmc->sfmode = MCAST_EXCLUDE; pmc->sfcount[MCAST_INCLUDE] = 0; pmc->sfcount[MCAST_EXCLUDE] = 1; spin_unlo...
functions
int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr) { __be32 addr = imr->imr_multiaddr.s_addr; struct ip_mc_socklist *iml, *i; struct in_device *in_dev; struct inet_sock *inet = inet_sk(sk); struct net *net = sock_net(sk); int ifindex; int count = 0; int err; ASSERT_RTNL(); if (!ipv4_is_multicast(ad...
functions
int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, struct in_device *in_dev) { struct ip_sf_socklist *psf = rtnl_dereference(iml->sflist); int err; if (!psf) { /* any-source empty exclude case */ return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, iml->sfmode, 0, NULL, 0); }
functions
int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) { struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *iml; struct ip_mc_socklist __rcu **imlp; struct in_device *in_dev; struct net *net = sock_net(sk); __be32 group = imr->imr_multiaddr.s_addr; u32 ifindex; int ret = -EADDRNOTAVAIL; ASSERT...
functions
int ip_mc_source(int add, int omode, struct sock *sk, struct ip_mreq_source *mreqs, int ifindex) { int err; struct ip_mreqn imr; __be32 addr = mreqs->imr_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev = NULL; struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; struct net *net = s...
functions
else if (pmc->sfmode != omode) { /* allow mode switches for empty-set filters */ ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, NULL, 0); ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, NULL, 0); pmc->sfmode = omode; }
functions
int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) { int err = 0; struct ip_mreqn imr; __be32 addr = msf->imsf_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev; struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *newpsl, *psl; struct net *net = sock_net(sk); int l...
functions
int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, struct ip_msfilter __user *optval, int __user *optlen) { int err, len, count, copycount; struct ip_mreqn imr; __be32 addr = msf->imsf_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev; struct inet_sock *inet = inet_sk(sk); struct ip_sf_soc...
functions
int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, struct group_filter __user *optval, int __user *optlen) { int err, i, count, copycount; struct sockaddr_in *psin; __be32 addr; struct ip_mc_socklist *pmc; struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; ASSERT_RTNL(); psin = (struc...
functions
int ip_mc_sf_allow(struct sock *sk, __be32 loc_addr, __be32 rmt_addr, int dif) { struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *pmc; struct ip_sf_socklist *psl; int i; int ret; ret = 1; if (!ipv4_is_multicast(loc_addr)) goto out; rcu_read_lock(); for_each_pmc_rcu(inet, pmc) { if (pmc->multi...
functions
void ip_mc_drop_socket(struct sock *sk) { struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *iml; struct net *net = sock_net(sk); if (!inet->mc_list) return; rtnl_lock(); while ((iml = rtnl_dereference(inet->mc_list)) != NULL) { struct in_device *in_dev; inet->mc_list = iml->next_rcu; in_dev ...
functions
int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u8 proto) { struct ip_mc_list *im; struct ip_mc_list __rcu **mc_hash; struct ip_sf_list *psf; int rv = 0; mc_hash = rcu_dereference(in_dev->mc_hash); if (mc_hash) { u32 hash = hash_32((__force u32)mc_addr, MC_HASH_SZ_LOG); for (i...
functions
else if (im) { if (src_addr) { for (psf = im->sources; psf; psf = psf->sf_next) { if (psf->sf_inaddr == src_addr) break; }
functions
int igmp_mc_seq_show(struct seq_file *seq, void *v) { if (v == SEQ_START_TOKEN) seq_puts(seq, "Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n"); else { struct ip_mc_list *im = (struct ip_mc_list *)v; struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq); char *querier; long del...
functions
int igmp_mc_seq_open(struct inode *inode, struct file *file) { return seq_open_net(inode, file, &igmp_mc_seq_ops, sizeof(struct igmp_mc_iter_state)); }
functions
int igmp_mcf_seq_show(struct seq_file *seq, void *v) { struct ip_sf_list *psf = (struct ip_sf_list *)v; struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); if (v == SEQ_START_TOKEN) { seq_puts(seq, "Idx Device MCA SRC INC EXC\n"); }
functions
int igmp_mcf_seq_open(struct inode *inode, struct file *file) { return seq_open_net(inode, file, &igmp_mcf_seq_ops, sizeof(struct igmp_mcf_iter_state)); }
functions
__net_init igmp_net_init(struct net *net) { struct proc_dir_entry *pde; int err; pde = proc_create("igmp", S_IRUGO, net->proc_net, &igmp_mc_seq_fops); if (!pde) goto out_igmp; pde = proc_create("mcfilter", S_IRUGO, net->proc_net, &igmp_mcf_seq_fops); if (!pde) goto out_mcfilter; err = inet_ctl_sock_cre...
functions
__net_exit igmp_net_exit(struct net *net) { remove_proc_entry("mcfilter", net->proc_net); remove_proc_entry("igmp", net->proc_net); inet_ctl_sock_destroy(net->ipv4.mc_autojoin_sk); }
functions
int igmp_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct in_device *in_dev; switch (event) { case NETDEV_RESEND_IGMP: in_dev = __in_dev_get_rtnl(dev); if (in_dev) ip_mc_rejoin_groups(in_dev); break; defa...
functions
__init igmp_mc_init(void) { #if defined(CONFIG_PROC_FS) int err; err = register_pernet_subsys(&igmp_net_ops); if (err) return err; err = register_netdevice_notifier(&igmp_notifier); if (err) goto reg_notif_fail; return 0; reg_notif_fail: unregister_pernet_subsys(&igmp_net_ops); return err; #else return r...
includes
#include <stdarg.h>
defines
#define N 64
defines
#define DOT1 43680
functions
int foo1(int len) { int i; int result = 0; short prod; for (i=0; i<len; i++) { prod = X[i] * Y[i]; result += prod; }
main
int main (void) { int i, dot1; check_vect (); for (i=0; i<N; i++) { X[i] = i; Y[i] = 64-i; }
functions
void micro_ops_warn(Int actual_size, Int used_size, Int line_size) { VG_(dmsg)("warning: Pentium 4 with %d KB micro-op instruction trace cache\n", actual_size); VG_(dmsg)(" Simulating a %d KB I-cache with %d B lines\n", used_size, line_size); }
functions
Int Intel_cache_info(Int level, cache_t* I1c, cache_t* D1c, cache_t* LLc) { Int cpuid1_eax; Int cpuid1_ignore; Int family; Int model; UChar info[16]; Int i, j, trials; Bool L2_found = False; /* If we see L3 cache info, copy it into L3c. Then, at the end, copy it into *LLc. Hence if a ...
functions
Int decode_AMD_cache_L2_L3_assoc ( Int bits_15_12 ) { /* Decode a L2/L3 associativity indication. It is encoded differently from the I1/D1 associativity. Returns 1 (direct-map) as a safe but suboptimal result for unknown encodings. */ switch (bits_15_12 & 0xF) { case 1: return 1; case...
functions
Int AMD_cache_info(cache_t* I1c, cache_t* D1c, cache_t* LLc) { UInt ext_level; UInt dummy, model; UInt I1i, D1i, L2i, L3i; VG_(cpuid)(0x80000000, 0, &ext_level, &dummy, &dummy, &dummy); if (0 == (ext_level & 0x80000000) || ext_level < 0x80000006) { VG_(dmsg)("warning: ext_level < 0x80000006 fo...
functions
Int get_caches_from_CPUID(cache_t* I1c, cache_t* D1c, cache_t* LLc) { Int level, ret; Char vendor_id[13]; if (!VG_(has_cpuid)()) { VG_(dmsg)("CPUID instruction not supported\n"); return -1; }
defines
#define MASK_CHAR ((int)(unsigned char) -1)
defines
#define MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT (16)
defines
#define TC_START_LABEL(x,y,z) (x == ':')
defines
#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) \
defines
#define LEX_AT 0
defines
#define LEX_BR 0
defines
#define LEX_PCT 0
defines
#define LEX_QM 0
defines
#define LEX_HASH 0
defines
#define LEX_DOLLAR 3
defines
#define LEX_TILDE 0
defines
#define tc_line_separator_chars line_separator_chars
defines
#define TC_ADDRESS_BYTES address_bytes
defines
#define md_pop_insert() pop_insert(md_pseudo_table)
defines
#define obj_pop_insert() pop_insert(obj_pseudo_table)
defines
#define cfi_pop_insert() pop_insert(cfi_pseudo_table)
defines
#define HANDLE_CONDITIONAL_ASSEMBLY() \
defines
#define TC_ALIGN_LIMIT (stdoutput->arch_info->bits_per_address - 1)
defines
#define SYM_NAME_CHUNK_LEN 128
defines
#define BSD_FILL_SIZE_CROCK_8 (8)
defines
#define BSD_FILL_SIZE_CROCK_4 (4)
defines
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
defines
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
defines
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
functions
void read_begin (void) { const char *p; pobegin (); obj_read_begin_hook (); /* Something close -- but not too close -- to a multiple of 1024. The debugging malloc I'm using has 24 bytes of overhead. */ obstack_begin (&notes, chunksize); obstack_begin (&cond_obstack, chunksize); #ifndef tc_line_sepa...
functions
int address_bytes (void) { /* Choose smallest of 1, 2, 4, 8 bytes that is large enough to contain an address. */ int n = (stdoutput->arch_info->bits_per_address - 1) / 8; n |= n >> 1; n |= n >> 2; n += 1; return n; }
functions
offsetT get_absolute_expr (expressionS *exp) { expression_and_evaluate (exp); if (exp->X_op != O_constant) { if (exp->X_op != O_absent) as_bad (_("bad or irreducible absolute expression")); exp->X_add_number = 0; }
functions
offsetT get_absolute_expression (void) { expressionS exp; return get_absolute_expr (&exp); }
functions
void pop_insert (const pseudo_typeS *table) { const char *errtxt; const pseudo_typeS *pop; for (pop = table; pop->poc_name; pop++) { errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop); if (errtxt && (!pop_override_ok || strcmp (errtxt, "exists"))) as_fatal (_("error constructing %s pseud...
functions
void pobegin (void) { po_hash = hash_new (); /* Do the target-specific pseudo ops. */ pop_table_name = "md"; md_pop_insert (); /* Now object specific. Skip any that were in the target table. */ pop_table_name = "obj"; pop_override_ok = 1; obj_pop_insert (); /* Now portable ones. Skip any that w...
functions
size_t scrub_from_string (char *buf, size_t buflen) { size_t copy; copy = scrub_string_end - scrub_string; if (copy > buflen) copy = buflen; memcpy (buf, scrub_string, copy); scrub_string += copy; return copy; }
functions
int try_macro (char term, const char *line) { sb out; const char *err; macro_entry *macro; if (check_macro (line, &out, &err, &macro)) { if (err != NULL) as_bad ("%s", err); *input_line_pointer++ = term; input_scrub_include_sb (&out, input_line_pointer, 1); sb_kill (&out);...
functions
int pending_bundle_size (fragS *frag) { unsigned int offset = frag->fr_fix; unsigned int size = 0; gas_assert (frag != frag_now); gas_assert (frag->fr_type == rs_align_code); while (frag != frag_now) { /* This should only happen in what will later become an error case. */ if (frag == NULL) ...
functions
void finish_bundle (fragS *frag, unsigned int size) { gas_assert (bundle_align_p2 > 0); gas_assert (frag->fr_type == rs_align_code); if (size > 1) { /* If there is more than a single byte, then we need to set up the alignment frag. Otherwise we leave it at its initial state from calling frag_align...
functions
void assemble_one (char *line) { fragS *insn_start_frag = NULL; if (bundle_lock_frchain != NULL && bundle_lock_frchain != frchain_now) { as_bad (_("cannot change section or subsection inside .bundle_lock")); /* Clearing this serves as a marker that we have already complained. */ bundle_lock_...
functions
else if (bundle_align_p2 > 0) { unsigned int insn_size = pending_bundle_size (insn_start_frag); if (insn_size > (1U << bundle_align_p2)) as_bad (_("\ single instruction is %u bytes long but .bundle_align_mode limit is %u"), (unsigned int) insn_size, 1U << bundle_align_p2); finish_bundle (insn...
functions
void read_a_source_file (char *name) { char c; char *s; /* String of symbol, '\0' appended. */ int temp; pseudo_typeS *pop; #ifdef WARN_COMMENTS found_comment = 0; #endif buffer = input_scrub_new_file (name); listing_file (name); listing_newline (NULL); register_dependency (name); /* Generate ...
functions
endif if (was_new_line) { line_label = NULL; if (LABELS_WITHOUT_COLONS || flag_m68k_mri) { /* Text at the start of a line must be a label, we run down and stick a colon in. */ if (is_name_beginner (*input_line_pointer)) { char *line_start = input_line_pointer; ...
functions
endif if (NO_PSEUDO_DOT || flag_m68k_mri) { /* The MRI assembler uses pseudo-ops without a period. */ pop = (pseudo_typeS *) hash_find (po_hash, s); if (pop != NULL && pop->poc_handler == NULL) pop = NULL; }
functions
HANDLE_BUNDLE if (bundle_lock_frag != NULL) { as_bad_where (bundle_lock_frag->fr_file, bundle_lock_frag->fr_line, _(".bundle_lock with no matching .bundle_unlock")); bundle_lock_frag = NULL; bundle_lock_frchain = NULL; bundle_lock_depth = 0; }
functions
void convert_to_bignum (expressionS *exp, int sign) { valueT value; unsigned int i; value = exp->X_add_number; for (i = 0; i < sizeof (exp->X_add_number) / CHARS_PER_LITTLENUM; i++) { generic_bignum[i] = value & LITTLENUM_MASK; value >>= LITTLENUM_NUMBER_OF_BITS; }
functions
void mri_comment_end (char *stop, int stopc) { know (flag_mri); input_line_pointer = stop; *stop = stopc; while (!is_end_of_line[(unsigned char) *input_line_pointer]) ++input_line_pointer; }
functions
void s_abort (int ignore ATTRIBUTE_UNUSED) { as_fatal (_(".abort detected. Abandoning ship.")); }
functions
void do_align (int n, char *fill, int len, int max) { if (now_seg == absolute_section) { if (fill != NULL) while (len-- > 0) if (*fill++ != '\0') { as_warn (_("ignoring fill value in absolute section")); break; }
functions
void s_align (int arg, int bytes_p) { unsigned int align_limit = TC_ALIGN_LIMIT; unsigned int align; char *stop = NULL; char stopc = 0; offsetT fill = 0; int max; int fill_p; if (flag_mri) stop = mri_comment_field (&stopc); if (is_end_of_line[(unsigned char) *input_line_pointer]) { if ...
functions
void s_align_bytes (int arg) { s_align (arg, 1); }
functions
void s_align_ptwo (int arg) { s_align (arg, 0); }
functions
void s_altmacro (int on) { demand_empty_rest_of_line (); macro_set_alternate (on); }
functions
else if (temp != size || !exp.X_unsigned) { as_warn (_("size (%ld) out of range, ignored"), (long) temp); ignore_rest_of_line (); goto out; }
functions
void s_comm (int ignore) { s_comm_internal (ignore, NULL); }
functions
void s_mri_common (int small ATTRIBUTE_UNUSED) { char *name; char c; char *alc = NULL; symbolS *sym; offsetT align; char *stop = NULL; char stopc = 0; if (!flag_mri) { s_comm (0); return; }
functions
endif if (line_label != NULL) { expressionS exp; exp.X_op = O_symbol; exp.X_add_symbol = sym; exp.X_add_number = 0; symbol_set_value_expression (line_label, &exp); symbol_set_frag (line_label, &zero_address_frag); S_SET_SEGMENT (line_label, expr_section); }
functions
void s_data (int ignore ATTRIBUTE_UNUSED) { segT section; int temp; temp = get_absolute_expression (); if (flag_readonly_data_in_text) { section = text_section; temp += 1000; }
functions
void s_app_file_string (char *file, int appfile ATTRIBUTE_UNUSED) { #ifdef LISTING if (listing) listing_source_file (file); #endif register_dependency (file); #ifdef obj_app_file obj_app_file (file, appfile); #endif }
functions
void s_app_file (int appfile) { char *s; int length; /* Some assemblers tolerate immediately following '"'. */ if ((s = demand_copy_string (&length)) != 0) { int may_omit = (!new_logical_line_flags (s, -1, 1) && appfile); /* In MRI mode, the preprocessor may have inserted an extraneous bac...
functions
int get_linefile_number (int *flag) { SKIP_WHITESPACE (); if (*input_line_pointer < '0' || *input_line_pointer > '9') return 0; *flag = get_absolute_expression (); return 1; }
functions
void s_app_line (int appline) { char *file = NULL; int l; /* The given number is that of the next line. */ if (appline) l = get_absolute_expression (); else if (!get_linefile_number (&l)) { ignore_rest_of_line (); return; }
functions
void s_end (int ignore ATTRIBUTE_UNUSED) { if (flag_mri) { /* The MRI assembler permits the start symbol to follow .end, but we don't support that. */ SKIP_WHITESPACE (); if (!is_end_of_line[(unsigned char) *input_line_pointer] && *input_line_pointer != '*' && *input_line_pointer != '!'...
functions
void s_err (int ignore ATTRIBUTE_UNUSED) { as_bad (_(".err encountered")); demand_empty_rest_of_line (); }
functions
void s_errwarn (int err) { int len; /* The purpose for the conditional assignment is not to internationalize the directive itself, but that we need a self-contained message, one that can be passed like the demand_copy_C_string return value, and with no assumption on the location of the name of t...
functions
void s_fail (int ignore ATTRIBUTE_UNUSED) { offsetT temp; char *stop = NULL; char stopc = 0; if (flag_mri) stop = mri_comment_field (&stopc); temp = get_absolute_expression (); if (temp >= 500) as_warn (_(".fail %ld encountered"), (long) temp); else as_bad (_(".fail %ld encountered"), (long)...