/* * Get the current cursor position. * Params: * state->ebx - pointer to user int where row value should be stored * state->ecx - pointer to user int where column value should be stored * Returns: 0 if successful, -1 otherwise */ static int Sys_GetCursor(struct Interrupt_State *state) { int row, col; Get_Cursor(&row, &col); if (!Copy_To_User(state->ebx, &row, sizeof(int)) || !Copy_To_User(state->ecx, &col, sizeof(int))) return -1; return 0; }
/* * Get the current cursor position. * Params: * state->ebx - pointer to user int where row value should be stored * state->ecx - pointer to user int where column value should be stored * Returns: 0 if successful, -1 otherwise */ static int Sys_GetCursor(struct Interrupt_State* state) { int row, col; Get_Cursor(&row, &col); Copy_To_User(state->ebx, &row, sizeof(int)); Copy_To_User(state->ecx, &col, sizeof(int)); return 0; //TODO("GetCursor system call"); }
/* * Get the current cursor position. * Params: * state->ebx - pointer to user int where row value should be stored * state->ecx - pointer to user int where column value should be stored * Returns: 0 if successful, -1 otherwise */ static int Sys_GetCursor(struct Interrupt_State* state) { int r=0, c=0; Get_Cursor(&r, &c); if (!Copy_To_User(state->ebx, &r, sizeof(int))) { return -1; } if (!Copy_To_User(state->ecx, &c, sizeof(int))) { return -1; } return 0; }