-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36abfb3
commit c5cf97a
Showing
13 changed files
with
201 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
struct pipe { | ||
struct dma_attachment attachment; | ||
unsigned int options; | ||
}; | ||
|
||
#endif //!__INTERNAL_PIPE_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* MollenOS | ||
* | ||
* Copyright 2020, Philip Meulengracht | ||
* | ||
* This program is free software : you can redistribute it and / or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation ? , either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program.If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Generic IO Cotntol. These are functions that may be supported by all | ||
* io descriptors. If they are not supported errno is set to EBADF | ||
*/ | ||
|
||
#ifndef __C_IOCTL_H__ | ||
#define __C_IOCTL_H__ | ||
|
||
#include <crtdefs.h> | ||
|
||
// groups | ||
#define _IOCTL_SHARED 'x' | ||
|
||
// options | ||
#define _IOCTL_VOID 0x20000000 | ||
#define _IOCTL_READ 0x40000000 | ||
#define _IOCTL_WRITE 0x80000000 | ||
#define _IOCTL_READWRITE (_IOCTL_READ | _IOCTL_WRITE) | ||
|
||
// decoding macros | ||
#define _IOCTL_TYPE(x) ((x >> 16) & 0xFF) | ||
#define _IOCTL_CMD(x) ((x >> 8) & 0xFF) | ||
|
||
// encoding macros | ||
#define _IOC(dir, type, cmd, len) (dir | (type << 16) || (cmd << 8) || len) | ||
#define _IOC_V(type, cmd) _IOC(_IOCTL_VOID, type, cmd, 0) | ||
#define _IOC_R(type, cmd, arg_type) _IOC(_IOCTL_READ, type, cmd, sizeof(arg_type)) | ||
#define _IOC_W(type, cmd, arg_type) _IOC(_IOCTL_WRITE, type, cmd, sizeof(arg_type)) | ||
#define _IOC_RW(type, cmd, arg_type) _IOC(_IOCTL_READWRITE, type, cmd, sizeof(arg_type)) | ||
|
||
// shared commands that ctl standard iod functions | ||
#define FIONBIO _IOC_W(_IOCTL_SHARED, 0, int) // set blocking io | ||
#define FIOASYNC _IOC_W(_IOCTL_SHARED, 1, int) // set async io | ||
#define FIONREAD _IOC_R(_IOCTL_SHARED, 2, int) // number of bytes available | ||
|
||
CRTDECL(int, ioctl(int iod, unsigned long request, ...)); | ||
|
||
#endif //!__C_IOCTL_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* MollenOS | ||
* | ||
* Copyright 2020, Philip Meulengracht | ||
* | ||
* This program is free software : you can redistribute it and / or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation ? , either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program.If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Generic IO Cotntol. These are functions that may be supported by all | ||
* io descriptors. If they are not supported errno is set to EBADF | ||
*/ | ||
|
||
#include <internal/_io.h> | ||
#include <ioctl.h> | ||
#include <os/mollenos.h> | ||
|
||
int ioctl(int iod, unsigned long request, ...) | ||
{ | ||
stdio_handle_t* handle = stdio_handle_get(iod); | ||
OsStatus_t status; | ||
va_list args; | ||
|
||
if (!handle) { | ||
_set_errno(EBADF); | ||
return -1; | ||
} | ||
|
||
va_start(args, request); | ||
status = handle->ops.ioctl(handle, request, args); | ||
va_end(args); | ||
|
||
if (status == OsNotSupported) { | ||
_set_errno(EBADF); | ||
return -1; | ||
} | ||
return OsStatusToErrno(status); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c5cf97a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamCity ValiOS / i386 / Build Build 355 is now running
c5cf97a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamCity ValiOS / i386 / Build Build 355 outcome was SUCCESS
Summary: Running Build time: 00:02:50