drm/amdgpu: implement cgs gpu memory callbacks

Dan Carpenter dan.carpenter at oracle.com
Mon Aug 24 22:50:32 PDT 2015


On Tue, Aug 25, 2015 at 02:07:21AM +0000, Zhou, David(ChunMing) wrote:
> >and can the shift actually
> > wrap? 
> [DZ] of course, adding shift wrap is better. fpfn/lpfn is page number, so <<PAGE_SHIFT is to convert to memory size.

By "Shift wrap" I meant how you shift beyond the end of a 32bit number
and it truncates, or if it's signed then it can wrap around (it's
undefined actually, I probably should use a different word?).

int main(void)
{
	unsigned long long a = 0xf0000000U << 12;
	unsigned long long b = 0xf0000000ULL << 12;

	printf("%llx %llx\n", a, b);

	return 0;
}

regards,
dan carpenter


More information about the dri-devel mailing list