Lines Matching defs:rtsc
488 rtsc_init(struct runtime_sc *rtsc, struct internal_sc *isc, u64 x, u64 y)
490 rtsc->x = x;
491 rtsc->y = y;
492 rtsc->sm1 = isc->sm1;
493 rtsc->ism1 = isc->ism1;
494 rtsc->dx = isc->dx;
495 rtsc->dy = isc->dy;
496 rtsc->sm2 = isc->sm2;
497 rtsc->ism2 = isc->ism2;
505 rtsc_y2x(struct runtime_sc *rtsc, u64 y)
509 if (y < rtsc->y)
510 x = rtsc->x;
511 else if (y <= rtsc->y + rtsc->dy) {
513 if (rtsc->dy == 0)
514 x = rtsc->x + rtsc->dx;
516 x = rtsc->x + seg_y2x(y - rtsc->y, rtsc->ism1);
519 x = rtsc->x + rtsc->dx
520 + seg_y2x(y - rtsc->y - rtsc->dy, rtsc->ism2);
526 rtsc_x2y(struct runtime_sc *rtsc, u64 x)
530 if (x <= rtsc->x)
531 y = rtsc->y;
532 else if (x <= rtsc->x + rtsc->dx)
534 y = rtsc->y + seg_x2y(x - rtsc->x, rtsc->sm1);
537 y = rtsc->y + rtsc->dy
538 + seg_x2y(x - rtsc->x - rtsc->dx, rtsc->sm2);
547 rtsc_min(struct runtime_sc *rtsc, struct internal_sc *isc, u64 x, u64 y)
554 y1 = rtsc_x2y(rtsc, x);
556 /* the current rtsc is smaller */
558 rtsc->x = x;
559 rtsc->y = y;
565 * compute the two y values of the current rtsc
569 y1 = rtsc_x2y(rtsc, x);
571 /* rtsc is below isc, no change to rtsc */
575 y2 = rtsc_x2y(rtsc, x + isc->dx);
577 /* rtsc is above isc, replace rtsc by isc */
578 rtsc->x = x;
579 rtsc->y = y;
580 rtsc->dx = isc->dx;
581 rtsc->dy = isc->dy;
595 * check if (x, y1) belongs to the 1st segment of rtsc.
598 if (rtsc->x + rtsc->dx > x)
599 dx += rtsc->x + rtsc->dx - x;
602 rtsc->x = x;
603 rtsc->y = y;
604 rtsc->dx = dx;
605 rtsc->dy = dy;