Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ia32: add passing of graphmode params via syspage and platformctl #596

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions hal/ia32/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,17 @@ int hal_platformctl(void *ptr)
}
break;

case pctl_graphmode:
if (data->action == pctl_get) {
data->graphmode.width = syspage->hs.graphmode.width;
data->graphmode.height = syspage->hs.graphmode.height;
data->graphmode.bpp = syspage->hs.graphmode.bpp;
data->graphmode.pitch = syspage->hs.graphmode.pitch;
data->graphmode.framebuffer = syspage->hs.graphmode.framebuffer;
return EOK;
}
break;

default:
break;
}
Expand Down
14 changes: 13 additions & 1 deletion include/arch/ia32/ia32.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ typedef struct {
} __attribute__((packed)) pci_dev_t;


/* clang-format off */

typedef struct {
enum { pctl_set = 0, pctl_get } action;
enum { pctl_pci = 0, pctl_busmaster, pctl_reboot } type;
enum { pctl_pci = 0, pctl_busmaster, pctl_reboot, pctl_graphmode } type;

union {
struct {
Expand All @@ -91,8 +93,18 @@ typedef struct {
unsigned int magic;
unsigned int reason;
} reboot;

struct {
unsigned short width;
unsigned short height;
unsigned short bpp;
unsigned short pitch;
unsigned long framebuffer; /* addr_t */
} graphmode;
};
} platformctl_t;

/* clang-format on */


#endif
8 changes: 8 additions & 0 deletions include/arch/ia32/syspage.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ typedef struct {
unsigned int hpetLength;
unsigned long mcfg; /* addr_t */
unsigned int mcfgLength;

struct {
unsigned short width;
unsigned short height;
unsigned short bpp;
unsigned short pitch;
unsigned long framebuffer; /* addr_t */
} __attribute__((packed)) graphmode; /* Graphics mode info */
} __attribute__((packed)) hal_syspage_t;


Expand Down
Loading