mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 12:43:53 +08:00
14 lines
639 B
Python
14 lines
639 B
Python
"""Explicit Dom pre-HCQ reconstruction using the existing native guards."""
|
|
from tinygrad.uop.ops import Ops
|
|
from tinygrad.runtime.support.hcq2 import HCQInfo
|
|
|
|
from openpilot.starpilot.models.runtime_bridge.qcom import Protection
|
|
from openpilot.starpilot.models.runtime_bridge.usb import USBProtection
|
|
|
|
|
|
class DomUSBProtection(USBProtection):
|
|
def protect_call(self, call, *, fresh_source=False):
|
|
if isinstance(call.arg.aux, HCQInfo) and call.arg.aux.device == ('QCOM',) and call.body.op is Ops.SINK:
|
|
return Protection.protect_call(self, call, fresh_source=True)
|
|
return super().protect_call(call, fresh_source=fresh_source)
|