c4e730e218
And add Gen7 implementation. v2: Fix off by one error in buffer size calculation. Reviewed-by: Paul Berry <stereotype441@gmail.com>