Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2020 Developer ToolsSystem Services

WWDC20 · 23 min · Developer Tools / System Services

Explore the new system architecture of Apple silicon Macs

Discover how Macs with Apple silicon will deliver modern advantages using Apple’s System-on-Chip (SoC) architecture. Leveraging a unified memory architecture for CPU and GPU tasks, Mac apps will see amazing performance benefits from Apple silicon tuned frameworks such as Metal and Accelerate. Learn about new features and changes coming to boot and security, and how these may affect your applications.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 2 snippets

Set up DMA transfer in a PCIe driver swift · at 9:42 ↗
// Get the IOMapper for the device
IOMapper *mapper = IOMapper::copyMapperForDevice(device);

// Use an IODMACommand; pass the mapper when initializing
IODMACommand *dmaCommand = IODMACommand::withSpecification(
   outSegFunc, numAddressBits, maxSegmentSize, mappingOptions,
   maxTransferSize, alignment, mapper, refCon);

// Keep the IODMACommand prepared for the duration of the i/o
Check if running in Rosetta objectivec · at 14:31 ↗
// Use "sysctl.proc_translated" to check if running in Rosetta

// Returns 1 if running in Rosetta
int processIsTranslated() {
   int ret = 0;
   size_t size = sizeof(ret);

   // Call the sysctl and if successful return the result
   if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) != -1) 
      return ret;

   // If "sysctl.proc_translated" is not present then must be native
   if (errno == ENOENT)
      return 0;

   return -1;
}