mirror of
https://github.com/hholtmann/smcFanControl.git
synced 2025-11-04 19:49:16 +01:00
Dramatically reduced energy impact by improving code efficiency
Cached various information to reduce calls to get information from hardware. Avoided dynamic memory allocation. Added brief comments and TODOs.
This commit is contained in:
24
smc-command/smc.h
Normal file → Executable file
24
smc-command/smc.h
Normal file → Executable file
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Apple System Management Control (SMC) Tool
|
||||
* Copyright (C) 2006 devnull
|
||||
* Portions Copyright (C) 2013 Michael Wilber
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -89,13 +90,20 @@ typedef struct {
|
||||
} SMCVal_t;
|
||||
|
||||
UInt32 _strtoul(char *str, int size, int base);
|
||||
kern_return_t SMCOpen(io_connect_t *conn);
|
||||
kern_return_t SMCReadKey(UInt32Char_t key, SMCVal_t *val);
|
||||
kern_return_t SMCReadKey2(UInt32Char_t key, SMCVal_t *val,io_connect_t conn);
|
||||
kern_return_t SMCWriteSimple(UInt32Char_t key,char *wvalue,io_connect_t conn);
|
||||
kern_return_t SMCClose(io_connect_t conn);
|
||||
void smc_init();
|
||||
void smc_close();
|
||||
|
||||
float _strtof(char *str, int size, int e);
|
||||
|
||||
// Exclude command-line only code from smcFanControl UI
|
||||
#ifdef CMD_TOOL
|
||||
|
||||
void smc_init();
|
||||
void smc_close();
|
||||
kern_return_t SMCReadKey(UInt32Char_t key, SMCVal_t *val);
|
||||
kern_return_t SMCWriteSimple(UInt32Char_t key,char *wvalue,io_connect_t conn);
|
||||
|
||||
#endif //#ifdef CMD_TOOL
|
||||
|
||||
kern_return_t SMCOpen(io_connect_t *conn);
|
||||
kern_return_t SMCClose(io_connect_t conn);
|
||||
kern_return_t SMCReadKey2(UInt32Char_t key, SMCVal_t *val,io_connect_t conn);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user