Problème pour la compilation du driver IOHIDFamily sous Tiger

claque2000

Membre confirmé
14 Novembre 2004
70
2
43
Voila, pour un projet, je dois modifier l'extension IOHIDFamily, une des fonctionnalités de cette extension étant prise en charge par mon projet d'une façon autre que dans l'extension. Le problème qui se pose à moi est la compilation du module en lui même. J'ai téléchargé les sources de IOHIDFamily-164, correspondantes au module IOHIDFamily pour 10.4.1. Et en fait, la compilation me sort 77 erreurs, qui sont toutes un problème avec absolutetime. Y'a-t-il des headers à télécharger, comment compiler un module du noyau sous tiger ?
 
Pour plus de clarté, voici les erreurs affichées par Xcode lors de la compilation :
Bloc de code:
IOHIDFamily/IOHIDDevice.cpp:132: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDFamily/IOHIDDevice.cpp:805: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDFamily/IOHIDDevice.cpp:1991: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDFamily/IOHIDDevice.cpp:1995: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDFamily/IOHIDDevice.cpp:1999: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIKeyboard.cpp:257: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIKeyboard.cpp:270: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIKeyboard.cpp:361: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIDSystem/IOHIKeyboard.cpp:363: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIDSystem/IOHIKeyboard.cpp:399: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIKeyboard.cpp:402: error: cannot convert 'AbsoluteTime' to 'uint64_t' for argument '1' to 'void clock_absolutetime_interval_to_deadline(uint64_t, uint64_t*)'
IOHIDSystem/IOHIKeyboard.cpp:404: error: cannot convert 'AbsoluteTime' to 'uint64_t' for argument '2' to 'boolean_t thread_call_enter_delayed(call_entry*, uint64_t)'
IOHIDSystem/IOHIKeyboard.cpp:438: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIKeyboard.cpp:480: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIKeyboard.cpp:652: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIKeyboard.cpp:871: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIKeyboardMapper.cpp:1511: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIDSystem/IOHIKeyboardMapper.cpp:1524: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIKeyboardMapper.cpp:1694: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIKeyboardMapper.cpp:1700: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIKeyboardMapper.cpp:1729: error: cannot convert 'AbsoluteTime' to 'uint64_t' for argument '1' to 'void clock_absolutetime_interval_to_deadline(uint64_t, uint64_t*)'
IOHIDSystem/IOHIPointing.cpp:422: error: cannot convert 'AbsoluteTime' to 'uint64_t' for argument '1' to 'void absolutetime_to_nanoseconds(uint64_t, uint64_t*)'
IOHIDSystem/IOHIPointing.cpp:423: error: cannot convert 'UnsignedWide' to 'uint64_t' for argument '1' to 'void absolutetime_to_nanoseconds(uint64_t, uint64_t*)'
IOHIDSystem/IOHIPointing.cpp:641: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIPointing.cpp:655: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIPointing.cpp:672: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIPointing.cpp:686: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:100: error: cannot convert 'UnsignedWide' to 'uint64_t' for argument '1' to 'void absolutetime_to_nanoseconds(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:107: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:162: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:163: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:165: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:463: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:475: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:476: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:663: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:664: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp: In static member function `static bool IOHIDSystem::handleTerminateNotification(void*, IOService*)':
IOHIDSystem/IOHIDSystem.cpp:760: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1054: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1056: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp: In member function `virtual int IOHIDSystem::registerScreen(IOGraphicsDevice*, Bounds*)':
IOHIDSystem/IOHIDSystem.cpp:1120: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp: In member function `void IOHIDSystem::initShmem()':
IOHIDSystem/IOHIDSystem.cpp:1244: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1246: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '3' to 'void clock_interval_to_absolutetime_interval(uint32_t, uint32_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1247: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1273: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1390: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1421: error: cannot convert 'AbsoluteTime' to 'uint64_t' for argument '1' to 'void absolutetime_to_nanoseconds(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1434: error: cannot convert 'AbsoluteTime' to 'uint64_t' for argument '1' to 'void absolutetime_to_nanoseconds(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1469: error: 'SUB_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1470: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1631: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1635: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1636: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp: In member function `void IOHIDSystem::periodicEvents(IOTimerEventSource*)':
IOHIDSystem/IOHIDSystem.cpp:1674: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:1707: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1712: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1828: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1839: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:1849: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2164: error: 'CMP_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2167: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2201: error: 'SUB_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2259: error: 'ADD_ABSOLUTETIME' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2839: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2846: error: 'AbsoluteTime_to_scalar' was not declared in this scope
IOHIDSystem/IOHIDSystem.cpp:2954: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:3361: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '2' to 'void nanoseconds_to_absolutetime(uint64_t, uint64_t*)'
IOHIDSystem/IOHIDSystem.cpp:3608: error: cannot convert 'AbsoluteTime*' to 'uint64_t*' for argument '1' to 'void clock_get_uptime(uint64_t*)'
etc..
D'après les erreurs, ça ne me semble pas être un problème de header manquant. Est ce que ce serait gcc4.0 qui soit trop restrictif ?
Merci pour votre aide.
 
Essaye de faire un simple cast.

Sinon, ça vient du fait que le KPI a changé depuis Tiger. Il y a certainement une structure de remplacement sur le site d'Apple.

Le cast devrait fonctionner.
Pour les constantes, essaye de les redéclarer.

Sinon, tu as les mailing list d'Apple ou les gens te répondront rapidement.
Pour les drivers, c'est le meilleur moyen d'obtenir des réponses?
 
Tu devrais poster quand même la question sur la mailing list Apple pour savoir si ça va pas poser problème dans le futur.

Et tiens nous au courant ;)
 
La question a été posée et la réponse qui m'a été faite est que Tiger utilise gcc4.0 par défaut avec Xcode mais le système en lui même aurait été compilé avec gcc3.3 et gcc4.0 est plus restrictif et tout cast doit etre explicit si c'est pas une conversion triviale de float vers int par exemple.
 
A ce propos, as-tu eu l'occasion de tester un peu plus en détail gcc 4?

Génère-t-il un code plus rapide à l'éxécution?
Compile-t-il aussi vite que CodeWarrior?

As-tu testé les fonction de vectorisation automatique? Doit-on donner des indications au précompilateur comme pour VAST-C?
 
SuperCed a dit:
A ce propos, as-tu eu l'occasion de tester un peu plus en détail gcc 4?
Un peu.
Génère-t-il un code plus rapide à l'éxécution?
Je n'ai pas vue de difference perceptible.
Compile-t-il aussi vite que CodeWarrior?
Tu compare une deux chevaux avec une ferrari...
As-tu testé les fonction de vectorisation automatique? Doit-on donner des indications au précompilateur comme pour VAST-C?
Non, je n'ai pas essayé cela.

Cordialement
 
J'ai voulu mettre des coups de boule pour ta réponse, mais a priori, je dois en donner à d'autres avant...