Skip to content

Commit ad9f1a3

Browse files
Documented types
1 parent 681d2d2 commit ad9f1a3

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

mach/arm/vm_param.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// deno-lint-ignore-file camelcase
2+
3+
import type { int, uint } from '../../libc/c.ts';
24
import {
35
vm_page_mask_arm,
46
vm_page_mask_arm64,
@@ -59,16 +61,15 @@ export const VM_PAGE_SIZE_ARM64 = vm_page_size_arm64;
5961
* @param x Pages.
6062
* @returns Bytes.
6163
*/
62-
export const machine_ptob_arm = (x: number): number =>
63-
(x << PAGE_SHIFT_ARM) >>> 0;
64+
export const machine_ptob_arm = (x: int): uint => (x << PAGE_SHIFT_ARM) >>> 0;
6465

6566
/**
6667
* Machine pages to bytes: ARM64.
6768
*
6869
* @param x Pages.
6970
* @returns Bytes.
7071
*/
71-
export const machine_ptob_arm64 = (x: number): number =>
72+
export const machine_ptob_arm64 = (x: int): uint =>
7273
(x << PAGE_SHIFT_ARM64) >>> 0;
7374

7475
/**

mach/machine.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// deno-lint-ignore-file camelcase
22

3+
import type { int, uint } from '../libc/c.ts';
4+
35
/**
46
* CPU type.
57
*/
@@ -289,8 +291,7 @@ export const CPU_SUBTYPE_MC68030_ONLY = 3;
289291
* @param m Model.
290292
* @returns CPU subtype.
291293
*/
292-
export const CPU_SUBTYPE_INTEL = (f: number, m: number): number =>
293-
(f + (m << 4)) >>> 0;
294+
export const CPU_SUBTYPE_INTEL = (f: int, m: int): uint => (f + (m << 4)) >>> 0;
294295

295296
/**
296297
* CPU subtype: Intel all.

0 commit comments

Comments
 (0)