Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | crypto/vmac.c |
static int vmac_create(struct crypto_template *tmpl, struct rtattr **tb) {
struct shash_instance *inst;
struct crypto_cipher_spawn *spawn;
struct crypto_alg *alg;
u32 mask;
int err;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SHASH, &mask);
if (err)
return err;
inst = kzalloc(sizeof(*inst) +... | [
1,
0
] |
Linux Kernel | crypto/vmac.c |
static int __init vmac_module_init(void) {
return crypto_register_template(&vmac64_tmpl);
} | [
0,
0
] |
Linux Kernel | crypto/wp512.c |
static int __init wp512_mod_init(void) {
return crypto_register_shashes(wp_algs, ARRAY_SIZE(wp_algs));
} | [
0,
0
] |
Linux Kernel | crypto/wp512.c |
static void __exit wp512_mod_fini(void) {
crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs));
} | [
0,
0
] |
Linux Kernel | crypto/xcbc.c |
static int crypto_xcbc_digest_setkey(struct crypto_shash *parent,
const u8 *inkey, unsigned int keylen) {
unsigned long alignmask = crypto_shash_alignmask(parent);
struct xcbc_tfm_ctx *ctx = crypto_shash_ctx(parent);
u8 *consts = PTR_ALIGN(&ctx->ctx[0], alignmask + 1);
int ... | [
1,
0
] |
Linux Kernel | crypto/xcbc.c | static int crypto_xcbc_digest_update(struct shash_desc *pdesc, const u8 *p,
unsigned int len) {
struct crypto_shash *parent = pdesc->tfm;
unsigned long alignmask = crypto_shash_alignmask(parent);
struct xcbc_tfm_ctx *tctx = crypto_shash_ctx(parent);
struct xcbc_desc_ctx *ctx... | [
1,
0
] |
Linux Kernel | crypto/xctr.c | static int crypto_xctr_create(struct crypto_template *tmpl,
struct rtattr **tb) {
struct skcipher_instance *inst;
struct crypto_alg *alg;
int err;
inst = skcipher_alloc_instance_simple(tmpl, tb);
if (IS_ERR(inst))
return PTR_ERR(inst);
alg = skcipher_ialg_simple(inst);
... | [
0,
0
] |
Linux Kernel | crypto/xctr.c |
static int __init crypto_xctr_module_init(void) {
return crypto_register_template(&crypto_xctr_tmpl);
} | [
0,
0
] |
Linux Kernel | crypto/xor.c | static void __init do_xor_register(struct xor_block_template *tmpl) {
tmpl->next = template_list;
template_list = tmpl;
} | [
0,
0
] |
Linux Kernel | crypto/xts.c |
static int xts_xor_tweak_pre(struct skcipher_request *req, bool enc) {
return xts_xor_tweak(req, false, enc);
} | [
0,
0
] |
Linux Kernel | crypto/xts.c |
static void xts_cts_done(struct crypto_async_request *areq, int err) {
struct skcipher_request *req = areq->data;
le128 b;
if (!err) {
struct xts_request_ctx *rctx = skcipher_request_ctx(req);
scatterwalk_map_and_copy(&b, rctx->tail, 0, XTS_BLOCK_SIZE, 0);
le128_xor(&b, &rctx->t, &b);
scatterwa... | [
0,
0
] |
Linux Kernel | crypto/xts.c |
static int xts_encrypt(struct skcipher_request *req) {
struct xts_request_ctx *rctx = skcipher_request_ctx(req);
struct skcipher_request *subreq = &rctx->subreq;
int err;
err = xts_init_crypt(req, xts_encrypt_done) ?:
xts_xor_tweak_pre(req, true) ?:
crypto_skcipher_encrypt(subreq) ?:
xts_... | [
1,
0
] |
Linux Kernel | crypto/xts.c |
static int xts_init_tfm(struct crypto_skcipher *tfm) {
struct skcipher_instance *inst = skcipher_alg_instance(tfm);
struct xts_instance_ctx *ictx = skcipher_instance_ctx(inst);
struct xts_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
struct crypto_skcipher *child;
struct crypto_cipher *tweak;
child = crypto_sp... | [
1,
0
] |
Linux Kernel | crypto/xts.c |
static void xts_exit_tfm(struct crypto_skcipher *tfm) {
struct xts_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
crypto_free_skcipher(ctx->child);
crypto_free_cipher(ctx->tweak);
} | [
0,
0
] |
Linux Kernel | crypto/xts.c |
static void xts_free_instance(struct skcipher_instance *inst) {
struct xts_instance_ctx *ictx = skcipher_instance_ctx(inst);
crypto_drop_skcipher(&ictx->spawn);
kfree(inst);
} | [
0,
0
] |
Linux Kernel | crypto/xts.c |
static int __init xts_module_init(void) {
return crypto_register_template(&xts_tmpl);
} | [
0,
0
] |
Linux Kernel | crypto/zstd.c |
static void zstd_decomp_exit(struct zstd_ctx *ctx) {
vfree(ctx->dwksp);
ctx->dwksp = NULL;
ctx->dctx = NULL;
} | [
0,
0
] |
Linux Kernel | crypto/zstd.c |
static void __zstd_exit(void *ctx) {
zstd_comp_exit(ctx);
zstd_decomp_exit(ctx);
} | [
0,
0
] |
Linux Kernel | crypto/zstd.c |
static int __init zstd_mod_init(void) {
int ret;
ret = crypto_register_alg(&alg);
if (ret)
return ret;
ret = crypto_register_scomp(&scomp);
if (ret)
crypto_unregister_alg(&alg);
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/accel/drm_accel.c |
static int accel_stub_open(struct inode *inode, struct file *filp) {
const struct file_operations *new_fops;
struct drm_minor *minor;
int err;
minor = accel_minor_acquire(iminor(inode));
if (IS_ERR(minor))
return PTR_ERR(minor);
new_fops = fops_get(minor->dev->driver->fops);
if (!new_fops) {
er... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/buffers.c | void speakup_start_ttys(void) {
int i;
for (i = 0; i < MAX_NR_CONSOLES; i++) {
if (speakup_console[i] && speakup_console[i]->tty_stopped)
continue;
if (vc_cons[i].d && vc_cons[i].d->port.tty)
start_tty(vc_cons[i].d->port.tty);
}
} | [
1,
1
] |
Linux Kernel | drivers/accessibility/speakup/buffers.c |
static int synth_buffer_free(void) {
int chars_free;
if (buff_in >= buff_out)
chars_free = SYNTH_BUF_SIZE - (buff_in - buff_out);
else
chars_free = buff_out - buff_in;
return chars_free;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/buffers.c |
int synth_buffer_empty(void) { return (buff_in == buff_out); } | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/buffers.c |
u16 synth_buffer_getc(void) {
u16 ch;
if (buff_out == buff_in)
return 0;
ch = *buff_out++;
if (buff_out > buffer_end)
buff_out = synth_buffer;
return ch;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/fakekey.c |
int speakup_add_virtual_keyboard(void) {
int err;
virt_keyboard = input_allocate_device();
if (!virt_keyboard)
return -ENOMEM;
virt_keyboard->name = "Speakup";
virt_keyboard->id.bustype = BUS_VIRTUAL;
virt_keyboard->phys = "speakup/input0";
virt_keyboard->dev.parent = NULL;
__set_bit(EV_KEY, vi... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/genmap.c | static int get_shift_value(int state) {
int i;
for (i = 0; shift_table[i] != state; i++) {
if (shift_table[i] == -1) {
if (i >= 16)
oops("too many shift states", NULL);
shift_table[i] = state;
max_states = i + 1;
break;
}
}
return i;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/i18n.c | ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length) {
char *newstr = NULL;
unsigned long flags;
if ((index < MSG_FIRST_INDEX) || (index >= MSG_LAST_INDEX))
return -EINVAL;
newstr = kmemdup_nul(text, length, GFP_KERNEL);
if (!newstr)
return -ENOMEM;
if (index >= MSG_FORMATTED_ST... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/i18n.c | void spk_free_user_msgs(void) {
enum msg_index_t index;
unsigned long flags;
spin_lock_irqsave(&speakup_info.spinlock, flags);
for (index = MSG_FIRST_INDEX; index < MSG_LAST_INDEX; index++) {
if (speakup_msgs[index] != speakup_default_msgs[index]) {
kfree(speakup_msgs[index]);
speakup_msgs[inde... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/keyhelp.c | static void build_key_data(void) {
u_char *kp, counters[MAXFUNCS], ch, ch1;
u_short *p_key, key;
int i, offset = 1;
nstates = (int)(state_tbl[-1]);
memset(counters, 0, sizeof(counters));
memset(key_offsets, 0, sizeof(key_offsets));
kp = state_tbl + nstates + 1;
while (*kp++) {
for (i = 0; i < nsta... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/keyhelp.c |
static void say_key(int key) {
int i, state = key >> 8;
key &= 0xff;
for (i = 0; i < 6; i++) {
if (state & masks[i])
synth_printf(" %s", spk_msg_get(MSG_STATES_START + i));
}
if ((key > 0) && (key <= num_key_names))
synth_printf(" %s\n", spk_msg_get(MSG_KEYNAMES_START + (key - 1)));
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/kobjects.c | static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) {
char *cp = buf;
int i;
int n;
int num_keys;
int nstates;
u_char *cp1;
u_char ch;
unsigned long flags;
spin_lock_irqsave(&speakup_info.spinlock, flags);
cp1 = spk_key_buf + SHIFT_TBL... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/kobjects.c | static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) {
int len;
struct vc_data *vc = vc_cons[fg_console].d;
char ch = 0;
char shut;
unsigned long flags;
len = strlen(buf);
if (len > 0 && len < 3) {
ch = buf[0];
i... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/kobjects.c | static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) {
int x;
struct st_var_header *p_header;
struct punc_var_t *var;
char punc_buf[100];
unsigned long flags;
x = strlen(buf);
if (x < 1 || x > 99)
return -EINVAL;
p_he... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/kobjects.c | ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) {
int rv = 0;
struct st_var_header *param;
struct var_t *var;
char *cp1;
char *cp;
char ch;
unsigned long flags;
param = spk_var_header_by_name(attr->attr.name);
if (!param)
return -EINVAL;
... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/kobjects.c | static ssize_t message_show_helper(char *buf, enum msg_index_t first,
enum msg_index_t last) {
size_t bufsize = PAGE_SIZE;
char *buf_pointer = buf;
int printed;
enum msg_index_t cursor;
int index = 0;
*buf_pointer = '\0';
for (cursor = first; cursor <= last; cursor++, i... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/kobjects.c |
static void report_msg_status(int reset, int received, int used, int rejected,
char *groupname) {
int len;
char buf[160];
if (reset) {
pr_info("i18n messages from group %s reset to defaults\n", groupname);
} else if (received) {
len = snprintf(buf, sizeof(buf),
... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void speakup_date(struct vc_data *vc) {
spk_x = spk_cx = vc->state.x;
spk_y = spk_cy = vc->state.y;
spk_pos = spk_cp = vc->vc_pos;
spk_old_attr = spk_attr;
spk_attr = get_attributes(vc, (u_short *)spk_pos);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c | static void speech_kill(struct vc_data *vc) {
char val = synth->is_alive(synth);
if (val == 0)
return;
if (val == 2 || spk_killed) {
/* dead */
spk_shut_up &= ~0x40;
synth_printf("%s\n", spk_msg_get(MSG_IAM_ALIVE));
} else {
synth_printf("%s\n", spk_msg_get(MSG_YOU_KILLED_SPEAKUP));
sp... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_attributes(struct vc_data *vc) {
int fg = spk_attr & 0x0f;
int bg = spk_attr >> 4;
synth_printf("%s", spk_msg_get(MSG_COLORS_START + fg));
if (bg > 7) {
synth_printf(" %s ", spk_msg_get(MSG_ON_BLINKING));
bg -= 8;
} else {
synth_printf(" %s ", spk_msg_get(MSG_ON));
}
synth_pr... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void speak_char(u16 ch) {
char *cp;
struct var_t *direct = spk_get_var(DIRECT);
if (ch >= 0x100 || (direct && direct->u.n.value)) {
if (ch < 0x100 && IS_CHAR(ch, B_CAP)) {
spk_pitch_shift++;
synth_printf("%s", spk_str_caps_start);
}
synth_putwc_s(ch);
if (ch < 0x100 && IS_CHAR... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_prev_char(struct vc_data *vc) {
spk_parked |= 0x01;
if (spk_x == 0) {
announce_edge(vc, edge_left);
return;
}
spk_x--;
spk_pos -= 2;
say_char(vc);
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_prev_word(struct vc_data *vc) {
u_char temp;
u16 ch;
enum edge edge_said = edge_none;
u_short last_state = 0, state = 0;
spk_parked |= 0x01;
if (spk_x == 0) {
if (spk_y == 0) {
announce_edge(vc, edge_top);
return;
}
spk_y--;
spk_x = vc->vc_cols;
edge_said =... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c | static void spell_word(struct vc_data *vc) {
static char const *delay_str[] = {"", ",", ".", ". .", ". . ."};
u16 *cp = buf;
char *cp1;
char *str_cap = spk_str_caps_stop;
char *last_cap = spk_str_caps_stop;
struct var_t *direct = spk_get_var(DIRECT);
u16 ch;
if (!get_word(vc))
return;
while ((ch ... | [
1,
1
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_line(struct vc_data *vc) {
int i = get_line(vc);
u16 *cp;
u_short saved_punc_mask = spk_punc_mask;
if (i == 0) {
synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
buf[i++] = '\n';
if (this_speakup_key == SAY_LINE_INDENT) {
cp = buf;
while (*cp == SPACE)
cp++;
... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_next_line(struct vc_data *vc) {
spk_parked |= 0x01;
if (spk_y == vc->vc_rows - 1) {
announce_edge(vc, edge_bottom);
return;
}
spk_y++;
spk_pos += vc->vc_size_row;
say_line(vc);
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static int say_sentence_num(int num, int prev) {
bn = currbuf;
currsentence = num + 1;
if (prev && --bn == -1)
bn = 1;
if (num > numsentences[bn])
return 0;
spkup_write(sentmarks[bn][num], sentbufend[bn] - sentmarks[bn][num]);
return 1;
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void top_edge(struct vc_data *vc) {
spk_parked |= 0x01;
spk_pos = vc->vc_origin + 2 * spk_x;
spk_y = 0;
say_line(vc);
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void left_edge(struct vc_data *vc) {
spk_parked |= 0x01;
spk_pos -= spk_x * 2;
spk_x = 0;
say_char(vc);
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void right_edge(struct vc_data *vc) {
spk_parked |= 0x01;
spk_pos += (vc->vc_cols - spk_x - 1) * 2;
spk_x = vc->vc_cols - 1;
say_char(vc);
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_first_char(struct vc_data *vc) {
int i, len = get_line(vc);
u16 ch;
spk_parked |= 0x01;
if (len == 0) {
synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
for (i = 0; i < len; i++)
if (buf[i] != SPACE)
break;
ch = buf[i];
spk_pos -= (spk_x - i) * 2;
spk_x = i;
... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_last_char(struct vc_data *vc) {
int len = get_line(vc);
u16 ch;
spk_parked |= 0x01;
if (len == 0) {
synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
ch = buf[--len];
spk_pos -= (spk_x - len) * 2;
spk_x = len;
synth_printf("%d, ", ++len);
speak_char(ch);
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c | static void say_char_num(struct vc_data *vc) {
u_char tmp;
u16 ch = get_char(vc, (u_short *)spk_pos, &tmp);
synth_printf(spk_msg_get(MSG_CHAR_INFO), ch, ch);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c | static void say_from_top(struct vc_data *vc) {
say_screen_from_to(vc, 0, spk_y);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void say_to_bottom(struct vc_data *vc) {
say_screen_from_to(vc, spk_y, vc->vc_rows);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag) {
unsigned long flags;
if (!synth || up_flag || spk_killed)
return;
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
switch (value) {
case KVAL(K_SHIFT):
del_timer(&cursor_timer)... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static int edit_bits(struct vc_data *vc, u_char type, u_char ch, u_short key) {
short mask = pb_edit->mask, ch_type = spk_chartab[ch];
if (type != KT_LATIN || (ch_type & B_NUM) || ch < SPACE)
return -1;
if (ch == SPACE) {
synth_printf("%s\n", spk_msg_get(MSG_EDIT_DONE));
spk_special_handler = NULL;
... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void kbd_fakekey2(struct vc_data *vc, enum read_all_command command) {
del_timer(&cursor_timer);
speakup_fake_down_arrow();
start_read_all_timer(vc, command);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void stop_read_all(struct vc_data *vc) {
del_timer(&cursor_timer);
cursor_track = prev_cursor_track;
spk_shut_up &= 0xfe;
spk_do_flush();
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void start_read_all_timer(struct vc_data *vc,
enum read_all_command command) {
struct var_t *cursor_timeout;
cursor_con = vc->vc_num;
read_all_key = command;
cursor_timeout = spk_get_var(CURSOR_TIME);
mod_timer(&cursor_timer,
jiffies + msecs_to_jiffies(cur... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c | static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) {
unsigned long flags;
struct var_t *cursor_timeout;
spin_lock_irqsave(&speakup_info.spinlock, flags);
spk_parked &= 0xfe;
if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) {
spin_unlock_irqrestore(&speakup_info.sp... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void reset_highlight_buffers(struct vc_data *vc) {
int i;
int vc_num = vc->vc_num;
for (i = 0; i < 8; i++)
speakup_console[vc_num]->ht.highsize[i] = 0;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static int inc_dec_var(u_char value) {
struct st_var_header *p_header;
struct var_t *var_data;
char num_buf[32];
char *cp = num_buf;
char *pn;
int var_id = (int)value - VAR_START;
int how = (var_id & 1) ? E_INC : E_DEC;
var_id = var_id / 2 + FIRST_SET_VAR;
p_header = spk_get_var_header(var_id);
if... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void speakup_win_set(struct vc_data *vc) {
char info[40];
if (win_start > 1) {
synth_printf("%s\n", spk_msg_get(MSG_WINDOW_ALREADY_SET));
return;
}
if (spk_x < win_left || spk_y < win_top) {
synth_printf("%s\n", spk_msg_get(MSG_END_BEFORE_START));
return;
}
if (win_start && spk_x ==... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/main.c |
static void speakup_bits(struct vc_data *vc) {
int val = this_speakup_key - (FIRST_EDIT_BITS - 1);
if (spk_special_handler || val < 1 || val > 6) {
synth_printf("%s\n", spk_msg_get(MSG_ERROR));
return;
}
pb_edit = &spk_punc_info[val];
synth_printf(spk_msg_get(MSG_EDIT_PROMPT), pb_edit->name);
spk_... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/selection.c | int speakup_set_selection(struct tty_struct *tty) {
tty_kref_get(tty);
if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) {
tty_kref_put(tty);
return -EBUSY;
}
/* now we have the 'lock' by setting tty member of
* speakup_selection_work. wmb() ensures that writes to
* speakup_sel_work don't happen bef... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/selection.c |
int speakup_paste_selection(struct tty_struct *tty) {
tty_kref_get(tty);
if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) {
tty_kref_put(tty);
return -EBUSY;
}
schedule_work_on(WORK_CPU_UNBOUND, &speakup_paste_work.work);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/serialio.c |
static void spk_serial_tiocmset(struct spk_synth *in_synth, unsigned int set,
unsigned int clear) {
int old = inb(speakup_info.port_tts + UART_MCR);
outb((old & ~clear) | set, speakup_info.port_tts + UART_MCR);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/serialio.c | static int spk_serial_wait_for_xmitr(struct spk_synth *in_synth) {
int tmout = SPK_XMITR_TIMEOUT;
if ((in_synth->alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) {
pr_warn("%s: too many timeouts, deactivating speakup\n",
in_synth->long_name);
in_synth->alive = 0;
speakup_start_ttys();
tim... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/serialio.c | static void spk_serial_flush_buffer(struct spk_synth *in_synth) {
/* TODO: flush the UART 16550 buffer */
} | [
0,
1
] |
Linux Kernel | drivers/accessibility/speakup/serialio.c |
static int spk_serial_out(struct spk_synth *in_synth, const char ch) {
if (in_synth->alive && spk_serial_wait_for_xmitr(in_synth)) {
outb_p(ch, speakup_info.port_tts);
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_decext.c |
static void read_buff_add(u_char ch) { last_char = ch; } | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_decpc.c |
static int dt_waitbit(int bit) {
int timeout = 100;
while (--timeout > 0) {
if ((dt_getstatus() & bit) == bit)
return 1;
udelay(50);
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_decpc.c |
static const char *synth_immediate(struct spk_synth *synth, const char *buf) {
u_char ch;
while ((ch = *buf)) {
if (ch == '\n')
ch = PROCSPEECH;
if (dt_sendchar(ch))
return buf;
buf++;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_decpc.c |
static int synth_probe(struct spk_synth *synth) {
int i = 0, failed = 0;
pr_info("Probing for %s.\n", synth->long_name);
for (i = 0; synth_portlist[i]; i++) {
if (synth_request_region(synth_portlist[i], SYNTH_IO_EXTENT)) {
pr_warn("request_region: failed with 0x%x, %d\n", synth_portlist[i],
... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_dectlk.c |
static inline int synth_full(void) { return xoff; } | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_dectlk.c |
static int is_indnum(u_char *ch) {
if ((*ch >= '0') && (*ch <= '9')) {
*ch = *ch - '0';
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_dectlk.c | static void synth_flush(struct spk_synth *synth) {
if (in_escape)
synth->io_ops->synth_out(synth, ']');
in_escape = 0;
is_flushing = 1;
synth->io_ops->flush_buffer(synth);
synth->io_ops->synth_out(synth, SYNTH_CLEAR);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_dtlk.c | static struct synth_settings *synth_interrogate(struct spk_synth *synth) {
u_char *t;
static char buf[sizeof(struct synth_settings) + 1];
int total, i;
static struct synth_settings status;
synth_immediate(synth, "\x18\x01?");
for (total = 0, i = 0; i < 50; i++) {
buf[total] = synth_read_tts();
if (... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_keypc.c |
static char *oops(void) {
int s1, s2, s3, s4;
s1 = inb_p(synth_port);
s2 = inb_p(synth_port + 1);
s3 = inb_p(synth_port + 2);
s4 = inb_p(synth_port + 3);
pr_warn("synth timeout %d %d %d %d\n", s1, s2, s3, s4);
return NULL;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_keypc.c |
static void synth_flush(struct spk_synth *synth) {
outb_p(SYNTH_CLEAR, synth_port);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_ltlk.c | static void synth_interrogate(struct spk_synth *synth) {
unsigned char *t, i;
unsigned char buf[50], rom_v[20];
synth->synth_immediate(synth, "\x18\x01?");
for (i = 0; i < 50; i++) {
buf[i] = synth->io_ops->synth_in(synth);
if (i > 2 && buf[i] == 0x7f)
break;
}
t = buf + 2;
for (i = 0; *t !... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c |
static char *get_initstring(void) {
static char buf[40];
char *cp;
struct var_t *var;
size_t len;
size_t n;
memset(buf, 0, sizeof(buf));
cp = buf;
len = sizeof(buf);
var = synth_soft.vars;
while (var->var_id != MAXVARS) {
if (var->var_id != CAPS_START && var->var_id != CAPS_STOP &&
va... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c | static int softsynth_open(struct inode *inode, struct file *fp) {
unsigned long flags;
/* return -EPERM; */
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (synth_soft.alive) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -EBUSY;
}
synth_soft.alive = 1;
spin_unlock_irqrestor... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c |
static ssize_t softsynth_read(struct file *fp, char __user *buf, size_t count,
loff_t *pos) {
return softsynthx_read(fp, buf, count, pos, 0);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c |
static ssize_t softsynth_write(struct file *fp, const char __user *buf,
size_t count, loff_t *pos) {
unsigned long supplied_index = 0;
int converted;
converted = kstrtoul_from_user(buf, count, 0, &supplied_index);
if (converted < 0)
return converted;
last_index = supplie... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c |
static __poll_t softsynth_poll(struct file *fp,
struct poll_table_struct *wait) {
unsigned long flags;
__poll_t ret = 0;
poll_wait(fp, &speakup_event, wait);
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (synth_current() == &synth_soft &&
(!synth_buffer_empty() |... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c |
static int softsynth_probe(struct spk_synth *synth) {
if (misc_registered != 0)
return 0;
memset(&synth_device, 0, sizeof(synth_device));
synth_device.minor = MISC_DYNAMIC_MINOR;
synth_device.name = "softsynth";
synth_device.fops = &softsynth_fops;
if (misc_register(&synth_device)) {
pr_warn("Could... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_soft.c |
static void softsynth_release(struct spk_synth *synth) {
misc_deregister(&synth_device);
misc_deregister(&synthu_device);
misc_registered = 0;
pr_info("unregistered /dev/softsynth\n");
pr_info("unregistered /dev/softsynthu\n");
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/speakup_spkout.c |
static void synth_flush(struct spk_synth *synth) {
synth->io_ops->flush_buffer(synth);
synth->io_ops->send_xchar(synth, SYNTH_CLEAR);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/spk_ttyio.c |
static int ser_to_dev(int ser, dev_t *dev_no) {
if (ser < 0 || ser > (255 - 64)) {
pr_err(
"speakup: Invalid ser param. Must be between 0 and 191 inclusive.\n");
return -EINVAL;
}
*dev_no = MKDEV(4, (64 + ser));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/spk_ttyio.c |
void spk_ttyio_register_ldisc(void) {
if (tty_register_ldisc(&spk_ttyio_ldisc_ops))
pr_warn("speakup: Error registering line discipline. Most synths won't "
"work.\n");
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/spk_ttyio.c | static int spk_ttyio_out(struct spk_synth *in_synth, const char ch) {
struct tty_struct *tty = in_synth->dev;
int ret;
if (!in_synth->alive || !tty->ops->write)
return 0;
ret = tty->ops->write(tty, &ch, 1);
if (ret == 0)
return 0;
if (ret > 0)
/* Success */
return 1;
pr_warn("%s: I/O... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/spk_ttyio.c |
static int spk_ttyio_out_unicode(struct spk_synth *in_synth, u16 ch) {
int ret;
if (ch < 0x80) {
ret = spk_ttyio_out(in_synth, ch);
} else if (ch < 0x800) {
ret = spk_ttyio_out(in_synth, 0xc0 | (ch >> 6));
ret &= spk_ttyio_out(in_synth, 0x80 | (ch & 0x3f));
} else {
ret = spk_ttyio_out(in_synt... | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/spk_ttyio.c |
int spk_ttyio_synth_probe(struct spk_synth *synth) {
int rv = spk_ttyio_initialise_ldisc(synth);
if (rv)
return rv;
synth->alive = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/spk_ttyio.c |
const char *spk_ttyio_synth_immediate(struct spk_synth *in_synth,
const char *buff) {
struct tty_struct *tty = in_synth->dev;
u_char ch;
while ((ch = *buff)) {
if (ch == '\n')
ch = in_synth->procspeech;
if (tty_write_room(tty) < 1 || !in_synth->io_ops->synth_o... | [
1,
0
] |
Linux Kernel | drivers/accessibility/speakup/synth.c |
void spk_synth_flush(struct spk_synth *synth) {
synth->io_ops->flush_buffer(synth);
synth->io_ops->synth_out(synth, synth->clear);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/synth.c |
unsigned char spk_synth_get_index(struct spk_synth *synth) {
return synth->io_ops->synth_in_nowait(synth);
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/synth.c |
int spk_synth_is_alive_nop(struct spk_synth *synth) {
synth->alive = 1;
return 1;
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/synth.c |
void synth_start(void) {
struct var_t *trigger_time;
if (!synth->alive) {
synth_buffer_clear();
return;
}
trigger_time = spk_get_var(TRIGGER);
if (!timer_pending(&thread_timer))
mod_timer(&thread_timer,
jiffies + msecs_to_jiffies(trigger_time->u.n.value));
} | [
0,
0
] |
Linux Kernel | drivers/accessibility/speakup/synth.c |
void synth_putwc_s(u16 wc) {
synth_buffer_add(wc);
synth_start();
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.