~fultonbrowne/rc-scripts

ref: 68da554c01b584108eb3c7cffe86961ca09e1d2b rc-scripts/util/fscale -rwxr-xr-x 406 bytes
68da554c — glenda so I clearly don't know rc very well 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/rc
# by mischief

fn x86_speed {
	if(! io -wM 0x19A $1 >[2]/dev/null){
		echo unsupported processor
		exit unsupported
	}
}

fn x86_slow {
	x86_speed 0x12
}

fn x86_fast {
	x86_speed 0x0
}

arch=()

switch $objtype {
case 386 amd64
	arch=x86
case *
	echo unsupported architecture
	exit unsupported
}

switch $1 {
case off
	$arch^_slow
case on
	$arch^_fast
case *
	echo invalid mode
	exit invalid
}