Lines Matching defs:rtsc
489 rtsc_init(struct runtime_sc *rtsc, struct internal_sc *isc, u64 x, u64 y)
491 rtsc->x = x;
492 rtsc->y = y;
493 rtsc->sm1 = isc->sm1;
494 rtsc->ism1 = isc->ism1;
495 rtsc->dx = isc->dx;
496 rtsc->dy = isc->dy;
497 rtsc->sm2 = isc->sm2;
498 rtsc->ism2 = isc->ism2;
506 rtsc_y2x(struct runtime_sc *rtsc, u64 y)
510 if (y < rtsc->y)
511 x = rtsc->x;
512 else if (y <= rtsc->y + rtsc->dy) {
514 if (rtsc->dy == 0)
515 x = rtsc->x + rtsc->dx;
517 x = rtsc->x + seg_y2x(y - rtsc->y, rtsc->ism1);
520 x = rtsc->x + rtsc->dx
521 + seg_y2x(y - rtsc->y - rtsc->dy, rtsc->ism2);
527 rtsc_x2y(struct runtime_sc *rtsc, u64 x)
531 if (x <= rtsc->x)
532 y = rtsc->y;
533 else if (x <= rtsc->x + rtsc->dx)
535 y = rtsc->y + seg_x2y(x - rtsc->x, rtsc->sm1);
538 y = rtsc->y + rtsc->dy
539 + seg_x2y(x - rtsc->x - rtsc->dx, rtsc->sm2);
548 rtsc_min(struct runtime_sc *rtsc, struct internal_sc *isc, u64 x, u64 y)
555 y1 = rtsc_x2y(rtsc, x);
557 /* the current rtsc is smaller */
559 rtsc->x = x;
560 rtsc->y = y;
566 * compute the two y values of the current rtsc
570 y1 = rtsc_x2y(rtsc, x);
572 /* rtsc is below isc, no change to rtsc */
576 y2 = rtsc_x2y(rtsc, x + isc->dx);
578 /* rtsc is above isc, replace rtsc by isc */
579 rtsc->x = x;
580 rtsc->y = y;
581 rtsc->dx = isc->dx;
582 rtsc->dy = isc->dy;
596 * check if (x, y1) belongs to the 1st segment of rtsc.
599 if (rtsc->x + rtsc->dx > x)
600 dx += rtsc->x + rtsc->dx - x;
603 rtsc->x = x;
604 rtsc->y = y;
605 rtsc->dx = dx;
606 rtsc->dy = dy;