kvisc/vm/dv/cpudev.c

40 lines
650 B
C
Raw Normal View History

2019-06-05 19:31:48 +02:00
// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
2019-06-13 23:12:11 +02:00
#include <pc/dev.h>
2019-06-05 19:31:48 +02:00
2019-06-05 22:11:45 +02:00
long cpudev_testfn(ctx_t *ctx, dev_t *dev)
2019-06-05 19:48:56 +02:00
{
assert(dev == &cpudev);
rax = 4;
rdx = 3;
2019-06-05 22:11:45 +02:00
return 0;
2019-06-05 19:48:56 +02:00
}
2019-06-05 22:11:45 +02:00
long cpudev_poweron(ctx_t *ctx, dev_t *dev)
2019-06-05 19:48:56 +02:00
{
assert(dev == &cpudev);
dev->fslots[0] = cpudev_testfn;
dev->state = DEVGOOD;
2019-06-05 22:11:45 +02:00
return 0;
2019-06-05 19:48:56 +02:00
}
2019-06-05 19:31:48 +02:00
dev_t cpudev =
{
.type = "cpu",
.name = "K-CPU",
2019-06-05 22:11:45 +02:00
.modl = "Prisma 1",
2019-06-05 19:31:48 +02:00
.vend = "The OS/K Team",
2019-06-13 23:12:11 +02:00
.major = KARCH_MAJOR,
.minor = KARCH_MINOR,
.revis = KARCH_REVIS,
2019-06-05 19:48:56 +02:00
.fpwon = cpudev_poweron,
2019-06-05 19:31:48 +02:00
};