Lines Matching refs:tb
504 tb_import_profile(struct tbe *tb, struct tb_profile *profile)
506 tb->rate = TB_SCALE(profile->rate / 8) / machclk_freq;
507 tb->depth = TB_SCALE(profile->depth);
508 if (tb->rate > 0)
509 tb->filluptime = tb->depth / tb->rate;
511 tb->filluptime = 0xffffffffffffffffLL;
512 tb->token = tb->depth;
513 tb->last = read_machclk();
533 tb_import_profile(&tbm->tb, profile);
563 if (tbm->tb.token < len) {
565 interval = now - tbm->tb.last;
566 if (interval >= tbm->tb.filluptime)
567 tbm->tb.token = tbm->tb.depth;
569 tbm->tb.token += interval * tbm->tb.rate;
570 if (tbm->tb.token > tbm->tb.depth)
571 tbm->tb.token = tbm->tb.depth;
573 tbm->tb.last = now;
576 if (tbm->tb.token < len) {
581 tbm->tb.token -= len;
950 tb_import_profile(&tbm->tb, &ap->profile);