深度学习计算框架综述(十三)HVX 计算优化实践—Unsigned PD 介绍

如果设备已经开启了Secure Boot,可以通过Unsigned PD的方式开发Hexagon DSP的应用:

Unsigned PD is a sandboxed low-rights process that allows the signature-free modules to run on the cDSP

只需要三行代码,就可以帮助开发者确定设备是否支持Unsigned PD:

UNSIGNED_PD_SUPPORT

  • Description: Check if DSP supports unsigned PD.

  • Return value: Supported = 1, unsupported = 0.

  • Example:

    // Querying CDSP
    struct remote_dsp_capability dsp_cap = {CDSP_DOMAIN_ID, UNSIGNED_PD_SUPPORT, 0};
    remote_handle_control(DSPRPC_GET_DSP_INFO, &dsp_cap, sizeof(struct remote_dsp_capability);
    printf("Result of capability query for UNSIGNED_PD_SUPPORT is %d", dsp_cap.capability);

如果确定设备支持Unsigned PD,就可以通过下面这段代码获得创建Unsigned PD的权限,但是这段代码必须在调用FastRPC函数前执行:

 #pragma weak remote_session_control

if (remote_session_control) {

    struct remote_rpc_control_unsigned_module data;

    data.enable = 1;

    data.domain = CDSP_DOMAIN_ID;

    remote_session_control(DSPRPC_CONTROL_UNSIGNED_MODULE, (void*)&data, sizeof(data));

}

未签名的模块,存在一些限制,下面的内容摘自Hexagon SDK 3.5.1的文档:

Unsigned PD available services

  • Thread creation and thread services

  • Timer creation and timer services

  • HVX contexts

  • Clock frequency controls

  • VTCM

  • Cache operations

  • Map HLOS memory allocated by corresponding HLOS application

Unsigned PD limitations

  • Access to limited drivers i.e. UBWC/DMA and Camera Streamer are not available to Unsigned PDs

  • Following are the limitations on Threads per Unsigned PD:

    • Thread priority ceiling (Highest priority for any Unsigned PD thread) : 64

    • Maximum number of threads allowed per Unsigned PD : 128

NOTE: These limitations could change in the future.

简而言之,部分驱动是不可访问的,同时线程的优先级和最大线程数也会受限,但是基本功能都是可用的,而且这些限制在以后可能会有变动。

对于三方开发者,可以通过这种方式在Hexagon DSP上开发应用,或者在调试程序时,如果觉得给设备签名很麻烦,也可以采用这种方式。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值